aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 11:54:09 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 11:54:09 +0000
commitb4c64ad90b81d2a779786b7edb4c5c6dd28cc57d (patch)
tree13f237c02db4d1894ab06884d1b739344766bede
parent61b9a7258a7693d7f3674a5a1daf7b036ff1d382 (diff)
downloadsrc-vendor/libc++/r256633.tar.gz
src-vendor/libc++/r256633.zip
Vendor import of libc++ trunk r256633:vendor/libc++/r256633
-rw-r--r--CMakeLists.txt468
-rw-r--r--TODO.TXT21
-rw-r--r--cmake/Modules/HandleLibCXXABI.cmake13
-rw-r--r--cmake/Modules/HandleLibcxxFlags.cmake169
-rw-r--r--cmake/Modules/HandleOutOfTreeLLVM.cmake138
-rw-r--r--cmake/config-ix.cmake22
-rw-r--r--docs/BuildingLibcxx.rst306
-rw-r--r--docs/CMakeLists.txt9
-rw-r--r--docs/DesignDocs/ABIVersioning.rst17
-rw-r--r--docs/DesignDocs/CapturingConfigInfo.rst88
-rw-r--r--docs/Makefile.sphinx37
-rw-r--r--docs/README.txt13
-rw-r--r--docs/TestingLibcxx.rst191
-rw-r--r--docs/UsingLibcxx.rst89
-rw-r--r--docs/conf.py251
-rw-r--r--docs/index.rst185
-rw-r--r--include/CMakeLists.txt28
-rw-r--r--include/__config135
-rw-r--r--include/__config_site.in23
-rw-r--r--include/__functional_03571
-rw-r--r--include/__functional_base239
-rw-r--r--include/__functional_base_031104
-rw-r--r--include/__hash_table42
-rw-r--r--include/__locale6
-rw-r--r--include/__mutex_base5
-rw-r--r--include/__nullptr66
-rw-r--r--include/__split_buffer15
-rw-r--r--include/__std_stream1
-rw-r--r--include/__tree10
-rw-r--r--include/__tuple40
-rw-r--r--include/algorithm8
-rw-r--r--include/array20
-rw-r--r--include/atomic38
-rw-r--r--include/bitset124
-rw-r--r--include/cctype101
-rw-r--r--include/cerrno360
-rw-r--r--include/cfenv2
-rw-r--r--include/cfloat8
-rw-r--r--include/chrono131
-rw-r--r--include/cinttypes3
-rw-r--r--include/cmath1168
-rw-r--r--include/complex.h10
-rw-r--r--include/condition_variable21
-rw-r--r--include/csetjmp4
-rw-r--r--include/cstddef50
-rw-r--r--include/cstdio35
-rw-r--r--include/cstdlib22
-rw-r--r--include/ctype.h69
-rw-r--r--include/cwchar9
-rw-r--r--include/cwctype126
-rw-r--r--include/deque110
-rw-r--r--include/errno.h398
-rw-r--r--include/exception2
-rw-r--r--include/experimental/algorithm6
-rw-r--r--include/experimental/any590
-rw-r--r--include/experimental/dynarray2
-rw-r--r--include/experimental/functional454
-rw-r--r--include/ext/hash_map2
-rw-r--r--include/float.h83
-rw-r--r--include/forward_list3
-rw-r--r--include/functional213
-rw-r--r--include/future141
-rw-r--r--include/inttypes.h251
-rw-r--r--include/ios21
-rw-r--r--include/istream47
-rw-r--r--include/iterator10
-rw-r--r--include/list49
-rw-r--r--include/locale25
-rw-r--r--include/map8
-rw-r--r--include/math.h1419
-rw-r--r--include/memory177
-rw-r--r--include/module.modulemap6
-rw-r--r--include/mutex2
-rw-r--r--include/ostream32
-rw-r--r--include/random20
-rw-r--r--include/ratio33
-rw-r--r--include/regex246
-rw-r--r--include/scoped_allocator4
-rw-r--r--include/set6
-rw-r--r--include/setjmp.h45
-rw-r--r--include/sstream56
-rw-r--r--include/stddef.h62
-rw-r--r--include/stdio.h127
-rw-r--r--include/stdlib.h130
-rw-r--r--include/streambuf38
-rw-r--r--include/string113
-rw-r--r--include/support/musl/xlocale.h58
-rw-r--r--include/system_error2
-rw-r--r--include/thread56
-rw-r--r--include/tuple42
-rw-r--r--include/type_traits726
-rw-r--r--include/unordered_map2
-rw-r--r--include/utility98
-rw-r--r--include/valarray312
-rw-r--r--include/vector39
-rw-r--r--include/wchar.h136
-rw-r--r--include/wctype.h79
-rw-r--r--lib/CMakeLists.txt150
-rw-r--r--lib/libc++abi2.exp10
-rw-r--r--src/any.cpp18
-rw-r--r--src/exception.cpp10
-rw-r--r--src/future.cpp2
-rw-r--r--src/include/atomic_support.h (renamed from src/support/atomic_support.h)7
-rw-r--r--src/include/config_elast.h (renamed from src/config_elast.h)0
-rw-r--r--src/ios.cpp4
-rw-r--r--src/locale.cpp20
-rw-r--r--src/memory.cpp6
-rw-r--r--src/mutex.cpp2
-rw-r--r--src/new.cpp10
-rw-r--r--src/stdexcept.cpp6
-rw-r--r--src/system_error.cpp2
-rw-r--r--src/typeinfo.cpp9
-rw-r--r--test/CMakeLists.txt115
-rw-r--r--test/libcxx/atomics/libcpp-has-no-threads.fail.cpp (renamed from test/std/atomics/libcpp-has-no-threads.fail.cpp)0
-rw-r--r--test/libcxx/atomics/libcpp-has-no-threads.pass.cpp (renamed from test/std/atomics/libcpp-has-no-threads.pass.cpp)2
-rw-r--r--test/libcxx/compiler.py36
-rw-r--r--test/libcxx/containers/sequences/deque/incomplete.pass.cpp31
-rw-r--r--test/libcxx/containers/sequences/vector/asan.pass.cpp (renamed from test/std/containers/sequences/vector/asan.pass.cpp)31
-rw-r--r--test/libcxx/containers/sequences/vector/asan_throw.pass.cpp (renamed from test/std/containers/sequences/vector/asan_throw.pass.cpp)1
-rw-r--r--test/libcxx/double_include.sh.cpp7
-rw-r--r--test/libcxx/experimental/any/size_and_alignment.pass.cpp23
-rw-r--r--test/libcxx/experimental/any/small_type.pass.cpp114
-rw-r--r--test/libcxx/experimental/any/version.pass.cpp20
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp44
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp34
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp41
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp1
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp45
-rw-r--r--test/libcxx/test/config.py294
-rw-r--r--test/libcxx/test/format.py21
-rw-r--r--test/libcxx/test/target_info.py223
-rw-r--r--test/libcxx/test/tracing.py6
-rw-r--r--test/libcxx/thread/futures/version.pass.cpp (renamed from test/std/thread/futures/version.pass.cpp)0
-rw-r--r--test/libcxx/type_traits/convert_to_integral.pass.cpp17
-rw-r--r--test/libcxx/type_traits/lazy_metafunctions.pass.cpp137
-rw-r--r--test/libcxx/utilities/memory/util.smartptr/race_condition.pass.cpp3
-rw-r--r--test/libcxx/utilities/time/date.time/asctime.thread-unsafe.fail.cpp (renamed from test/std/utilities/date.time/asctime.thread-unsafe.fail.cpp)0
-rw-r--r--test/libcxx/utilities/time/date.time/ctime.thread-unsafe.fail.cpp (renamed from test/std/utilities/date.time/ctime.thread-unsafe.fail.cpp)0
-rw-r--r--test/libcxx/utilities/time/date.time/gmtime.thread-unsafe.fail.cpp (renamed from test/std/utilities/date.time/gmtime.thread-unsafe.fail.cpp)0
-rw-r--r--test/libcxx/utilities/time/date.time/localtime.thread-unsafe.fail.cpp (renamed from test/std/utilities/date.time/localtime.thread-unsafe.fail.cpp)0
-rw-r--r--test/lit.site.cfg.in9
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.partitions/stable_partition.pass.cpp10
-rw-r--r--test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp8
-rw-r--r--test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp4
-rw-r--r--test/std/atomics/atomics.flag/atomic_flag_clear.pass.cpp4
-rw-r--r--test/std/atomics/atomics.flag/atomic_flag_clear_explicit.pass.cpp12
-rw-r--r--test/std/atomics/atomics.flag/clear.pass.cpp16
-rw-r--r--test/std/atomics/atomics.flag/default.pass.cpp3
-rw-r--r--test/std/atomics/atomics.flag/init.pass.cpp1
-rw-r--r--test/std/atomics/atomics.flag/init03.pass.cpp (renamed from test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/no-variadics.pass.cpp)15
-rw-r--r--test/std/atomics/atomics.types.generic/address.pass.cpp3
-rw-r--r--test/std/atomics/atomics.types.generic/bool.pass.cpp3
-rw-r--r--test/std/atomics/atomics.types.generic/integral.pass.cpp1
-rw-r--r--test/std/atomics/atomics.types.generic/trivially_copyable.fail.cpp6
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp38
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp38
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp37
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp38
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp39
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp39
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp44
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp41
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp27
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp27
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp27
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp27
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp44
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp44
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp27
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp27
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_helpers.h51
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp40
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp33
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp40
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp38
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp40
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp40
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_var_init.pass.cpp1
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp44
-rw-r--r--test/std/containers/associative/map/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/containers/associative/map/compare.pass.cpp30
-rw-r--r--test/std/containers/associative/map/map.access/at.pass.cpp1
-rw-r--r--test/std/containers/associative/map/map.access/index_rv_key.pass.cpp8
-rw-r--r--test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp5
-rw-r--r--test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp5
-rw-r--r--test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp5
-rw-r--r--test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp5
-rw-r--r--test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp15
-rw-r--r--test/std/containers/associative/multimap/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp15
-rw-r--r--test/std/containers/associative/multimap/scary.pass.cpp1
-rw-r--r--test/std/containers/associative/multiset/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/containers/associative/multiset/scary.pass.cpp1
-rw-r--r--test/std/containers/associative/set/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/containers/sequences/array/array.cons/initializer_list.pass.cpp4
-rw-r--r--test/std/containers/sequences/array/array.data/data.pass.cpp4
-rw-r--r--test/std/containers/sequences/array/array.data/data_const.pass.cpp4
-rw-r--r--test/std/containers/sequences/array/array.fill/fill.pass.cpp4
-rw-r--r--test/std/containers/sequences/array/array.size/size.pass.cpp4
-rw-r--r--test/std/containers/sequences/array/array.special/swap.pass.cpp4
-rw-r--r--test/std/containers/sequences/array/array.swap/swap.pass.cpp4
-rw-r--r--test/std/containers/sequences/array/array.tuple/get.fail.cpp18
-rw-r--r--test/std/containers/sequences/array/array.tuple/get.pass.cpp13
-rw-r--r--test/std/containers/sequences/array/array.tuple/get_const.pass.cpp8
-rw-r--r--test/std/containers/sequences/array/array.tuple/get_const_rv.pass.cpp51
-rw-r--r--test/std/containers/sequences/array/array.tuple/get_rv.pass.cpp9
-rw-r--r--test/std/containers/sequences/array/at.pass.cpp11
-rw-r--r--test/std/containers/sequences/array/begin.pass.cpp6
-rw-r--r--test/std/containers/sequences/array/front_back.pass.cpp10
-rw-r--r--test/std/containers/sequences/array/indexing.pass.cpp12
-rw-r--r--test/std/containers/sequences/deque/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp9
-rw-r--r--test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp11
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp19
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp12
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_back_exception_safety.pass.cpp1
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp1
-rw-r--r--test/std/containers/sequences/forwardlist/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_exception_safety.pass.cpp1
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_one.pass.cpp4
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.spec/equal.pass.cpp4
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.spec/relational.pass.cpp4
-rw-r--r--test/std/containers/sequences/list/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/containers/sequences/list/incomplete_type.pass.cpp27
-rw-r--r--test/std/containers/sequences/list/list.modifiers/insert_iter_iter_iter.pass.cpp1
-rw-r--r--test/std/containers/sequences/list/list.modifiers/insert_iter_size_value.pass.cpp1
-rw-r--r--test/std/containers/sequences/list/list.modifiers/insert_iter_value.pass.cpp1
-rw-r--r--test/std/containers/sequences/list/list.modifiers/push_back_exception_safety.pass.cpp1
-rw-r--r--test/std/containers/sequences/list/list.modifiers/push_front_exception_safety.pass.cpp1
-rw-r--r--test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp41
-rw-r--r--test/std/containers/sequences/vector/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp44
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/push_back_exception_safety.pass.cpp1
-rw-r--r--test/std/containers/unord/unord.map/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/containers/unord/unord.map/bucket_count.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.map/compare.pass.cpp13
-rw-r--r--test/std/containers/unord/unord.map/load_factor.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.map/max_bucket_count.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.map/max_load_factor.pass.cpp11
-rw-r--r--test/std/containers/unord/unord.map/rehash.pass.cpp12
-rw-r--r--test/std/containers/unord/unord.map/reserve.pass.cpp16
-rw-r--r--test/std/containers/unord/unord.map/swap_member.pass.cpp6
-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.elem/at.pass.cpp1
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/clear.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/clear.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/emplace.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/emplace.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/emplace_hint.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/erase_const_iter.pass.cpp)9
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_db1.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_db1.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_db2.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_db2.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db1.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_iter_db1.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db2.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_iter_db2.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db3.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_iter_db3.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db4.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_iter_db4.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/erase_key.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/erase_key.pass.cpp)11
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/erase_range.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/erase_range.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/insert_const_lvalue.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/insert_hint_const_lvalue.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_rvalue.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/insert_hint_rvalue.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_init.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/insert_init.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/insert_or_assign.pass.cpp)10
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_range.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/insert_range.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/insert_rvalue.pass.cpp)0
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp (renamed from test/std/containers/unord/unord.map/unorder.map.modifiers/try.emplace.pass.cpp)11
-rw-r--r--test/std/containers/unord/unord.map/unord.map.swap/swap_non_member.pass.cpp6
-rw-r--r--test/std/containers/unord/unord.multimap/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/containers/unord/unord.multimap/rehash.pass.cpp12
-rw-r--r--test/std/containers/unord/unord.multimap/reserve.pass.cpp16
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp24
-rw-r--r--test/std/containers/unord/unord.multiset/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/containers/unord/unord.multiset/rehash.pass.cpp12
-rw-r--r--test/std/containers/unord/unord.multiset/reserve.pass.cpp16
-rw-r--r--test/std/containers/unord/unord.set/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/containers/unord/unord.set/rehash.pass.cpp12
-rw-r--r--test/std/containers/unord/unord.set/reserve.pass.cpp16
-rw-r--r--test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp4
-rw-r--r--test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp3
-rw-r--r--test/std/depr/depr.c.headers/extern_c.pass.cpp43
-rw-r--r--test/std/depr/depr.c.headers/inttypes_h.pass.cpp286
-rw-r--r--test/std/depr/depr.c.headers/locale_h.pass.cpp2
-rw-r--r--test/std/depr/depr.c.headers/math_h.pass.cpp846
-rw-r--r--test/std/depr/depr.c.headers/math_h_isinf.pass.cpp30
-rw-r--r--test/std/depr/depr.c.headers/math_h_isnan.pass.cpp30
-rw-r--r--test/std/depr/depr.c.headers/setjmp_h.pass.cpp4
-rw-r--r--test/std/depr/depr.c.headers/signal_h.pass.cpp2
-rw-r--r--test/std/depr/depr.c.headers/stdarg_h.pass.cpp1
-rw-r--r--test/std/depr/depr.c.headers/stddef_h.pass.cpp22
-rw-r--r--test/std/depr/depr.c.headers/stdint_h.pass.cpp4
-rw-r--r--test/std/depr/depr.c.headers/stdio_h.pass.cpp31
-rw-r--r--test/std/depr/depr.c.headers/stdlib_h.pass.cpp38
-rw-r--r--test/std/depr/depr.c.headers/time_h.pass.cpp2
-rw-r--r--test/std/depr/depr.c.headers/wchar_h.pass.cpp43
-rw-r--r--test/std/depr/depr.ios.members/io_state.pass.cpp5
-rw-r--r--test/std/depr/depr.ios.members/open_mode.pass.cpp5
-rw-r--r--test/std/depr/depr.ios.members/seek_dir.pass.cpp5
-rw-r--r--test/std/depr/depr.ios.members/streamoff.pass.cpp5
-rw-r--r--test/std/depr/depr.ios.members/streampos.pass.cpp5
-rw-r--r--test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp1
-rw-r--r--test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp1
-rw-r--r--test/std/experimental/algorithms/alg.search/search.pass.cpp45
-rw-r--r--test/std/experimental/any/any.class/any.assign/copy.pass.cpp197
-rw-r--r--test/std/experimental/any/any.class/any.assign/move.pass.cpp102
-rw-r--r--test/std/experimental/any/any.class/any.assign/value.pass.cpp177
-rw-r--r--test/std/experimental/any/any.class/any.assign/value_non_copyable_assign.fail.cpp38
-rw-r--r--test/std/experimental/any/any.class/any.cons/copy.pass.cpp100
-rw-r--r--test/std/experimental/any/any.class/any.cons/default.pass.cpp38
-rw-r--r--test/std/experimental/any/any.class/any.cons/move.pass.cpp102
-rw-r--r--test/std/experimental/any/any.class/any.cons/non_copyable_value.fail.cpp36
-rw-r--r--test/std/experimental/any/any.class/any.cons/value.pass.cpp116
-rw-r--r--test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp63
-rw-r--r--test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp101
-rw-r--r--test/std/experimental/any/any.class/any.observers/empty.pass.cpp64
-rw-r--r--test/std/experimental/any/any.class/any.observers/type.pass.cpp41
-rw-r--r--test/std/experimental/any/any.class/nothing_to_do.pass.cpp12
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp146
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp309
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/const_correctness.fail.cpp38
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp45
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/reference_types.fail.cpp37
-rw-r--r--test/std/experimental/any/any.nonmembers/swap.pass.cpp40
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore/default.pass.cpp128
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp124
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp135
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp131
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/default.pass.cpp128
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp123
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp134
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp130
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp95
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp102
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pass.cpp81
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pred.pass.cpp88
-rw-r--r--test/std/experimental/func/func.searchers/nothing_to_do.pass.cpp13
-rw-r--r--test/std/experimental/func/header.functional.synop/includes.pass.cpp21
-rw-r--r--test/std/experimental/func/nothing_to_do.pass.cpp13
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp1
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp1
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp1
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp1
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp12
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp1
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp11
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp1
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp1
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp11
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp1
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp1
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp1
-rw-r--r--test/std/experimental/optional/optional.specalg/swap.pass.cpp1
-rw-r--r--test/std/experimental/string.view/string.view.access/at.pass.cpp1
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp1
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp1
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp1
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp1
-rw-r--r--test/std/experimental/string.view/string.view.ops/copy.pass.cpp1
-rw-r--r--test/std/experimental/string.view/string.view.ops/substr.pass.cpp1
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp5
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp4
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp4
-rw-r--r--test/std/input.output/file.streams/c.files/cstdio.pass.cpp1
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp9
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp9
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream_sentry/destruct.pass.cpp1
-rw-r--r--test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp3
-rw-r--r--test/std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp1
-rw-r--r--test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp1
-rw-r--r--test/std/input.output/iostreams.base/ios/iostate.flags/clear.pass.cpp1
-rw-r--r--test/std/input.output/iostreams.base/ios/iostate.flags/exceptions_iostate.pass.cpp1
-rw-r--r--test/std/input.output/iostreams.base/ios/iostate.flags/setstate.pass.cpp1
-rw-r--r--test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp6
-rw-r--r--test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp6
-rw-r--r--test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp4
-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/alloc.errors/new.handler/new_handler.pass.cpp4
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp4
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp1
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp7
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new.pass.cpp2
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow.pass.cpp1
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp7
-rw-r--r--test/std/language.support/support.exception/except.nested/assign.pass.cpp1
-rw-r--r--test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp1
-rw-r--r--test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp1
-rw-r--r--test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp11
-rw-r--r--test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp1
-rw-r--r--test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp1
-rw-r--r--test/std/language.support/support.exception/exception.terminate/terminate.handler/terminate_handler.pass.cpp4
-rw-r--r--test/std/language.support/support.exception/propagation/current_exception.pass.cpp1
-rw-r--r--test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp1
-rw-r--r--test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp1
-rw-r--r--test/std/language.support/support.exception/uncaught/uncaught_exception.pass.cpp1
-rw-r--r--test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp1
-rw-r--r--test/std/language.support/support.runtime/csignal.pass.cpp3
-rw-r--r--test/std/language.support/support.runtime/cstdarg.pass.cpp1
-rw-r--r--test/std/language.support/support.runtime/cstdlib.pass.cpp24
-rw-r--r--test/std/language.support/support.runtime/ctime.pass.cpp1
-rw-r--r--test/std/language.support/support.types/nullptr_t.pass.cpp23
-rw-r--r--test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp2
-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_length.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/char32_t_unshift.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp6
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp2
-rw-r--r--test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp1
-rw-r--r--test/std/localization/locales/locale.global.templates/use_facet.pass.cpp1
-rw-r--r--test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp1
-rw-r--r--test/std/localization/locales/locale/locale.members/combine.pass.cpp1
-rw-r--r--test/std/numerics/rand/rand.device/ctor.pass.cpp1
-rw-r--r--test/std/numerics/rand/rand.device/eval.pass.cpp1
-rw-r--r--test/std/re/re.alg/re.alg.search/grep.pass.cpp28
-rw-r--r--test/std/re/re.regex/re.regex.assign/assign.pass.cpp1
-rw-r--r--test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp3
-rw-r--r--test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp43
-rw-r--r--test/std/strings/basic.string/allocator_mismatch.fail.cpp18
-rw-r--r--test/std/strings/basic.string/string.access/at.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.capacity/capacity.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.capacity/max_size.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.capacity/reserve.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.capacity/resize_size.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.capacity/resize_size_char.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp56
-rw-r--r--test/std/strings/basic.string/string.cons/substr.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_append/string_size_size.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp6
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_assign/string_size_size.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_erase/size_size.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_pointer.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_pointer_size.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_size_char.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_string_size_size.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer_size.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_size_char.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_size_size.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.ops/string_substr/substr.pass.cpp1
-rw-r--r--test/std/strings/c.strings/cctype.pass.cpp28
-rw-r--r--test/std/strings/c.strings/cwchar.pass.cpp2
-rw-r--r--test/std/strings/string.conversions/stod.pass.cpp1
-rw-r--r--test/std/strings/string.conversions/stof.pass.cpp1
-rw-r--r--test/std/strings/string.conversions/stoi.pass.cpp1
-rw-r--r--test/std/strings/string.conversions/stol.pass.cpp1
-rw-r--r--test/std/strings/string.conversions/stold.pass.cpp1
-rw-r--r--test/std/strings/string.conversions/stoll.pass.cpp1
-rw-r--r--test/std/strings/string.conversions/stoul.pass.cpp1
-rw-r--r--test/std/strings/string.conversions/stoull.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.async/async.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.async/async_race.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.promise/alloc_ctor.pass.cpp29
-rw-r--r--test/std/thread/futures/futures.promise/copy_assign.fail.cpp82
-rw-r--r--test/std/thread/futures/futures.promise/copy_ctor.fail.cpp76
-rw-r--r--test/std/thread/futures/futures.promise/default.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.promise/dtor.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.promise/get_future.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.promise/move_assign.pass.cpp38
-rw-r--r--test/std/thread/futures/futures.promise/move_ctor.pass.cpp32
-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.cpp2
-rw-r--r--test/std/thread/futures/futures.promise/set_lvalue.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.promise/set_lvalue_at_thread_exit.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.promise/set_rvalue.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.promise/set_value_at_thread_exit_const.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.promise/set_value_at_thread_exit_void.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.promise/set_value_const.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.promise/set_value_void.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.promise/swap.pass.cpp45
-rw-r--r--test/std/thread/futures/futures.promise/uses_allocator.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.shared_future/copy_assign.pass.cpp3
-rw-r--r--test/std/thread/futures/futures.shared_future/copy_ctor.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.shared_future/ctor_future.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.shared_future/dtor.pass.cpp30
-rw-r--r--test/std/thread/futures/futures.shared_future/get.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.shared_future/move_assign.pass.cpp3
-rw-r--r--test/std/thread/futures/futures.shared_future/move_ctor.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.shared_future/wait.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.shared_future/wait_for.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.shared_future/wait_until.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp30
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp5
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp7
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp25
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp19
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp8
-rw-r--r--test/std/thread/futures/futures.tas/types.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.unique_future/copy_assign.fail.cpp59
-rw-r--r--test/std/thread/futures/futures.unique_future/copy_ctor.fail.cpp51
-rw-r--r--test/std/thread/futures/futures.unique_future/dtor.pass.cpp30
-rw-r--r--test/std/thread/futures/futures.unique_future/get.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.unique_future/share.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.unique_future/wait.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.unique_future/wait_for.pass.cpp1
-rw-r--r--test/std/thread/futures/futures.unique_future/wait_until.pass.cpp259
-rw-r--r--test/std/thread/futures/test_allocator.h158
-rw-r--r--test/std/thread/thread.condition/notify_all_at_thread_exit.pass.cpp7
-rw-r--r--test/std/thread/thread.condition/thread.condition.condvar/notify_one.pass.cpp11
-rw-r--r--test/std/thread/thread.condition/thread.condition.condvarany/wait.exception.pass.cpp63
-rw-r--r--test/std/thread/thread.condition/thread.condition.condvarany/wait_for.exception.pass.cpp63
-rw-r--r--test/std/thread/thread.condition/thread.condition.condvarany/wait_terminates.sh.cpp134
-rw-r--r--test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp3
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp8
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp64
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp3
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp3
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp35
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp34
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp26
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp9
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp8
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp8
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp8
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/member_swap.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/nonmember_swap.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/release.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/types.pass.cpp4
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/assign.fail.cpp10
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/copy.fail.cpp10
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp18
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp23
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp15
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp25
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp30
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp11
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp29
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp29
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp28
-rw-r--r--test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp1
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp17
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp9
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp4
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp2
-rw-r--r--test/std/utilities/allocator.adaptor/scoped.adaptor.operators/copy_assign.pass.cpp72
-rw-r--r--test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.pass.cpp72
-rw-r--r--test/std/utilities/function.objects/bind/func.bind/func.bind.bind/copy.pass.cpp2
-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/invoke_int_0.pass.cpp2
-rw-r--r--test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp2
-rw-r--r--test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp2
-rw-r--r--test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.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.cpp2
-rw-r--r--test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression_03.pass.cpp39
-rw-r--r--test/std/utilities/function.objects/func.invoke/invoke.pass.cpp1
-rw-r--r--test/std/utilities/function.objects/func.memfn/member_function.pass.cpp3
-rw-r--r--test/std/utilities/function.objects/func.require/bullet_1_and_2.pass.cpp318
-rw-r--r--test/std/utilities/function.objects/func.require/bullet_3_and_4.pass.cpp164
-rw-r--r--test/std/utilities/function.objects/func.require/bullet_5.pass.cpp327
-rw-r--r--test/std/utilities/function.objects/func.require/invoke_helpers.h317
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp6
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_nullptr.pass.cpp247
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp14
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp382
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_int_0.pass.cpp58
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_no_variadics.pass.cpp60
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_void_0.pass.cpp67
-rw-r--r--test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.fail.cpp2
-rw-r--r--test/std/utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp2
-rw-r--r--test/std/utilities/function.objects/unord.hash/integral.pass.cpp40
-rw-r--r--test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp18
-rw-r--r--test/std/utilities/intseq/intseq.make/make_integer_seq.pass.cpp6
-rw-r--r--test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.fail.cpp18
-rw-r--r--test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.pass.cpp18
-rw-r--r--test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp4
-rw-r--r--test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp25
-rw-r--r--test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp4
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp15
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp15
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp14
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp14
-rw-r--r--test/std/utilities/memory/storage.iterator/raw_storag_iterator.pass.cpp27
-rw-r--r--test/std/utilities/memory/unique.ptr/deleter.h230
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp25
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp22
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp23
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp34
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp25
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp27
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp43
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp48
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert.pass.cpp89
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp41
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.pass.cpp56
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp44
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.pass.cpp60
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp47
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.pass.cpp63
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp40
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp2
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp16
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default.pass.cpp86
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.pass.cpp46
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.pass.cpp84
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move.pass.cpp140
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.pass.cpp142
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.pass.cpp143
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert.pass.cpp171
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.pass.cpp58
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.pass.cpp62
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.pass.cpp79
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.pass.cpp58
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.pass.cpp62
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.pass.cpp79
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.pass.cpp63
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer.pass.cpp163
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.pass.cpp63
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.pass.cpp95
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.pass.cpp78
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter.pass.cpp123
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter01.pass.cpp99
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter02.pass.cpp58
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter03.pass.cpp60
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp43
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.pass.cpp58
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter05.pass.cpp66
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter06.pass.cpp39
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp1
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator_throw.pass.cpp1
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_throw.pass.cpp1
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator_throw.pass.cpp1
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp1
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp1
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp1
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp1
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp40
-rw-r--r--test/std/utilities/meta/meta.logical/conjunction.pass.cpp66
-rw-r--r--test/std/utilities/meta/meta.logical/disjunction.pass.cpp66
-rw-r--r--test/std/utilities/meta/meta.logical/negation.pass.cpp39
-rw-r--r--test/std/utilities/meta/meta.rel/is_base_of.pass.cpp8
-rw-r--r--test/std/utilities/meta/meta.rel/is_convertible.pass.cpp14
-rw-r--r--test/std/utilities/meta/meta.rel/is_convertible_fallback.pass.cpp8
-rw-r--r--test/std/utilities/meta/meta.rel/is_same.pass.cpp18
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp44
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp58
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp36
-rw-r--r--test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp8
-rw-r--r--test/std/utilities/meta/meta.unary.prop.query/extent.pass.cpp14
-rw-r--r--test/std/utilities/meta/meta.unary.prop.query/rank.pass.cpp8
-rw-r--r--test/std/utilities/meta/meta.unary.prop.query/void_t.pass.cpp9
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_array.pass.cpp93
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_class.pass.cpp98
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_enum.pass.cpp93
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_floating_point.pass.cpp101
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp98
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_integral.pass.cpp104
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp95
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_object_pointer.pass.cpp97
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp98
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_null_pointer.pass.cpp95
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_pointer.pass.cpp94
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp95
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_union.pass.cpp93
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/is_void.pass.cpp92
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/nullptr.pass.cpp1
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.comp/is_arithmetic.pass.cpp104
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.comp/is_compound.pass.cpp95
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.comp/is_fundamental.pass.cpp112
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.comp/is_member_pointer.pass.cpp102
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.comp/is_object.pass.cpp101
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.comp/is_reference.pass.cpp101
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.comp/is_scalar.pass.cpp111
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/has_virtual_destructor.pass.cpp12
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_abstract.pass.cpp13
-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_const.pass.cpp7
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp20
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_assignable.pass.cpp7
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_constructible.pass.cpp7
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp27
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_final.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp77
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp11
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_constructible.pass.cpp7
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_assignable.pass.cpp7
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp16
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_assignable.pass.cpp7
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_constructible.pass.cpp11
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp70
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_assignable.pass.cpp7
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_constructible.pass.cpp11
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_pod.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_signed.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_assignable.pass.cpp7
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_constructible.pass.cpp16
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copy_assignable.pass.cpp7
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copy_constructible.pass.cpp9
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_default_constructible.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp47
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_move_assignable.pass.cpp7
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_move_constructible.pass.cpp7
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_unsigned.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_volatile.pass.cpp7
-rw-r--r--test/std/utilities/ratio/ratio.comparison/ratio_equal.pass.cpp27
-rw-r--r--test/std/utilities/ratio/ratio.comparison/ratio_greater.pass.cpp27
-rw-r--r--test/std/utilities/ratio/ratio.comparison/ratio_greater_equal.pass.cpp27
-rw-r--r--test/std/utilities/ratio/ratio.comparison/ratio_less.pass.cpp39
-rw-r--r--test/std/utilities/ratio/ratio.comparison/ratio_less_equal.pass.cpp27
-rw-r--r--test/std/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp27
-rw-r--r--test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp3
-rw-r--r--test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp3
-rw-r--r--test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp1
-rw-r--r--test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp1
-rw-r--r--test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp1
-rw-r--r--test/std/utilities/template.bitset/bitset.members/set_one.pass.cpp1
-rw-r--r--test/std/utilities/template.bitset/bitset.members/test.pass.cpp1
-rw-r--r--test/std/utilities/time/date.time/ctime.pass.cpp (renamed from test/std/utilities/date.time/tested_elsewhere.pass.cpp)2
-rw-r--r--test/std/utilities/time/time.duration/time.duration.alg/abs.fail.cpp27
-rw-r--r--test/std/utilities/time/time.duration/time.duration.alg/abs.pass.cpp50
-rw-r--r--test/std/utilities/time/time.duration/time.duration.cast/ceil.fail.cpp26
-rw-r--r--test/std/utilities/time/time.duration/time.duration.cast/ceil.pass.cpp51
-rw-r--r--test/std/utilities/time/time.duration/time.duration.cast/floor.fail.cpp26
-rw-r--r--test/std/utilities/time/time.duration/time.duration.cast/floor.pass.cpp50
-rw-r--r--test/std/utilities/time/time.duration/time.duration.cast/round.fail.cpp26
-rw-r--r--test/std/utilities/time/time.duration/time.duration.cast/round.pass.cpp50
-rw-r--r--test/std/utilities/time/time.point/time.point.cast/ceil.fail.cpp26
-rw-r--r--test/std/utilities/time/time.point/time.point.cast/ceil.pass.cpp69
-rw-r--r--test/std/utilities/time/time.point/time.point.cast/floor.fail.cpp26
-rw-r--r--test/std/utilities/time/time.point/time.point.cast/floor.pass.cpp68
-rw-r--r--test/std/utilities/time/time.point/time.point.cast/round.fail.cpp26
-rw-r--r--test/std/utilities/time/time.point/time.point.cast/round.pass.cpp68
-rw-r--r--test/std/utilities/time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp4
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.fail.cpp34
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.pass.cpp80
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp45
-rw-r--r--test/std/utilities/utility/as_const/as_const.fail.cpp22
-rw-r--r--test/std/utilities/utility/as_const/as_const.pass.cpp46
-rw-r--r--test/std/utilities/utility/declval/declval.pass.cpp6
-rw-r--r--test/std/utilities/utility/forward/move_if_noexcept.pass.cpp15
-rw-r--r--test/std/utilities/utility/pairs/pair.astuple/get_const_rv.pass.cpp66
-rw-r--r--test/std/utilities/utility/pairs/pair.astuple/pairs.by.type.pass.cpp50
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/default-sfinae.pass.cpp164
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp17
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/swap.pass.cpp19
-rw-r--r--test/support/allocators.h8
-rw-r--r--test/support/any_helpers.h318
-rw-r--r--test/support/count_new.hpp43
-rw-r--r--test/support/disable_missing_braces_warning.h8
-rw-r--r--test/support/test_allocator.h4
-rw-r--r--test/support/test_macros.h27
-rwxr-xr-xtest/testit2
-rwxr-xr-xutils/gen_link_script/gen_link_script.py79
-rw-r--r--www/cxx1y_status.html302
-rw-r--r--www/cxx1z_status.html171
-rw-r--r--www/index.html30
-rw-r--r--www/kona.html154
-rw-r--r--www/ts1z_status.html23
809 files changed, 24694 insertions, 10085 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 687c4cfc29a9..e6c96f64711b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,13 +3,16 @@
#===============================================================================
# Setup Project
#===============================================================================
-
-project(libcxx CXX C)
cmake_minimum_required(VERSION 2.8)
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default
endif()
+if(POLICY CMP0022)
+ cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang
+endif()
+
+project(libcxx CXX C)
set(PACKAGE_NAME libcxx)
set(PACKAGE_VERSION trunk-svn)
@@ -30,61 +33,40 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."
)
-if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
- set(LIBCXX_LIBDIR_SUFFIX "" CACHE STRING
- "Define suffix of library directory name (32/64)")
-
- set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
-
- set(LIBCXX_BUILT_STANDALONE 1)
-else()
- set(LIBCXX_LIBDIR_SUFFIX ${LLVM_LIBDIR_SUFFIX})
+# Find the LLVM sources and simulate LLVM CMake options.
+include(HandleOutOfTreeLLVM)
+if (LIBCXX_BUILT_STANDALONE AND NOT LLVM_FOUND)
+ message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: "
+ "llvm-config not found and LLVM_PATH not defined.\n"
+ "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config "
+ "or -DLLVM_PATH=path/to/llvm-source-root.")
endif()
#===============================================================================
# Setup CMake Options
#===============================================================================
-# Define options.
-option(LIBCXX_ENABLE_EXCEPTIONS "Use exceptions." ON)
-option(LIBCXX_ENABLE_RTTI "Use run time type information." ON)
+# Basic options ---------------------------------------------------------------
option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
-option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
-option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
-option(LIBCXX_ENABLE_CXX1Y "Enable -std=c++1y and use of c++1y language features if the compiler supports it." OFF)
option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
-option(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE "Build libc++ with support for the global filesystem namespace." ON)
-option(LIBCXX_ENABLE_STDIN "Build libc++ with support for stdin/std::cin." ON)
-option(LIBCXX_ENABLE_STDOUT "Build libc++ with support for stdout/std::cout." ON)
-option(LIBCXX_ENABLE_THREADS "Build libc++ with support for threads." ON)
-option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS "Build libc++ with support for thread-unsafe C functions" ON)
-option(LIBCXX_BUILD_32_BITS "Build 32 bit libc++" OFF)
-option(LIBCXX_ENABLE_MONOTONIC_CLOCK
- "Build libc++ with support for a monotonic clock.
- This option may only be used when LIBCXX_ENABLE_THREADS=OFF." ON)
+
+option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS})
+option(LIBCXX_INCLUDE_DOCS "Build the libc++ documentation." ${LLVM_INCLUDE_DOCS})
+set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
+ "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_GENERATE_COVERAGE "Enable generating code coverage." OFF)
-set(LIBCXX_COVERAGE_LIBRARY "" CACHE STRING
- "The Profile-rt library used to build with code coverage")
-option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF)
-set(LIBCXX_SYSROOT "" CACHE STRING "Use alternate sysroot.")
-set(LIBCXX_GCC_TOOLCHAIN "" CACHE STRING "Use alternate GCC toolchain.")
-if (LIBCXX_BUILT_STANDALONE)
- set(LLVM_USE_SANITIZER "" CACHE STRING
- "Define the sanitizer used to build the library and tests")
-endif()
-
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
- if (APPLE)
- message(FATAL_ERROR "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is not supported on OS X")
- else()
- message(WARNING "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is an experimental option")
- endif()
-endif()
+set(LIBCXX_ABI_VERSION 1 CACHE STRING "ABI version of libc++.")
+option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF)
+# ABI Library options ---------------------------------------------------------
+set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
+ "Specify C++ ABI library to use." FORCE)
set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++)
+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")
@@ -97,14 +79,139 @@ if (NOT LIBCXX_CXX_ABI)
else ()
set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}")
endif ()
-set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
- "Specify C++ ABI library to use." FORCE)
-set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
+
+# Use a static copy of the ABI library when linking libc++. This option
+# cannot be used with LIBCXX_ENABLE_ABI_LINKER_SCRIPT.
+option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF)
+
+# Generate and install a linker script inplace of libc++.so. The linker script
+# will link libc++ to the correct ABI library. This option is on by default
+# On UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY'
+# is on. This option is also disabled when the ABI library is not specified
+# or is specified to be "none".
+set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF)
+if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY
+ AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"
+ AND PYTHONINTERP_FOUND)
+ set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE ON)
+endif()
+
+option(LIBCXX_ENABLE_ABI_LINKER_SCRIPT
+ "Use and install a linker script for the given ABI library"
+ ${ENABLE_LINKER_SCRIPT_DEFAULT_VALUE})
# Build libc++abi with libunwind. We need this option to determine whether to
# link with libunwind or libgcc_s while running the test cases.
option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF)
+# Target options --------------------------------------------------------------
+option(LIBCXX_BUILD_32_BITS "Build 32 bit libc++." ${LLVM_BUILD_32_BITS})
+set(LIBCXX_SYSROOT "" CACHE STRING "Use alternate sysroot.")
+set(LIBCXX_GCC_TOOLCHAIN "" CACHE STRING "Use alternate GCC toolchain.")
+
+# Feature options -------------------------------------------------------------
+option(LIBCXX_ENABLE_EXCEPTIONS "Use exceptions." ON)
+option(LIBCXX_ENABLE_RTTI "Use run time type information." ON)
+option(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE "Build libc++ with support for the global filesystem namespace." ON)
+option(LIBCXX_ENABLE_STDIN "Build libc++ with support for stdin/std::cin." ON)
+option(LIBCXX_ENABLE_STDOUT "Build libc++ with support for stdout/std::cout." ON)
+option(LIBCXX_ENABLE_THREADS "Build libc++ with support for threads." ON)
+option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS "Build libc++ with support for thread-unsafe C functions" ON)
+option(LIBCXX_ENABLE_MONOTONIC_CLOCK
+ "Build libc++ with support for a monotonic clock.
+ This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON)
+option(LIBCXX_HAS_MUSL_LIBC "Build libc++ with support for the Musl C library" OFF)
+
+# Misc options ----------------------------------------------------------------
+# FIXME: Turn -pedantic back ON. It is currently off because it warns
+# about #include_next which is used everywhere.
+option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." OFF)
+option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
+
+option(LIBCXX_GENERATE_COVERAGE "Enable generating code coverage." OFF)
+set(LIBCXX_COVERAGE_LIBRARY "" CACHE STRING
+ "The Profile-rt library used to build with code coverage")
+
+# Don't allow a user to accidentally overwrite the system libc++ installation on Darwin.
+# If the user specifies -DCMAKE_INSTALL_PREFIX=/usr the install rules for libc++
+# will not be generated and a warning will be issued.
+option(LIBCXX_OVERRIDE_DARWIN_INSTALL "Enable overwriting darwins libc++ installation." OFF)
+mark_as_advanced(LIBCXX_OVERRIDE_DARWIN_INSTALL) # Don't show this option by default.
+
+if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT LIBCXX_OVERRIDE_DARWIN_INSTALL)
+ if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr")
+ message(WARNING "Disabling libc++ install rules because installation would "
+ "overwrite the systems installation. Configure with "
+ "-DLIBCXX_OVERRIDE_DARWIN_INSTALL=ON to suppress this behaviour.")
+ mark_as_advanced(CLEAR LIBCXX_OVERRIDE_DARWIN_INSTALL) # Show the override option.
+ set(LIBCXX_INSTALL_HEADERS OFF)
+ set(LIBCXX_INSTALL_LIBRARY OFF)
+ endif()
+endif()
+
+set(LIBCXX_CONFIGURE_IDE_DEFAULT OFF)
+if (XCODE OR MSVC_IDE)
+ set(LIBCXX_CONFIGURE_IDE_DEFAULT ON)
+endif()
+option(LIBCXX_CONFIGURE_IDE "Configure libcxx for use within an IDE"
+ ${LIBCXX_CONFIGURE_IDE_DEFAULT})
+
+#===============================================================================
+# Check option configurations
+#===============================================================================
+
+# Ensure LIBCXX_ENABLE_MONOTONIC_CLOCK is set to ON only when
+# LIBCXX_ENABLE_THREADS is on.
+if(LIBCXX_ENABLE_THREADS AND NOT LIBCXX_ENABLE_MONOTONIC_CLOCK)
+ message(FATAL_ERROR "LIBCXX_ENABLE_MONOTONIC_CLOCK can only be set to OFF"
+ " when LIBCXX_ENABLE_THREADS is also set to OFF.")
+endif()
+
+# Ensure LLVM_USE_SANITIZER is not specified when LIBCXX_GENERATE_COVERAGE
+# is ON.
+if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_COVERAGE)
+ message(FATAL_ERROR "LLVM_USE_SANITIZER cannot be used with LIBCXX_GENERATE_COVERAGE")
+endif()
+
+# Set LIBCXX_BUILD_32_BITS to (LIBCXX_BUILD_32_BITS OR LLVM_BUILD_32_BITS)
+# and check that we can build with 32 bits if requested.
+if (CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32)
+ if (LIBCXX_BUILD_32_BITS AND NOT LLVM_BUILD_32_BITS) # Don't duplicate the output from LLVM
+ message(STATUS "Building 32 bits executables and libraries.")
+ endif()
+elseif(LIBCXX_BUILD_32_BITS)
+ message(FATAL_ERROR "LIBCXX_BUILD_32_BITS=ON is not supported on this platform.")
+endif()
+
+# Check that this option is not enabled on Apple and emit a usage warning.
+if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+ if (APPLE)
+ message(FATAL_ERROR "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is not supported on OS X")
+ else()
+ message(WARNING "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is an experimental option")
+ endif()
+endif()
+
+if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ if (APPLE)
+ message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT cannot be used on APPLE targets")
+ endif()
+ if (NOT PYTHONINTERP_FOUND)
+ message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT requires python but it was not found.")
+ endif()
+endif()
+
+if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ message(FATAL_ERROR "Conflicting options given.
+ LIBCXX_ENABLE_STATIC_ABI_LIBRARY cannot be specified with
+ LIBCXX_ENABLE_ABI_LINKER_SCRIPT")
+endif()
+
+if (LIBCXX_HAS_MUSL_LIBC AND NOT LIBCXX_INSTALL_SUPPORT_HEADERS)
+ message(FATAL_ERROR "LIBCXX_INSTALL_SUPPORT_HEADERS can not be turned off"
+ "when building for Musl with LIBCXX_HAS_MUSL_LIBC.")
+endif()
+
#===============================================================================
# Configure System
#===============================================================================
@@ -114,232 +221,183 @@ set(LIBCXX_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LIBCXX_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
+
# Declare libc++ configuration variables.
# They are intended for use as follows:
# LIBCXX_CXX_FLAGS: General flags for both the compiler and linker.
# LIBCXX_COMPILE_FLAGS: Compile only flags.
# LIBCXX_LINK_FLAGS: Linker only flags.
-set(LIBCXX_CXX_FLAGS "")
set(LIBCXX_COMPILE_FLAGS "")
set(LIBCXX_LINK_FLAGS "")
+set(LIBCXX_LIBRARIES "")
# Configure compiler.
include(config-ix)
-# Configure ABI library
-include(HandleLibCXXABI)
+
# Configure coverage options.
if (LIBCXX_GENERATE_COVERAGE)
include(CodeCoverage)
set(CMAKE_BUILD_TYPE "COVERAGE" CACHE STRING "" FORCE)
endif()
+string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+
#===============================================================================
# Setup Compiler Flags
#===============================================================================
-# Get required flags.
-# On all systems the system c++ standard library headers need to be excluded.
-if (MSVC)
- # MSVC only has -X, which disables all default includes; including the crt.
- # Thus, we do nothing and hope we don't accidentally include any of the C++
- # headers.
-else()
- if (LIBCXX_HAS_NOSTDINCXX_FLAG)
- list(APPEND LIBCXX_COMPILE_FLAGS -nostdinc++)
- string(REPLACE "-stdlib=libc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- string(REPLACE "-stdlib=libstdc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- endif()
- # If c++1y has been enabled then attempt to use it. Fail if it is no supported
- # by the compiler. Otherwise choose c++11 and ensure the compiler supports it.
- if (LIBCXX_ENABLE_CXX1Y)
- if (LIBCXX_HAS_STDCXX1Y_FLAG)
- set(LIBCXX_STD_VERSION c++1y)
- else()
- message(FATAL_ERROR "c++1y was enabled but the compiler does not support it.")
- endif()
- else()
- if (LIBCXX_HAS_STDCXX11_FLAG)
- set(LIBCXX_STD_VERSION c++11)
- else()
- message(FATAL_ERROR "c++11 is required by libc++ but is not supported by the compiler")
- endif()
- endif()
- # LIBCXX_STD_VERSION should always be set at this point.
- list(APPEND LIBCXX_CXX_FLAGS "-std=${LIBCXX_STD_VERSION}")
-endif()
+include(HandleLibCXXABI) # Steup the ABI library flags
-macro(append_if list condition var)
- if (${condition})
- list(APPEND ${list} ${var})
- endif()
-endmacro()
+# Include macros for adding and removing libc++ flags.
+include(HandleLibcxxFlags)
-# Get warning flags
-if (NOT MSVC)
- append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WALL_FLAG -Wall)
- list(APPEND LIBCXX_COMPILE_FLAGS -Werror=return-type)
+# Remove flags that may have snuck in.
+remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG
+ -stdlib=libc++ -stdlib=libstdc++ -lc++abi -m32)
+
+# FIXME(EricWF): See the FIXME on LIBCXX_ENABLE_PEDANTIC.
+# Remove the -pedantic flag and -Wno-pedantic and -pedantic-errors
+# so they don't get transformed into -Wno and -errors respectivly.
+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")
endif()
-append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_W_FLAG -W)
-append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG -Wno-unused-parameter)
-append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WWRITE_STRINGS_FLAG -Wwrite-strings)
-append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WNO_LONG_LONG_FLAG -Wno-long-long)
+# On all systems the system c++ standard library headers need to be excluded.
+# MSVC only has -X, which disables all default includes; including the crt.
+# Thus, we do nothing and hope we don't accidentally include any of the C++
+# headers
+add_compile_flags_if_supported(-nostdinc++)
+
+# Target flags ================================================================
+add_flags_if(LIBCXX_BUILD_32_BITS -m32)
+add_flags_if(LIBCXX_TARGET_TRIPLE "-target ${LIBCXX_TARGET_TRIPLE}")
+add_flags_if(LIBCXX_SYSROOT "--sysroot ${LIBCXX_SYSROOT}")
+add_flags_if(LIBCXX_GCC_TOOLCHAIN "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}")
+
+# Warning flags ===============================================================
+add_definitions(-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+add_compile_flags_if_supported(
+ -Wall -W -Wwrite-strings
+ -Wno-unused-parameter -Wno-long-long
+ -Werror=return-type)
if (LIBCXX_ENABLE_WERROR)
- append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WERROR_FLAG -Werror)
- append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WX_FLAG -WX)
+ add_compile_flags_if_supported(-Werror)
+ add_compile_flags_if_supported(-WX)
else()
- append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WNO_ERROR_FLAG -Wno-error)
- append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_NO_WX_FLAG -WX-)
+ # TODO(EricWF) Remove this. We shouldn't be suppressing errors when -Werror is
+ # added elsewhere.
+ add_compile_flags_if_supported(-Wno-error)
endif()
if (LIBCXX_ENABLE_PEDANTIC)
- append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_PEDANTIC_FLAG -pedantic)
+ add_compile_flags_if_supported(-pedantic)
endif()
-# Get feature flags.
-# Exceptions
+# Exception flags =============================================================
if (LIBCXX_ENABLE_EXCEPTIONS)
# Catches C++ exceptions only and tells the compiler to assume that extern C
# functions never throw a C++ exception.
- append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_EHSC_FLAG -EHsc)
+ add_compile_flags_if_supported(-EHsc)
else()
- list(APPEND LIBCXX_CXX_FLAGS -D_LIBCPP_NO_EXCEPTIONS)
- append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_NO_EHS_FLAG -EHs-)
- append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_NO_EHA_FLAG -EHa-)
- append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_FNO_EXCEPTIONS_FLAG -fno-exceptions)
+ add_definitions(-D_LIBCPP_NO_EXCEPTIONS)
+ add_compile_flags_if_supported(-EHs- -EHa-)
+ add_compile_flags_if_supported(-fno-exceptions)
endif()
-# RTTI
+
+# RTTI flags ==================================================================
if (NOT LIBCXX_ENABLE_RTTI)
- list(APPEND LIBCXX_CXX_FLAGS -D_LIBCPP_NO_RTTI)
- append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_NO_GR_FLAG -GR-)
- append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_FNO_RTTI_FLAG -fno-rtti)
+ add_definitions(-D_LIBCPP_NO_RTTI)
+ add_compile_flags_if_supported(-GR-)
+ add_compile_flags_if_supported(-fno-rtti)
endif()
-# Assert
-string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+
+# Assertion flags =============================================================
+define_if(LIBCXX_ENABLE_ASSERTIONS -UNDEBUG)
+define_if_not(LIBCXX_ENABLE_ASSERTIONS -DNDEBUG)
if (LIBCXX_ENABLE_ASSERTIONS)
# MSVC doesn't like _DEBUG on release builds. See PR 4379.
- if (NOT MSVC)
- list(APPEND LIBCXX_COMPILE_FLAGS -D_DEBUG)
- endif()
- # On Release builds cmake automatically defines NDEBUG, so we
- # explicitly undefine it:
- if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
- list(APPEND LIBCXX_COMPILE_FLAGS -UNDEBUG)
- endif()
-else()
- if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
- list(APPEND LIBCXX_COMPILE_FLAGS -DNDEBUG)
- endif()
-endif()
-# Static library
-if (NOT LIBCXX_ENABLE_SHARED)
- list(APPEND LIBCXX_COMPILE_FLAGS -D_LIBCPP_BUILD_STATIC)
+ define_if_not(MSVC -D_DEBUG)
endif()
-if (CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32)
- if (LIBCXX_BUILD_32_BITS)
- message(STATUS "Building 32 bits executables and libraries.")
- list(APPEND LIBCXX_CXX_FLAGS "-m32")
- endif()
-elseif(LIBCXX_BUILD_32_BITS)
- message(FATAL_ERROR "LIBCXX_BUILD_32_BITS=ON is not supported on this platform.")
-endif()
-# This is the _ONLY_ place where add_definitions is called.
-if (MSVC)
- add_definitions(-D_CRT_SECURE_NO_WARNINGS)
-endif()
-
-# LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE configuration
-if (NOT LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE)
- add_definitions(-D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE)
-endif()
-
-# LIBCXX_ENABLE_STDIN configuration
-if (NOT LIBCXX_ENABLE_STDIN)
- add_definitions(-D_LIBCPP_HAS_NO_STDIN)
-endif()
+# Feature flags ===============================================================
+define_if(MSVC -D_CRT_SECURE_NO_WARNINGS)
-# LIBCXX_ENABLE_STDOUT configuration
-if (NOT LIBCXX_ENABLE_STDOUT)
- add_definitions(-D_LIBCPP_HAS_NO_STDOUT)
-endif()
-
-# LIBCXX_ENABLE_THREADS configuration
-if (NOT LIBCXX_ENABLE_THREADS)
- add_definitions(-D_LIBCPP_HAS_NO_THREADS)
- if (NOT LIBCXX_ENABLE_MONOTONIC_CLOCK)
- add_definitions(-D_LIBCPP_HAS_NO_MONOTONIC_CLOCK)
- endif()
-# Ensure LIBCXX_ENABLE_MONOTONIC_CLOCK is set to ON.
-elseif(NOT LIBCXX_ENABLE_MONOTONIC_CLOCK)
- message(FATAL_ERROR "LIBCXX_ENABLE_MONOTONIC_CLOCK can only be set to OFF"
- " when LIBCXX_ENABLE_THREADS is also set to OFF.")
-endif()
-
-# LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS configuration
-if (NOT LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS)
- add_definitions(-D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS)
-endif()
+# Sanitizer flags =============================================================
# Configure for sanitizers. If LIBCXX_BUILT_STANDALONE then we have to do
# the flag translation ourselves. Othewise LLVM's CMakeList.txt will handle it.
if (LIBCXX_BUILT_STANDALONE)
+ 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.
# But we don't have LLVM_ON_UNIX so checking for MSVC is the best we can do.
if (LLVM_USE_SANITIZER AND NOT MSVC)
- append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_FNO_OMIT_FRAME_POINTER_FLAG
- "-fno-omit-frame-pointer")
+ add_flags_if_supported("-fno-omit-frame-pointer")
+ add_flags_if_supported("-gline-tables-only")
+
if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND
NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
- append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_GLINE_TABLES_ONLY_FLAG
- "-gline-tables-only")
+ add_flags_if_supported("-gline-tables-only")
endif()
if (LLVM_USE_SANITIZER STREQUAL "Address")
- list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=address")
+ add_flags("-fsanitize=address")
elseif (LLVM_USE_SANITIZER MATCHES "Memory(WithOrigins)?")
- list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=memory")
+ add_flags(-fsanitize=memory)
if (LLVM_USE_SANITIZER STREQUAL "MemoryWithOrigins")
- list(APPEND LIBCXX_CXX_FLAGS "-fsanitize-memory-track-origins")
+ add_flags("-fsanitize-memory-track-origins")
endif()
elseif (LLVM_USE_SANITIZER STREQUAL "Undefined")
- list(APPEND LIBCXX_CXX_FLAGS
- "-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover")
+ add_flags("-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all")
elseif (LLVM_USE_SANITIZER STREQUAL "Thread")
- list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=thread")
+ add_flags(-fsanitize=thread)
else()
message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
endif()
- elseif(MSVC)
- message(WARNING "LLVM_USE_SANITIZER is not supported with MSVC")
+ elseif(LLVM_USE_SANITIZER AND MSVC)
+ message(WARNING "LLVM_USE_SANITIZER is not supported on this platform.")
endif()
endif()
-append_if(LIBCXX_CXX_FLAGS LIBCXX_TARGET_TRIPLE
- "-target ${LIBCXX_TARGET_TRIPLE}")
-
-append_if(LIBCXX_CXX_FLAGS LIBCXX_SYSROOT "--sysroot ${LIBCXX_SYSROOT}")
-append_if(LIBCXX_CXX_FLAGS LIBCXX_GCC_TOOLCHAIN
- "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}")
-
-if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_COVERAGE)
- message(FATAL_ERROR "LLVM_USE_SANITIZER cannot be used with LIBCXX_GENERATE_COVERAGE")
+# Configuration file flags =====================================================
+if (NOT LIBCXX_ABI_VERSION EQUAL "1")
+ config_define(${LIBCXX_ABI_VERSION} _LIBCPP_ABI_VERSION)
+endif()
+config_define_if(LIBCXX_ABI_UNSTABLE _LIBCPP_ABI_UNSTABLE)
+
+config_define_if_not(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE)
+config_define_if_not(LIBCXX_ENABLE_STDIN _LIBCPP_HAS_NO_STDIN)
+config_define_if_not(LIBCXX_ENABLE_STDOUT _LIBCPP_HAS_NO_STDOUT)
+config_define_if_not(LIBCXX_ENABLE_THREADS _LIBCPP_HAS_NO_THREADS)
+config_define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK _LIBCPP_HAS_NO_MONOTONIC_CLOCK)
+config_define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS)
+
+config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC)
+
+if (LIBCXX_NEEDS_SITE_CONFIG)
+ 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")
endif()
-
-string(REPLACE ";" " " LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBCXX_CXX_FLAGS}")
#===============================================================================
-# Setup Source Code
+# Setup Source Code And Tests
#===============================================================================
-
include_directories(include)
add_subdirectory(include)
-
-# Add source code. This also contains all of the logic for deciding linker flags
-# soname, etc...
add_subdirectory(lib)
-#===============================================================================
-# Setup Tests
-#===============================================================================
-
-add_subdirectory(test)
+if (LIBCXX_INCLUDE_TESTS)
+ add_subdirectory(test)
+endif()
+if (LIBCXX_INCLUDE_DOCS)
+ add_subdirectory(docs)
+endif()
diff --git a/TODO.TXT b/TODO.TXT
index 513b86377244..bdb94de343d6 100644
--- a/TODO.TXT
+++ b/TODO.TXT
@@ -1,5 +1,15 @@
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.
@@ -21,18 +31,18 @@ CXX Runtime Library Tasks
Atomic Related Tasks
====================
-* Support <atomic> in C++03 (needed for internal use).
+* 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.
-* call_once should use <atomic> for synchronization.
-* Audit shared_ptr use of <atomic>
Test Suite Tasks
================
-* Get test suite passing in C++03.
* 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.
Misc Tasks
==========
@@ -42,8 +52,5 @@ Misc Tasks
* 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)
-* Investigate the effect of using __decltype instead of __typeof__ to provide
- decltype in C++03. What code could be broken by this change?
-* Convert failure tests to use Clang Verify.
* Document support (or lack of) for C++11 libraries in C++03.
* Document supported compilers.
diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake
index 73723e3559b1..d9c652d87bad 100644
--- a/cmake/Modules/HandleLibCXXABI.cmake
+++ b/cmake/Modules/HandleLibCXXABI.cmake
@@ -41,10 +41,13 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
file(COPY "${incpath}/${fpath}"
DESTINATION "${CMAKE_BINARY_DIR}/include/${dstdir}"
)
- install(FILES "${CMAKE_BINARY_DIR}/include/${fpath}"
- DESTINATION include/c++/v1/${dstdir}
- PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
- )
+ if (LIBCXX_INSTALL_HEADERS)
+ install(FILES "${CMAKE_BINARY_DIR}/include/${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}")
endif()
endforeach()
@@ -58,6 +61,8 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
endmacro()
+
+# Configure based on the selected ABI library.
if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR
"${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libsupc++")
set(_LIBSUPCXX_INCLUDE_FILES
diff --git a/cmake/Modules/HandleLibcxxFlags.cmake b/cmake/Modules/HandleLibcxxFlags.cmake
new file mode 100644
index 000000000000..bb886fa8a01f
--- /dev/null
+++ b/cmake/Modules/HandleLibcxxFlags.cmake
@@ -0,0 +1,169 @@
+# HandleLibcxxFlags - A set of macros used to setup the flags used to compile
+# and link libc++. These macros add flags to the following CMake variables.
+# - LIBCXX_COMPILE_FLAGS: flags used to compile libc++
+# - LIBCXX_LINK_FLAGS: flags used to link libc++
+# - LIBCXX_LIBRARIES: libraries to link libc++ to.
+
+include(CheckCXXCompilerFlag)
+
+unset(add_flag_if_supported)
+
+# Mangle the name of a compiler flag into a valid CMake identifier.
+# Ex: --std=c++11 -> STD_EQ_CXX11
+macro(mangle_name str output)
+ string(STRIP "${str}" strippedStr)
+ string(REGEX REPLACE "^/" "" strippedStr "${strippedStr}")
+ string(REGEX REPLACE "^-+" "" strippedStr "${strippedStr}")
+ string(REGEX REPLACE "-+$" "" strippedStr "${strippedStr}")
+ string(REPLACE "-" "_" strippedStr "${strippedStr}")
+ string(REPLACE "=" "_EQ_" strippedStr "${strippedStr}")
+ string(REPLACE "+" "X" strippedStr "${strippedStr}")
+ string(TOUPPER "${strippedStr}" ${output})
+endmacro()
+
+# Remove a list of flags from all CMake variables that affect compile flags.
+# This can be used to remove unwanted flags specified on the command line
+# or added in other parts of LLVM's cmake configuration.
+macro(remove_flags)
+ foreach(var ${ARGN})
+ string(REPLACE "${var}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ string(REPLACE "${var}" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+ string(REPLACE "${var}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
+ string(REPLACE "${var}" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
+ string(REPLACE "${var}" "" CMAKE_SHARED_MODULE_FLAGS "${CMAKE_SHARED_MODULE_FLAGS}")
+ remove_definitions(${var})
+ endforeach()
+endmacro(remove_flags)
+
+# Add a macro definition if condition is true.
+macro(define_if condition def)
+ if (${condition})
+ add_definitions(${def})
+ endif()
+endmacro()
+
+# Add a macro definition if condition is not true.
+macro(define_if_not condition def)
+ if (NOT ${condition})
+ add_definitions(${def})
+ endif()
+endmacro()
+
+# Add a macro definition to the __config_site file if the specified condition
+# is 'true'. Note that '-D${def}' is not added. Instead it is expected that
+# the build include the '__config_site' header.
+macro(config_define_if condition def)
+ if (${condition})
+ set(${def} ON)
+ set(LIBCXX_NEEDS_SITE_CONFIG ON)
+ endif()
+endmacro()
+
+macro(config_define_if_not condition def)
+ if (NOT ${condition})
+ set(${def} ON)
+ set(LIBCXX_NEEDS_SITE_CONFIG ON)
+ endif()
+endmacro()
+
+macro(config_define value def)
+ set(${def} ${value})
+ set(LIBCXX_NEEDS_SITE_CONFIG ON)
+endmacro()
+
+# Add a specified list of flags to both 'LIBCXX_COMPILE_FLAGS' and
+# 'LIBCXX_LINK_FLAGS'.
+macro(add_flags)
+ foreach(value ${ARGN})
+ list(APPEND LIBCXX_COMPILE_FLAGS ${value})
+ list(APPEND LIBCXX_LINK_FLAGS ${value})
+ endforeach()
+endmacro()
+
+# If the specified 'condition' is true then add a list of flags to both
+# 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS'.
+macro(add_flags_if condition)
+ if (${condition})
+ add_flags(${ARGN})
+ endif()
+endmacro()
+
+# Add each flag in the list to LIBCXX_COMPILE_FLAGS and LIBCXX_LINK_FLAGS
+# if that flag is supported by the current compiler.
+macro(add_flags_if_supported)
+ foreach(flag ${ARGN})
+ mangle_name("${flag}" flagname)
+ check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG")
+ add_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag})
+ endforeach()
+endmacro()
+
+# Add a list of flags to 'LIBCXX_COMPILE_FLAGS'.
+macro(add_compile_flags)
+ foreach(f ${ARGN})
+ list(APPEND LIBCXX_COMPILE_FLAGS ${f})
+ endforeach()
+endmacro()
+
+# If 'condition' is true then add the specified list of flags to
+# 'LIBCXX_COMPILE_FLAGS'
+macro(add_compile_flags_if condition)
+ if (${condition})
+ add_compile_flags(${ARGN})
+ endif()
+endmacro()
+
+# For each specified flag, add that flag to 'LIBCXX_COMPILE_FLAGS' if the
+# flag is supported by the C++ compiler.
+macro(add_compile_flags_if_supported)
+ foreach(flag ${ARGN})
+ mangle_name("${flag}" flagname)
+ check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG")
+ add_compile_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag})
+ endforeach()
+endmacro()
+
+# Add a list of flags to 'LIBCXX_LINK_FLAGS'.
+macro(add_link_flags)
+ foreach(f ${ARGN})
+ list(APPEND LIBCXX_LINK_FLAGS ${f})
+ endforeach()
+endmacro()
+
+# If 'condition' is true then add the specified list of flags to
+# 'LIBCXX_LINK_FLAGS'
+macro(add_link_flags_if condition)
+ if (${condition})
+ add_link_flags(${ARGN})
+ endif()
+endmacro()
+
+# For each specified flag, add that flag to 'LIBCXX_LINK_FLAGS' if the
+# flag is supported by the C++ compiler.
+macro(add_link_flags_if_supported)
+ foreach(flag ${ARGN})
+ mangle_name("${flag}" flagname)
+ check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG")
+ add_link_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag})
+ endforeach()
+endmacro()
+
+# Add a list of libraries or link flags to 'LIBCXX_LIBRARIES'.
+macro(add_library_flags)
+ foreach(lib ${ARGN})
+ list(APPEND LIBCXX_LIBRARIES ${lib})
+ endforeach()
+endmacro()
+
+# if 'condition' is true then add the specified list of libraries and flags
+# to 'LIBCXX_LIBRARIES'.
+macro(add_library_flags_if condition)
+ if(${condition})
+ add_library_flags(${ARGN})
+ endif()
+endmacro()
+
+# Turn a comma separated CMake list into a space separated string.
+macro(split_list listname)
+ string(REPLACE ";" " " ${listname} "${${listname}}")
+endmacro()
diff --git a/cmake/Modules/HandleOutOfTreeLLVM.cmake b/cmake/Modules/HandleOutOfTreeLLVM.cmake
new file mode 100644
index 000000000000..6215be7f586a
--- /dev/null
+++ b/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -0,0 +1,138 @@
+macro(find_llvm_parts)
+# Rely on llvm-config.
+ set(CONFIG_OUTPUT)
+ find_program(LLVM_CONFIG "llvm-config")
+ 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}
+ "--includedir"
+ "--prefix"
+ "--src-root")
+ execute_process(
+ COMMAND ${CONFIG_COMMAND}
+ RESULT_VARIABLE HAD_ERROR
+ OUTPUT_VARIABLE CONFIG_OUTPUT
+ )
+ if(NOT HAD_ERROR)
+ string(REGEX REPLACE
+ "[ \t]*[\r\n]+[ \t]*" ";"
+ CONFIG_OUTPUT ${CONFIG_OUTPUT})
+ else()
+ string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}")
+ message(STATUS "${CONFIG_COMMAND_STR}")
+ message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
+ endif()
+
+ list(GET CONFIG_OUTPUT 0 INCLUDE_DIR)
+ list(GET CONFIG_OUTPUT 1 LLVM_OBJ_ROOT)
+ list(GET CONFIG_OUTPUT 2 MAIN_SRC_DIR)
+
+ set(LLVM_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
+ set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
+ set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
+ set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/share/llvm/cmake")
+ else()
+ set(LLVM_FOUND OFF)
+ 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})
+ set(LLVM_FOUND OFF)
+ message(WARNING "Not found: ${LLVM_CMAKE_PATH}")
+ 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)
+ message(STATUS "Configuring for standalone build.")
+
+ find_llvm_parts()
+
+ # LLVM Options --------------------------------------------------------------
+ include(FindPythonInterp)
+ if( NOT PYTHONINTERP_FOUND )
+ message(WARNING "Failed to find python interpreter. "
+ "The libc++ test suite will be disabled.")
+ set(LLVM_INCLUDE_TESTS OFF)
+ endif()
+
+ if (NOT DEFINED LLVM_INCLUDE_TESTS)
+ set(LLVM_INCLUDE_TESTS ${LLVM_FOUND})
+ endif()
+ if (NOT DEFINED LLVM_INCLUDE_DOCS)
+ set(LLVM_INCLUDE_DOCS ${LLVM_FOUND})
+ endif()
+ if (NOT DEFINED LLVM_ENABLE_SPHINX)
+ set(LLVM_ENABLE_SPHINX OFF)
+ endif()
+
+ # Required LIT Configuration ------------------------------------------------
+ # Define the default arguments to use with 'lit', and an option for the user
+ # to override.
+ set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported")
+ if (MSVC OR XCODE)
+ set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
+ endif()
+ set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
+
+ # Make sure we can use the console pool for recent cmake and ninja > 1.5
+ # Needed for add_lit_testsuite
+ if(CMAKE_VERSION VERSION_LESS 3.1.20141117)
+ set(cmake_3_2_USES_TERMINAL)
+ else()
+ set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
+ endif()
+
+ # Required doc configuration
+ if (LLVM_ENABLE_SPHINX)
+ message(STATUS "Sphinx enabled.")
+ find_package(Sphinx REQUIRED)
+ else()
+ message(STATUS "Sphinx disabled.")
+ endif()
+
+ # FIXME - This is cribbed from HandleLLVMOptions.cmake.
+ if(WIN32)
+ 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)
+
+ # Add LLVM Functions --------------------------------------------------------
+ include(AddLLVM OPTIONAL)
+endif()
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 428d737c749d..c05597ea73dd 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -2,23 +2,7 @@ include(CheckLibraryExists)
include(CheckCXXCompilerFlag)
# Check compiler flags
-check_cxx_compiler_flag(-std=c++11 LIBCXX_HAS_STDCXX11_FLAG)
-check_cxx_compiler_flag(-std=c++1y LIBCXX_HAS_STDCXX1Y_FLAG)
-check_cxx_compiler_flag(-fPIC LIBCXX_HAS_FPIC_FLAG)
-check_cxx_compiler_flag(-fno-omit-frame-pointer LIBCXX_HAS_FNO_OMIT_FRAME_POINTER_FLAG)
-check_cxx_compiler_flag(-nodefaultlibs LIBCXX_HAS_NODEFAULTLIBS_FLAG)
-check_cxx_compiler_flag(-nostdinc++ LIBCXX_HAS_NOSTDINCXX_FLAG)
-check_cxx_compiler_flag(-Wall LIBCXX_HAS_WALL_FLAG)
-check_cxx_compiler_flag(-W LIBCXX_HAS_W_FLAG)
-check_cxx_compiler_flag(-Wno-unused-parameter LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG)
-check_cxx_compiler_flag(-Wwrite-strings LIBCXX_HAS_WWRITE_STRINGS_FLAG)
-check_cxx_compiler_flag(-Wno-long-long LIBCXX_HAS_WNO_LONG_LONG_FLAG)
-check_cxx_compiler_flag(-pedantic LIBCXX_HAS_PEDANTIC_FLAG)
-check_cxx_compiler_flag(-Werror LIBCXX_HAS_WERROR_FLAG)
-check_cxx_compiler_flag(-Wno-error LIBCXX_HAS_WNO_ERROR_FLAG)
-check_cxx_compiler_flag(-fno-exceptions LIBCXX_HAS_FNO_EXCEPTIONS_FLAG)
-check_cxx_compiler_flag(-fno-rtti LIBCXX_HAS_FNO_RTTI_FLAG)
-check_cxx_compiler_flag(-gline-tables-only LIBCXX_HAS_GLINE_TABLES_ONLY_FLAG)
+
check_cxx_compiler_flag(/WX LIBCXX_HAS_WX_FLAG)
check_cxx_compiler_flag(/WX- LIBCXX_HAS_NO_WX_FLAG)
check_cxx_compiler_flag(/EHsc LIBCXX_HAS_EHSC_FLAG)
@@ -26,10 +10,10 @@ check_cxx_compiler_flag(/EHs- LIBCXX_HAS_NO_EHS_FLAG)
check_cxx_compiler_flag(/EHa- LIBCXX_HAS_NO_EHA_FLAG)
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 printf "" LIBCXX_HAS_C_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)
-
diff --git a/docs/BuildingLibcxx.rst b/docs/BuildingLibcxx.rst
new file mode 100644
index 000000000000..f00ce4f9cff1
--- /dev/null
+++ b/docs/BuildingLibcxx.rst
@@ -0,0 +1,306 @@
+
+===============
+Building libc++
+===============
+
+.. contents::
+ :local:
+
+Getting Started
+===============
+
+On Mac OS 10.7 (Lion) and later, the easiest way to get this library is to install
+Xcode 4.2 or later. However if you want to install tip-of-trunk from here
+(getting the bleeding edge), read on.
+
+The basic steps needed to build libc++ are:
+
+#. Checkout LLVM:
+
+ * ``cd where-you-want-llvm-to-live``
+ * ``svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm``
+
+#. Checkout libc++:
+
+ * ``cd where-you-want-llvm-to-live``
+ * ``cd llvm/projects``
+ * ``svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx``
+
+#. Checkout libc++abi:
+
+ * ``cd where-you-want-llvm-to-live``
+ * ``cd llvm/projects``
+ * ``svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi``
+
+#. Configure and build libc++ with libc++abi:
+
+ CMake is the only supported configuration system. Unlike other LLVM
+ projects autotools is not supported for either libc++ or libc++abi.
+
+ Clang is the preferred compiler when building and using libc++.
+
+ * ``cd where you want to build llvm``
+ * ``mkdir build``
+ * ``cd build``
+ * ``cmake -G <generator> [options] <path to llvm sources>``
+
+ 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.
+
+ Shared libraries for libc++ and libc++ abi should now be present in llvm/build/lib.
+ See :ref:`using an alternate libc++ installation <alternate libcxx>`
+
+#. **Optional**: Install libc++ and libc++abi
+
+ If your system already provides a libc++ installation it is important to be
+ 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
+
+ .. warning::
+ * Replacing your systems libc++ installation could render the system non-functional.
+ * Mac OS X will not boot without a valid copy of ``libc++.1.dylib`` in ``/usr/lib``.
+
+
+The instructions are for building libc++ on
+FreeBSD, Linux, or Mac using `libc++abi`_ as the C++ ABI library.
+On Linux, it is also possible to use :ref:`libsupc++ <libsupcxx>` or libcxxrt.
+
+It is sometimes beneficial to build outside of the LLVM tree. An out-of-tree
+build would look like this:
+
+.. code-block:: bash
+
+ $ cd where-you-want-libcxx-to-live
+ $ # Check out llvm, libc++ and libc++abi.
+ $ ``svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm``
+ $ ``svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx``
+ $ ``svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi``
+ $ cd where-you-want-to-build
+ $ mkdir build && cd build
+ $ export CC=clang CXX=clang++
+ $ cmake -DLLVM_PATH=path/to/llvm \
+ -DLIBCXX_CXX_ABI=libcxxabi \
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxabi/include \
+ path/to/libcxx
+ $ make
+ $ make check-libcxx # optional
+
+
+.. _`libc++abi`: http://libcxxabi.llvm.org/
+
+
+.. _CMake Options:
+
+CMake Options
+=============
+
+Here are some of the CMake variables that are used often, along with a
+brief explanation and LLVM-specific notes. For full documentation, check the
+CMake docs or execute ``cmake --help-variable VARIABLE_NAME``.
+
+**CMAKE_BUILD_TYPE**:STRING
+ Sets the build type for ``make`` based generators. Possible values are
+ Release, Debug, RelWithDebInfo and MinSizeRel. On systems like Visual Studio
+ the user sets the build type with the IDE settings.
+
+**CMAKE_INSTALL_PREFIX**:PATH
+ Path where LLVM will be installed if "make install" is invoked or the
+ "INSTALL" target is built.
+
+**CMAKE_CXX_COMPILER**:STRING
+ The C++ compiler to use when building and testing libc++.
+
+
+.. _libcxx-specific options:
+
+libc++ specific options
+-----------------------
+
+.. option:: LIBCXX_ENABLE_ASSERTIONS:BOOL
+
+ **Default**: ``ON``
+
+ Build libc++ with assertions enabled.
+
+.. option:: LIBCXX_BUILD_32_BITS:BOOL
+
+ **Default**: ``OFF``
+
+ Build libc++ as a 32 bit library. Also see :option:`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.
+
+.. 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`.
+
+.. _ABI Library Specific Options:
+
+ABI Library Specific Options
+----------------------------
+
+.. option:: LIBCXX_CXX_ABI:STRING
+
+ **Values**: ``none``, ``libcxxabi``, ``libcxxrt``, ``libstdc++``, ``libsupc++``.
+
+ Select the ABI library to build libc++ against.
+
+.. option:: LIBCXX_CXX_ABI_INCLUDE_PATHS:PATHS
+
+ Provide additional search paths for the ABI library headers.
+
+.. option:: LIBCXX_CXX_ABI_LIBRARY_PATH:PATH
+
+ Provide the path to the ABI library that libc++ should link against.
+
+.. option:: LIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL
+
+ **Default**: ``OFF``
+
+ If this option is enabled, libc++ will try and link the selected ABI library
+ statically.
+
+.. option:: LIBCXX_ENABLE_ABI_LINKER_SCRIPT:BOOL
+
+ **Default**: ``ON`` by default on UNIX platforms other than Apple unless
+ 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY' is ON. Otherwise the default value is ``OFF``.
+
+ This option generate and installs a linker script as ``libc++.so`` which
+ links the correct ABI library.
+
+.. option:: LIBCXXABI_USE_LLVM_UNWINDER:BOOL
+
+ **Default**: ``OFF``
+
+ Build and use the LLVM unwinder. Note: This option can only be used when
+ libc++abi is the C++ ABI library used.
+
+
+libc++ Feature options
+----------------------
+
+.. option:: LIBCXX_ENABLE_EXCEPTIONS:BOOL
+
+ **Default**: ``ON``
+
+ Build libc++ with exception support.
+
+.. option:: LIBCXX_ENABLE_RTTI:BOOL
+
+ **Default**: ``ON``
+
+ Build libc++ with run time type information.
+
+
+libc++ Feature options
+----------------------
+
+The following options allow building libc++ for a different ABI version.
+
+.. option:: LIBCXX_ABI_VERSION:STRING
+
+ **Default**: ``1``
+
+ Defines the target ABI version of libc++.
+
+.. option:: LIBCXX_ABI_UNSTABLE:BOOL
+
+ **Default**: ``OFF``
+
+ Build the "unstable" ABI version of libc++. Includes all ABI changing features
+ on top of the current stable version.
+
+.. _LLVM-specific variables:
+
+LLVM-specific options
+---------------------
+
+.. option:: LLVM_LIBDIR_SUFFIX:STRING
+
+ Extra suffix to append to the directory where libraries are to be
+ installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
+ to install libraries to ``/usr/lib64``.
+
+.. option:: LLVM_BUILD_32_BITS:BOOL
+
+ Build 32-bits executables and libraries on 64-bits systems. This option is
+ available only on some 64-bits unix systems. Defaults to OFF.
+
+.. option:: LLVM_LIT_ARGS:STRING
+
+ Arguments given to lit. ``make check`` and ``make clang-test`` are affected.
+ By default, ``'-sv --no-progress-bar'`` on Visual C++ and Xcode, ``'-sv'`` on
+ others.
+
+
+Using Alternate ABI libraries
+=============================
+
+
+.. _libsupcxx:
+
+Using libsupc++ on Linux
+------------------------
+
+You will need libstdc++ in order to provide libsupc++.
+
+Figure out where the libsupc++ headers are on your system. On Ubuntu this
+is ``/usr/include/c++/<version>`` and ``/usr/include/c++/<version>/<target-triple>``
+
+You can also figure this out by running
+
+.. code-block:: bash
+
+ $ echo | g++ -Wp,-v -x c++ - -fsyntax-only
+ ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../x86_64-linux-gnu/include"
+ #include "..." search starts here:
+ #include &lt;...&gt; search starts here:
+ /usr/include/c++/4.7
+ /usr/include/c++/4.7/x86_64-linux-gnu
+ /usr/include/c++/4.7/backward
+ /usr/lib/gcc/x86_64-linux-gnu/4.7/include
+ /usr/local/include
+ /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+ End of search list.
+
+Note that the first two entries happen to be what we are looking for. This
+may not be correct on other platforms.
+
+We can now run CMake:
+
+.. code-block:: bash
+
+ $ CC=clang CXX=clang++ cmake -G "Unix Makefiles" \
+ -DLIBCXX_CXX_ABI=libstdc++ \
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/usr/include/c++/4.7/;/usr/include/c++/4.7/x86_64-linux-gnu/" \
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
+ <libc++-source-dir>
+
+
+You can also substitute ``-DLIBCXX_CXX_ABI=libsupc++``
+above, which will cause the library to be linked to libsupc++ instead
+of libstdc++, but this is only recommended if you know that you will
+never need to link against libstdc++ in the same executable as libc++.
+GCC ships libsupc++ separately but only as a static library. If a
+program also needs to link against libstdc++, it will provide its
+own copy of libsupc++ and this can lead to subtle problems.
+
+.. code-block:: bash
+
+ $ make cxx
+ $ make install
+
+You can now run clang with -stdlib=libc++.
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
new file mode 100644
index 000000000000..f63ee00a5a02
--- /dev/null
+++ b/docs/CMakeLists.txt
@@ -0,0 +1,9 @@
+
+if (LLVM_ENABLE_SPHINX)
+ if (SPHINX_FOUND)
+ include(AddSphinxTarget)
+ if (${SPHINX_OUTPUT_HTML})
+ add_sphinx_target(html libcxx)
+ endif()
+ endif()
+endif() \ No newline at end of file
diff --git a/docs/DesignDocs/ABIVersioning.rst b/docs/DesignDocs/ABIVersioning.rst
new file mode 100644
index 000000000000..5960dd18610c
--- /dev/null
+++ b/docs/DesignDocs/ABIVersioning.rst
@@ -0,0 +1,17 @@
+
+====================
+Libc++ ABI stability
+====================
+
+Libc++ aims to preserve stable ABI to avoid subtle bugs when code built to the old ABI
+is linked with the code build to the new ABI. At the same time, libc++ allows ABI-breaking
+improvements and bugfixes for the scenarios when ABI change is not a issue.
+
+To support both cases, libc++ allows specifying the ABI version at the
+build time. The version is defined with a cmake option
+LIBCXX_ABI_VERSION. Another option LIBCXX_ABI_UNSTABLE can be used to
+include all present ABI breaking features. These options translate
+into C++ macro definitions _LIBCPP_ABI_VERSION, _LIBCPP_ABI_UNSTABLE.
+
+Any ABI-changing feature is placed under it's own macro, _LIBCPP_ABI_XXX, which is enabled
+based on the value of _LIBCPP_ABI_VERSION. _LIBCPP_ABI_UNSTABLE, if set, enables all features at once.
diff --git a/docs/DesignDocs/CapturingConfigInfo.rst b/docs/DesignDocs/CapturingConfigInfo.rst
new file mode 100644
index 000000000000..73378a21c0a9
--- /dev/null
+++ b/docs/DesignDocs/CapturingConfigInfo.rst
@@ -0,0 +1,88 @@
+=======================================================
+Capturing configuration information during installation
+=======================================================
+
+.. contents::
+ :local:
+
+The Problem
+===========
+
+Currently the libc++ supports building the library with a number of different
+configuration options. Unfortunately all of that configuration information is
+lost when libc++ is installed. In order to support "persistent"
+configurations libc++ needs a mechanism to capture the configuration options
+in the INSTALLED headers.
+
+
+Design Goals
+============
+
+* The solution should not INSTALL any additional headers. We don't want an extra
+ #include slowing everybody down.
+
+* The solution should not unduly affect libc++ developers. The problem is limited
+ to installed versions of libc++ and the solution should be as well.
+
+* The solution should not modify any existing headers EXCEPT during installation.
+ It makes developers lives harder if they have to regenerate the libc++ headers
+ every time they are modified.
+
+* The solution should not make any of the libc++ headers dependant on
+ files generated by the build system. The headers should be able to compile
+ out of the box without any modification.
+
+* The solution should not have ANY effect on users who don't need special
+ configuration options. The vast majority of users will never need this so it
+ shouldn't cost them.
+
+
+The Solution
+============
+
+When you first configure libc++ using CMake we check to see if we need to
+capture any options. If we haven't been given any "persistent" options then
+we do NOTHING.
+
+Otherwise we create a custom installation rule that modifies the installed __config
+header. The rule first generates a dummy "__config_site" header containing the required
+#defines. The contents of the dummy header are then prependend to the installed
+__config header. By manually prepending the files we avoid the cost of an
+extra #include and we allow the __config header to be ignorant of the extra
+configuration all together. An example "__config" header generated when
+-DLIBCXX_ENABLE_THREADS=OFF is given to CMake would look something like:
+
+.. code-block:: 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.
+ //
+ //===----------------------------------------------------------------------===//
+
+ #ifndef _LIBCPP_CONFIG_SITE
+ #define _LIBCPP_CONFIG_SITE
+
+ /* #undef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE */
+ /* #undef _LIBCPP_HAS_NO_STDIN */
+ /* #undef _LIBCPP_HAS_NO_STDOUT */
+ #define _LIBCPP_HAS_NO_THREADS
+ /* #undef _LIBCPP_HAS_NO_MONOTONIC_CLOCK */
+ /* #undef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS */
+
+ #endif
+ // -*- C++ -*-
+ //===--------------------------- __config ---------------------------------===//
+ //
+ // The 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_CONFIG
+ #define _LIBCPP_CONFIG
diff --git a/docs/Makefile.sphinx b/docs/Makefile.sphinx
new file mode 100644
index 000000000000..2ca1e4d3faf2
--- /dev/null
+++ b/docs/Makefile.sphinx
@@ -0,0 +1,37 @@
+# Makefile for Sphinx documentation
+#
+# FIXME: This hack is only in place to allow the libcxx.llvm.org/docs builder
+# to work with libcxx. This should be removed when that builder supports
+# out-of-tree builds.
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext default
+
+default: html
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @# FIXME: Remove this `cp` once HTML->Sphinx transition is completed.
+ @# Kind of a hack, but HTML-formatted docs are on the way out anyway.
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
diff --git a/docs/README.txt b/docs/README.txt
new file mode 100644
index 000000000000..06d94f5b5fc4
--- /dev/null
+++ b/docs/README.txt
@@ -0,0 +1,13 @@
+libc++ Documentation
+====================
+
+The libc++ documentation is written using the Sphinx documentation generator. It is
+currently tested with Sphinx 1.1.3.
+
+To build the documents into html configure libc++ with the following cmake options:
+
+ * -DLLVM_ENABLE_SPHINX=ON
+ * -DLIBCXX_INCLUDE_DOCS=ON
+
+After configuring libc++ with these options the make rule `docs-libcxx-html`
+should be available.
diff --git a/docs/TestingLibcxx.rst b/docs/TestingLibcxx.rst
new file mode 100644
index 000000000000..98162d9c2e05
--- /dev/null
+++ b/docs/TestingLibcxx.rst
@@ -0,0 +1,191 @@
+==============
+Testing libc++
+==============
+
+.. contents::
+ :local:
+
+Getting Started
+===============
+
+libc++ uses LIT to configure and run its tests. The primary way to run the
+libc++ tests is by using make check-libcxx. However since libc++ can be used
+in any number of possible configurations it is important to customize the way
+LIT builds and runs the tests. This guide provides information on how to use
+LIT directly to test libc++.
+
+Please see the `Lit Command Guide`_ for more information about LIT.
+
+.. _LIT Command Guide: http://llvm.org/docs/CommandGuide/lit.html
+
+Setting up the Environment
+--------------------------
+
+After building libc++ you must setup your environment to test libc++ using
+LIT.
+
+#. Create a shortcut to the actual lit executable so that you can invoke it
+ easily from the command line.
+
+ .. code-block:: bash
+
+ $ alias lit='python path/to/llvm/utils/lit/lit.py'
+
+#. Tell LIT where to find your build configuration.
+
+ .. code-block:: bash
+
+ $ export LIBCXX_SITE_CONFIG=path/to/build-libcxx/test/lit.site.cfg
+
+Example Usage
+-------------
+
+Once you have your environment set up and you have built libc++ you can run
+parts of the libc++ test suite by simply running `lit` on a specified test or
+directory. For example:
+
+.. code-block:: bash
+
+ $ cd path/to/src/libcxx
+ $ lit -sv test/std/re # Run all of the std::regex tests
+ $ lit -sv test/std/depr/depr.c.headers/stdlib_h.pass.cpp # Run a single test
+ $ lit -sv test/std/atomics test/std/threads # Test std::thread and std::atomic
+
+Sometimes you'll want to change the way LIT is running the tests. Custom options
+can be specified using the `--param=<name>=<val>` flag. The most common option
+you'll want to change is the standard dialect (ie -std=c++XX). By default the
+test suite will select the newest C++ dialect supported by the compiler and use
+that. However if you want to manually specify the option like so:
+
+.. code-block:: bash
+
+ $ lit -sv test/std/containers # Run the tests with the newest -std
+ $ lit -sv --param=std=c++03 test/std/containers # Run the tests in C++03
+
+Occasionally you'll want to add extra compile or link flags when testing.
+You can do this as follows:
+
+.. code-block:: bash
+
+ $ lit -sv --param=compile_flags='-Wcustom-warning'
+ $ lit -sv --param=link_flags='-L/custom/library/path'
+
+Some other common examples include:
+
+.. code-block:: bash
+
+ # Specify a custom compiler.
+ $ lit -sv --param=cxx_under_test=/opt/bin/g++ test/std
+
+ # Enable warnings in the test suite
+ $ lit -sv --param=enable_warnings=true test/std
+
+ # Use UBSAN when running the tests.
+ $ lit -sv --param=use_sanitizer=Undefined
+
+
+LIT Options
+===========
+
+:program:`lit` [*options*...] [*filenames*...]
+
+Command Line Options
+--------------------
+
+To use these options you pass them on the LIT command line as --param NAME or
+--param NAME=VALUE. Some options have default values specified during CMake's
+configuration. Passing the option on the command line will override the default.
+
+.. program:: lit
+
+.. option:: cxx_under_test=<path/to/compiler>
+
+ Specify the compiler used to build the tests.
+
+.. 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>
+
+ 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>
+
+ Specify the libc++ headers that are tested. By default the headers in the
+ source tree are used.
+
+.. option:: libcxx_library=<path/to/libc++.so>
+
+ Specify the libc++ library that is tested. By default the library in the
+ build directory is used. This option cannot be used when use_system_lib is
+ provided.
+
+.. option:: use_system_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>
+
+ 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>
+
+ **Default**: False
+
+ Disable all default compile and link flags from being added. When this
+ option is used only flags specified using the compile_flags and link_flags
+ will be used.
+
+.. 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>"
+
+ Specify additional link flags as a space delimited string.
+
+.. option:: debug_level=<level>
+
+ **Values**: 0, 1
+
+ Enable the use of debug mode. Level 0 enables assertions and level 1 enables
+ assertions and debugging of iterator misuse.
+
+.. option:: use_sanitizer=<sanitizer name>
+
+ **Values**: Memory, MemoryWithOrigins, Address, Undefined
+
+ Run the tests using the given sanitizer. If LLVM_USE_SANITIZER was given when
+ building libc++ then that sanitizer will be used by default.
+
+.. option:: color_diagnostics
+
+ Enable the use of colorized compile diagnostics. If the color_diagnostics
+ option is specified or the environment variable LIBCXX_COLOR_DIAGNOSTICS is
+ present then color diagnostics will be enabled.
+
+
+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`.
+
+.. 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`.
diff --git a/docs/UsingLibcxx.rst b/docs/UsingLibcxx.rst
new file mode 100644
index 000000000000..2a117917638c
--- /dev/null
+++ b/docs/UsingLibcxx.rst
@@ -0,0 +1,89 @@
+============
+Using libc++
+============
+
+.. contents::
+ :local:
+
+Getting Started
+===============
+
+If you already have libc++ installed you can use it with clang.
+
+.. code-block:: bash
+
+ $ clang++ -stdlib=libc++ test.cpp
+ $ clang++ -std=c++11 -stdlib=libc++ test.cpp
+
+On OS X and FreeBSD libc++ is the default standard library
+and the ``-stdlib=libc++`` is not required.
+
+.. _alternate libcxx:
+
+If you want to select an alternate installation of libc++ you
+can use the following options.
+
+.. code-block:: bash
+
+ $ clang++ -std=c++11 -stdlib=libc++ -nostdinc++ \
+ -I<libcxx-install-prefix>/include/c++/v1 \
+ -L<libcxx-install-prefix>/lib \
+ -Wl,-rpath,<libcxx-install-prefix>/lib \
+ test.cpp
+
+The option ``-Wl,-rpath,<libcxx-install-prefix>/lib`` adds a runtime library
+search path. Meaning that the systems dynamic linker will look for libc++ in
+``<libcxx-install-prefix>/lib`` whenever the program is run. Alternatively the
+environment variable ``LD_LIBRARY_PATH`` (``DYLD_LIBRARY_PATH`` on OS X) can
+be used to change the dynamic linkers search paths after a program is compiled.
+
+An example of using ``LD_LIBRARY_PATH``:
+
+.. code-block:: bash
+
+ $ clang++ -stdlib=libc++ -nostdinc++ \
+ -I<libcxx-install-prefix>/include/c++/v1
+ -L<libcxx-install-prefix>/lib \
+ test.cpp -o
+ $ ./a.out # Searches for libc++ in the systems library paths.
+ $ export LD_LIBRARY_PATH=<libcxx-install-prefix>/lib
+ $ ./a.out # Searches for libc++ along LD_LIBRARY_PATH
+
+
+
+Using libc++ on Linux
+=====================
+
+On Linux libc++ can typically be used with only '-stdlib=libc++'. However
+some libc++ installations require the user manually link libc++abi themselves.
+If you are running into linker errors when using libc++ try adding '-lc++abi'
+to the link line. For example:
+
+.. code-block:: bash
+
+ $ clang++ -stdlib=libc++ test.cpp -lc++ -lc++abi -lm -lc -lgcc_s -lgcc
+
+Alternately, you could just add libc++abi to your libraries list, which in
+most situations will give the same result:
+
+.. code-block:: bash
+
+ $ clang++ -stdlib=libc++ test.cpp -lc++abi
+
+
+Using libc++ with GCC
+---------------------
+
+GCC does not provide a way to switch from libstdc++ to libc++. You must manually
+configure the compile and link commands.
+
+In particular you must tell GCC to remove the libstdc++ include directories
+using ``-nostdinc++`` and to not link libstdc++.so using ``-nodefaultlibs``.
+
+Note that ``-nodefaultlibs`` removes all of the standard system libraries and
+not just libstdc++ so they must be manually linked. For example:
+
+.. code-block:: bash
+
+ $ g++ -nostdinc++ -I<libcxx-install-prefix>/include/c++/v1 \
+ test.cpp -nodefaultlibs -lc++ -lc++abi -lm -lc -lgcc_s -lgcc
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 000000000000..915daa47a514
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,251 @@
+# -*- coding: utf-8 -*-
+#
+# libc++ documentation build configuration file.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'libc++'
+copyright = u'2011-2015, LLVM Project'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '3.8'
+# The full version, including alpha/beta/rc tags.
+release = '3.8'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+today_fmt = '%Y-%m-%d'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+show_authors = True
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'friendly'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'haiku'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = []
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'libcxxdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('contents', 'libcxx.tex', u'libcxx Documentation',
+ u'LLVM project', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('contents', 'libc++', u'libc++ Documentation',
+ [u'LLVM project'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ ('contents', 'libc++', u'libc++ Documentation',
+ u'LLVM project', 'libc++', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+
+# FIXME: Define intersphinx configration.
+intersphinx_mapping = {}
+
+
+# -- Options for extensions ----------------------------------------------------
+
+# Enable this if you want TODOs to show up in the generated documentation.
+todo_include_todos = True
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 000000000000..b0c8b813f57f
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,185 @@
+.. _index:
+
+=============================
+"libc++" C++ Standard Library
+=============================
+
+Overview
+========
+
+libc++ is a new implementation of the C++ standard library, targeting C++11.
+
+* Features and Goals
+
+ * Correctness as defined by the C++11 standard.
+ * Fast execution.
+ * Minimal memory use.
+ * Fast compile times.
+ * ABI compatibility with gcc's libstdc++ for some low-level features
+ such as exception objects, rtti and memory allocation.
+ * Extensive unit tests.
+
+* Design and Implementation:
+
+ * Extensive unit tests
+ * Internal linker model can be dumped/read to textual format
+ * Additional linking features can be plugged in as "passes"
+ * OS specific and CPU specific code factored out
+
+
+Getting Started with libc++
+---------------------------
+
+.. toctree::
+ :maxdepth: 2
+
+ UsingLibcxx
+ BuildingLibcxx
+ TestingLibcxx
+
+
+Current Status
+--------------
+
+After its initial introduction, many people have asked "why start a new
+library instead of contributing to an existing library?" (like Apache's
+libstdcxx, GNU's libstdc++, STLport, etc). There are many contributing
+reasons, but some of the major ones are:
+
+* From years of experience (including having implemented the standard
+ library before), we've learned many things about implementing
+ the standard containers which require ABI breakage and fundamental changes
+ to how they are implemented. For example, it is generally accepted that
+ building std::string using the "short string optimization" instead of
+ using Copy On Write (COW) is a superior approach for multicore
+ machines (particularly in C++11, which has rvalue references). Breaking
+ ABI compatibility with old versions of the library was
+ determined to be critical to achieving the performance goals of
+ libc++.
+
+* Mainline libstdc++ has switched to GPL3, a license which the developers
+ of libc++ cannot use. libstdc++ 4.2 (the last GPL2 version) could be
+ independently extended to support C++11, but this would be a fork of the
+ codebase (which is often seen as worse for a project than starting a new
+ independent one). Another problem with libstdc++ is that it is tightly
+ integrated with G++ development, tending to be tied fairly closely to the
+ matching version of G++.
+
+* STLport and the Apache libstdcxx library are two other popular
+ candidates, but both lack C++11 support. Our experience (and the
+ experience of libstdc++ developers) is that adding support for C++11 (in
+ particular rvalue references and move-only types) requires changes to
+ almost every class and function, essentially amounting to a rewrite.
+ Faced with a rewrite, we decided to start from scratch and evaluate every
+ design decision from first principles based on experience.
+ Further, both projects are apparently abandoned: STLport 5.2.1 was
+ released in Oct'08, and STDCXX 4.2.1 in May'08.
+
+Platform and Compiler Support
+-----------------------------
+
+libc++ is known to work on the following platforms, using gcc-4.2 and
+clang (lack of C++11 language support disables some functionality).
+Note that functionality provided by ``<atomic>`` is only functional with clang
+and GCC.
+
+============ ==================== ============ ========================
+OS Arch Compilers ABI Library
+============ ==================== ============ ========================
+Mac OS X i386, x86_64 Clang, GCC libc++abi
+FreeBSD 10+ i386, x86_64, ARM Clang, GCC libcxxrt, libc++abi
+Linux i386, x86_64 Clang, GCC libc++abi
+============ ==================== ============ ========================
+
+The following minimum compiler versions are strongly recommended.
+
+* Clang 3.5 and above
+* GCC 4.7 and above.
+
+Anything older *may* work.
+
+C++ Dialect Support
+---------------------
+
+* C++11 - Complete
+* `C++14 - Complete <http://libcxx.llvm.org/cxx1y_status.html>`__
+* `C++1z - In Progress <http://libcxx.llvm.org/cxx1z_status.html>`__
+* `Post C++14 Technical Specifications - In Progress <http://libcxx.llvm.org/ts1z_status.html>`__
+
+Notes and Known Issues
+----------------------
+
+This list contains known issues with libc++
+
+* Building libc++ with ``-fno-rtti`` is not supported. However
+ linking against it with ``-fno-rtti`` is supported.
+* On OS X v10.8 and older the CMake option ``-DLIBCXX_LIBCPPABI_VERSION=""``
+ must be used during configuration.
+
+
+A full list of currently open libc++ bugs can be `found here`__.
+
+.. __: https://llvm.org/bugs/buglist.cgi?component=All%20Bugs&product=libc%2B%2B&query_format=advanced&resolution=---&order=changeddate%20DESC%2Cassigned_to%20DESC%2Cbug_status%2Cpriority%2Cbug_id&list_id=74184
+
+Design Documents
+----------------
+
+.. toctree::
+ :maxdepth: 1
+
+ DesignDocs/CapturingConfigInfo
+ DesignDocs/ABIVersioning
+
+
+* `<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/
+
+Build Bots and Test Coverage
+----------------------------
+
+* `LLVM Buildbot Builders <http://lab.llvm.org:8011/console>`_
+* `Apple Jenkins Builders <http://lab.llvm.org:8080/green/view/Libcxx/>`_
+* `EricWF's Nightly Builders <http://ds2.efcs.ca:8080/console>`_
+* `Code Coverage Results <http://efcs.ca/libcxx-coverage>`_
+
+Getting Involved
+================
+
+First please review our `Developer's Policy <http://llvm.org/docs/DeveloperPolicy.html>`__
+and `Getting started with LLVM <http://llvm.org/docs/GettingStarted.html>`__.
+
+**Bug Reports**
+
+If you think you've found a bug in libc++, please report it using
+the `LLVM Bugzilla`_. If you're not sure, you
+can post a message to the `cfe-dev mailing list`_ or on IRC.
+Please include "libc++" in your subject.
+
+**Patches**
+
+If you want to contribute a patch to libc++, the best place for that is
+`Phabricator <http://llvm.org/docs/Phabricator.html>`_. Please include [libcxx] in the subject and
+add `cfe-commits` as a subscriber. Also make sure you are subscribed to the
+`cfe-commits mailing list <http://lists.llvm.org/mailman/listinfo/cfe-commits>`_.
+
+**Discussion and Questions**
+
+Send discussions and questions to the
+`cfe-dev mailing list <http://lists.llvm.org/mailman/listinfo/cfe-dev>`_.
+Please include [libcxx] in the subject.
+
+
+
+Quick Links
+===========
+* `LLVM Homepage <http://llvm.org/>`_
+* `libc++abi Homepage <http://libcxxabi.llvm.org/>`_
+* `LLVM Bugzilla <http://llvm.org/bugs/>`_
+* `cfe-commits Mailing List`_
+* `cfe-dev Mailing List`_
+* `Browse libc++ -- SVN <http://llvm.org/svn/llvm-project/libcxx/trunk/>`_
+* `Browse libc++ -- ViewVC <http://llvm.org/viewvc/llvm-project/libcxx/trunk/>`_
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 95206bfeeaff..e16dc8b4de63 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -1,10 +1,12 @@
if (NOT LIBCXX_INSTALL_SUPPORT_HEADERS)
set(LIBCXX_SUPPORT_HEADER_PATTERN PATTERN "support" EXCLUDE)
endif()
+
set(LIBCXX_HEADER_PATTERN
PATTERN "*"
PATTERN "CMakeLists.txt" EXCLUDE
PATTERN ".svn" EXCLUDE
+ PATTERN "__config_site.in" EXCLUDE
${LIBCXX_SUPPORT_HEADER_PATTERN}
)
@@ -17,8 +19,34 @@ file(COPY .
if (LIBCXX_INSTALL_HEADERS)
install(DIRECTORY .
DESTINATION include/c++/v1
+ COMPONENT libcxx
FILES_MATCHING
${LIBCXX_HEADER_PATTERN}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
+
+ if (LIBCXX_NEEDS_SITE_CONFIG)
+ set(UNIX_CAT cat)
+ if (WIN32)
+ set(UNIX_CAT type)
+ endif()
+ # Generate and install a custom __config header. The new header is created
+ # by prepending __config_site to the current __config header.
+ add_custom_command(OUTPUT ${LIBCXX_BINARY_DIR}/__generated_config
+ COMMAND ${CMAKE_COMMAND} -E copy ${LIBCXX_BINARY_DIR}/__config_site ${LIBCXX_BINARY_DIR}/__generated_config
+ COMMAND ${UNIX_CAT} ${LIBCXX_SOURCE_DIR}/include/__config >> ${LIBCXX_BINARY_DIR}/__generated_config
+ DEPENDS ${LIBCXX_SOURCE_DIR}/include/__config
+ ${LIBCXX_BINARY_DIR}/__config_site
+ )
+ # Add a target that executes the generation commands.
+ add_custom_target(generate_config_header ALL
+ DEPENDS ${LIBCXX_BINARY_DIR}/__generated_config)
+ # Install the generated header as __config.
+ install(FILES ${LIBCXX_BINARY_DIR}/__generated_config
+ DESTINATION include/c++/v1
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+ RENAME __config
+ COMPONENT libcxx)
+ endif()
+
endif()
diff --git a/include/__config b/include/__config
index 888f3c098cf4..f141f4f1b7f9 100644
--- a/include/__config
+++ b/include/__config
@@ -11,19 +11,35 @@
#ifndef _LIBCPP_CONFIG
#define _LIBCPP_CONFIG
-#if !defined(_MSC_VER) || defined(__clang__)
+#if defined(_MSC_VER) && !defined(__clang__)
+#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#endif
+
+#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
#pragma GCC system_header
#endif
+#ifdef __cplusplus
+
#ifdef __GNUC__
#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
#else
#define _GNUC_VER 0
#endif
-#define _LIBCPP_VERSION 3700
+#define _LIBCPP_VERSION 3800
+#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,
+// improving its alignment in some cases.
+#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+// Fix deque iterator type in order to support incomplete types.
+#define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
+#endif
#define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y
#define _LIBCPP_CONCAT(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y)
@@ -37,6 +53,9 @@
#ifndef __has_builtin
#define __has_builtin(__x) 0
#endif
+#ifndef __has_extension
+#define __has_extension(__x) 0
+#endif
#ifndef __has_feature
#define __has_feature(__x) 0
#endif
@@ -61,6 +80,16 @@
#endif // __BIG_ENDIAN__
#endif // __BIG_ENDIAN__
+#ifdef __BYTE_ORDER__
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define _LIBCPP_LITTLE_ENDIAN 1
+#define _LIBCPP_BIG_ENDIAN 0
+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+#define _LIBCPP_LITTLE_ENDIAN 0
+#define _LIBCPP_BIG_ENDIAN 1
+#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+#endif // __BYTE_ORDER__
+
#ifdef __FreeBSD__
# include <sys/endian.h>
# if _BYTE_ORDER == _LITTLE_ENDIAN
@@ -227,9 +256,12 @@
#if defined(__clang__)
-#if defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \
- !defined(__arm__)
-#define _LIBCPP_ALTERNATE_STRING_LAYOUT
+// _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for
+// _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility.
+#if (defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \
+ !defined(__arm__)) || \
+ defined(_LIBCPP_ALTERNATE_STRING_LAYOUT)
+#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
#endif
#if __has_feature(cxx_alignas)
@@ -273,6 +305,10 @@ typedef __char32_t char32_t;
#define _LIBCPP_UNUSED __attribute__((__unused__))
+#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))
@@ -354,24 +390,23 @@ typedef __char32_t char32_t;
#elif defined(__ANDROID__)
#define _LIBCPP_HAS_QUICK_EXIT
#elif defined(__linux__)
-#include <features.h>
+#if !defined(_LIBCPP_HAS_MUSL_LIBC)
+# include <features.h>
#if __GLIBC_PREREQ(2, 15)
#define _LIBCPP_HAS_QUICK_EXIT
#endif
#if __GLIBC_PREREQ(2, 17)
#define _LIBCPP_HAS_C11_FEATURES
#endif
+#else // defined(_LIBCPP_HAS_MUSL_LIBC)
+#define _LIBCPP_HAS_QUICK_EXIT
+#define _LIBCPP_HAS_C11_FEATURES
#endif
+#endif // __linux__
#endif
-#if (__has_feature(cxx_noexcept))
-# define _NOEXCEPT noexcept
-# define _NOEXCEPT_(x) noexcept(x)
-# define _NOEXCEPT_OR_FALSE(x) noexcept(x)
-#else
-# define _NOEXCEPT throw()
-# define _NOEXCEPT_(x)
-# define _NOEXCEPT_OR_FALSE(x) false
+#if !(__has_feature(cxx_noexcept))
+#define _LIBCPP_HAS_NO_NOEXCEPT
#endif
#if __has_feature(underlying_type)
@@ -429,19 +464,21 @@ namespace std {
#define _LIBCPP_HAS_NO_CONSTEXPR
#endif
-// No version of GCC supports relaxed constexpr rules
+// Determine if GCC supports relaxed constexpr
+#if !defined(__cpp_constexpr) || __cpp_constexpr < 201304L
#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
+#endif
+
// GCC 5 will support variable templates
+#if !defined(__cpp_variable_templates) || __cpp_variable_templates < 201304L
#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
-
-#define _NOEXCEPT throw()
-#define _NOEXCEPT_(x)
-#define _NOEXCEPT_OR_FALSE(x) false
+#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
@@ -449,31 +486,29 @@ namespace std {
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_VARIADICS
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
#define _LIBCPP_HAS_NO_STRONG_ENUMS
+#define _LIBCPP_HAS_NO_NOEXCEPT
#else // __GXX_EXPERIMENTAL_CXX0X__
-#define _LIBCPP_HAS_NO_TRAILING_RETURN
-#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
-
#if _GNUC_VER < 403
+#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#endif
-
-#if _GNUC_VER < 403
#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
#endif // _GNUC_VER < 404
#if _GNUC_VER < 406
+#define _LIBCPP_HAS_NO_NOEXCEPT
#define _LIBCPP_HAS_NO_NULLPTR
#endif
@@ -501,22 +536,20 @@ using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
#elif defined(_LIBCPP_MSVC)
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
#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 _LIBCPP_UNUSED
#define _ALIGNAS(x) __declspec(align(x))
#define _LIBCPP_HAS_NO_VARIADICS
-#define _NOEXCEPT throw ()
-#define _NOEXCEPT_(x)
-#define _NOEXCEPT_OR_FALSE(x) false
+
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
#define _LIBCPP_END_NAMESPACE_STD }
@@ -536,14 +569,11 @@ namespace std {
#define _LIBCPP_NORETURN __attribute__((noreturn))
#define _LIBCPP_UNUSED
-#define _NOEXCEPT throw()
-#define _NOEXCEPT_(x)
-#define _NOEXCEPT_OR_FALSE(x) false
-
+#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#define _LIBCPP_HAS_NO_NOEXCEPT
#define _LIBCPP_HAS_NO_NULLPTR
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_IS_BASE_OF
@@ -567,6 +597,14 @@ namespace std {
#endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__
+#ifndef _LIBCPP_HAS_NO_NOEXCEPT
+# define _NOEXCEPT noexcept
+# define _NOEXCEPT_(x) noexcept(x)
+#else
+# define _NOEXCEPT throw()
+# define _NOEXCEPT_(x)
+#endif
+
#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef unsigned short char16_t;
typedef unsigned int char32_t;
@@ -578,9 +616,11 @@ typedef unsigned int char32_t;
#ifdef _LIBCPP_HAS_NO_STATIC_ASSERT
+extern "C++" {
template <bool> struct __static_assert_test;
template <> struct __static_assert_test<true> {};
template <unsigned> struct __static_assert_check {};
+}
#define static_assert(__b, __m) \
typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \
_LIBCPP_CONCAT(__t, __LINE__)
@@ -716,6 +756,12 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_CONSTEXPR_AFTER_CXX11
#endif
+#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+# define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x)
+#else
+# define _LIBCPP_EXPLICIT_MOVE(x) (x)
+#endif
+
#ifndef _LIBCPP_HAS_NO_ASAN
extern "C" void __sanitizer_annotate_contiguous_container(
const void *, const void *, const void *, const void *);
@@ -725,7 +771,7 @@ extern "C" void __sanitizer_annotate_contiguous_container(
// g++ and cl.exe have RTTI on by default and define a macro when it is.
// g++ only defines the macro in 4.3.2 and onwards.
#if !defined(_LIBCPP_NO_RTTI)
-# if defined(__GNUG__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \
+# if defined(__GNUC__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \
(__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI)
# define _LIBCPP_NO_RTTI
# elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI)
@@ -757,7 +803,7 @@ extern "C" void __sanitizer_annotate_contiguous_container(
#define _LIBCPP_HAS_NO_STDOUT
#endif
-#if defined(__ANDROID__) || defined(__CloudABI__)
+#if defined(__ANDROID__) || defined(__CloudABI__) || defined(_LIBCPP_HAS_MUSL_LIBC)
#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
#endif
@@ -767,4 +813,17 @@ extern "C" void __sanitizer_annotate_contiguous_container(
#define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
#endif
-#endif // _LIBCPP_CONFIG
+#if __has_feature(cxx_atomic) || __has_extension(c_atomic)
+#define _LIBCPP_HAS_C_ATOMIC_IMP
+#elif _GNUC_VER > 407
+#define _LIBCPP_HAS_GCC_ATOMIC_IMP
+#endif
+
+#if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)) \
+ || defined(_LIBCPP_HAS_NO_THREADS)
+#define _LIBCPP_HAS_NO_ATOMIC_HEADER
+#endif
+
+#endif // __cplusplus
+
+#endif // _LIBCPP_CONFIG
diff --git a/include/__config_site.in b/include/__config_site.in
new file mode 100644
index 000000000000..ec64485289fa
--- /dev/null
+++ b/include/__config_site.in
@@ -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.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_CONFIG_SITE
+#define _LIBCPP_CONFIG_SITE
+
+#cmakedefine _LIBCPP_ABI_VERSION @_LIBCPP_ABI_VERSION@
+#cmakedefine _LIBCPP_ABI_UNSTABLE
+#cmakedefine _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
+#cmakedefine _LIBCPP_HAS_NO_STDIN
+#cmakedefine _LIBCPP_HAS_NO_STDOUT
+#cmakedefine _LIBCPP_HAS_NO_THREADS
+#cmakedefine _LIBCPP_HAS_NO_MONOTONIC_CLOCK
+#cmakedefine _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
+#cmakedefine _LIBCPP_HAS_MUSL_LIBC
+
+#endif // _LIBCPP_CONFIG_SITE
diff --git a/include/__functional_03 b/include/__functional_03
index 13c38d8548d9..4edbb0996ca0 100644
--- a/include/__functional_03
+++ b/include/__functional_03
@@ -17,218 +17,7 @@
#pragma GCC system_header
#endif
-template <class _Tp>
-class __mem_fn
- : public __weak_result_type<_Tp>
-{
-public:
- // types
- typedef _Tp type;
-private:
- type __f_;
-
-public:
- _LIBCPP_INLINE_VISIBILITY __mem_fn(type __f) : __f_(__f) {}
-
- // invoke
-
- typename __invoke_return<type>::type
- operator() () const
- {
- return __invoke(__f_);
- }
-
- template <class _A0>
- typename __invoke_return0<type, _A0>::type
- operator() (_A0& __a0) const
- {
- return __invoke(__f_, __a0);
- }
-
- template <class _A0, class _A1>
- typename __invoke_return1<type, _A0, _A1>::type
- operator() (_A0& __a0, _A1& __a1) const
- {
- return __invoke(__f_, __a0, __a1);
- }
-
- template <class _A0, class _A1, class _A2>
- typename __invoke_return2<type, _A0, _A1, _A2>::type
- operator() (_A0& __a0, _A1& __a1, _A2& __a2) const
- {
- return __invoke(__f_, __a0, __a1, __a2);
- }
-};
-
-template<class _Rp, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp _Tp::*>
-mem_fn(_Rp _Tp::* __pm)
-{
- return __mem_fn<_Rp _Tp::*>(__pm);
-}
-
-template<class _Rp, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)()>
-mem_fn(_Rp (_Tp::* __pm)())
-{
- return __mem_fn<_Rp (_Tp::*)()>(__pm);
-}
-
-template<class _Rp, class _Tp, class _A0>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)(_A0)>
-mem_fn(_Rp (_Tp::* __pm)(_A0))
-{
- return __mem_fn<_Rp (_Tp::*)(_A0)>(__pm);
-}
-
-template<class _Rp, class _Tp, class _A0, class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)(_A0, _A1)>
-mem_fn(_Rp (_Tp::* __pm)(_A0, _A1))
-{
- return __mem_fn<_Rp (_Tp::*)(_A0, _A1)>(__pm);
-}
-
-template<class _Rp, class _Tp, class _A0, class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)>
-mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2))
-{
- return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)>(__pm);
-}
-
-template<class _Rp, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)() const>
-mem_fn(_Rp (_Tp::* __pm)() const)
-{
- return __mem_fn<_Rp (_Tp::*)() const>(__pm);
-}
-
-template<class _Rp, class _Tp, class _A0>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)(_A0) const>
-mem_fn(_Rp (_Tp::* __pm)(_A0) const)
-{
- return __mem_fn<_Rp (_Tp::*)(_A0) const>(__pm);
-}
-
-template<class _Rp, class _Tp, class _A0, class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)(_A0, _A1) const>
-mem_fn(_Rp (_Tp::* __pm)(_A0, _A1) const)
-{
- return __mem_fn<_Rp (_Tp::*)(_A0, _A1) const>(__pm);
-}
-
-template<class _Rp, class _Tp, class _A0, class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) const>
-mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2) const)
-{
- return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) const>(__pm);
-}
-
-template<class _Rp, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)() volatile>
-mem_fn(_Rp (_Tp::* __pm)() volatile)
-{
- return __mem_fn<_Rp (_Tp::*)() volatile>(__pm);
-}
-
-template<class _Rp, class _Tp, class _A0>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)(_A0) volatile>
-mem_fn(_Rp (_Tp::* __pm)(_A0) volatile)
-{
- return __mem_fn<_Rp (_Tp::*)(_A0) volatile>(__pm);
-}
-
-template<class _Rp, class _Tp, class _A0, class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)(_A0, _A1) volatile>
-mem_fn(_Rp (_Tp::* __pm)(_A0, _A1) volatile)
-{
- return __mem_fn<_Rp (_Tp::*)(_A0, _A1) volatile>(__pm);
-}
-
-template<class _Rp, class _Tp, class _A0, class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) volatile>
-mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2) volatile)
-{
- return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) volatile>(__pm);
-}
-
-template<class _Rp, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)() const volatile>
-mem_fn(_Rp (_Tp::* __pm)() const volatile)
-{
- return __mem_fn<_Rp (_Tp::*)() const volatile>(__pm);
-}
-
-template<class _Rp, class _Tp, class _A0>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)(_A0) const volatile>
-mem_fn(_Rp (_Tp::* __pm)(_A0) const volatile)
-{
- return __mem_fn<_Rp (_Tp::*)(_A0) const volatile>(__pm);
-}
-
-template<class _Rp, class _Tp, class _A0, class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)(_A0, _A1) const volatile>
-mem_fn(_Rp (_Tp::* __pm)(_A0, _A1) const volatile)
-{
- return __mem_fn<_Rp (_Tp::*)(_A0, _A1) const volatile>(__pm);
-}
-
-template<class _Rp, class _Tp, class _A0, class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) const volatile>
-mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2) const volatile)
-{
- return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) const volatile>(__pm);
-}
-
-// bad_function_call
-
-class _LIBCPP_EXCEPTION_ABI bad_function_call
- : public exception
-{
-};
-
-template<class _Fp> class _LIBCPP_TYPE_VIS_ONLY function; // undefined
-
-namespace __function
-{
-
-template<class _Fp>
-struct __maybe_derive_from_unary_function
-{
-};
-
-template<class _Rp, class _A1>
-struct __maybe_derive_from_unary_function<_Rp(_A1)>
- : public unary_function<_A1, _Rp>
-{
-};
-
-template<class _Fp>
-struct __maybe_derive_from_binary_function
-{
-};
-
-template<class _Rp, class _A1, class _A2>
-struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)>
- : public binary_function<_A1, _A2, _Rp>
-{
-};
+namespace __function {
template<class _Fp> class __base;
@@ -662,15 +451,6 @@ class _LIBCPP_TYPE_VIS_ONLY function<_Rp()>
aligned_storage<3*sizeof(void*)>::type __buf_;
__base* __f_;
- template <class _Fp>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(const _Fp&) {return true;}
- template <class _R2>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (*__p)()) {return __p;}
- template <class _R2>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(const function<_R2()>& __p) {return __p;}
public:
typedef _Rp result_type;
@@ -769,7 +549,7 @@ function<_Rp()>::function(_Fp __f,
typename enable_if<!is_integral<_Fp>::value>::type*)
: __f_(0)
{
- if (__not_null(__f))
+ if (__function::__not_null(__f))
{
typedef __function::__func<_Fp, allocator<_Fp>, _Rp()> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
@@ -796,7 +576,7 @@ function<_Rp()>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
: __f_(0)
{
typedef allocator_traits<_Alloc> __alloc_traits;
- if (__not_null(__f))
+ if (__function::__not_null(__f))
{
typedef __function::__func<_Fp, _Alloc, _Rp()> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
@@ -947,27 +727,6 @@ class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_A0)>
aligned_storage<3*sizeof(void*)>::type __buf_;
__base* __f_;
- template <class _Fp>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(const _Fp&) {return true;}
- template <class _R2, class _B0>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (*__p)(_B0)) {return __p;}
- template <class _R2, class _Cp>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)()) {return __p;}
- template <class _R2, class _Cp>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)() const) {return __p;}
- template <class _R2, class _Cp>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)() volatile) {return __p;}
- template <class _R2, class _Cp>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)() const volatile) {return __p;}
- template <class _R2, class _B0>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(const function<_R2(_B0)>& __p) {return __p;}
public:
typedef _Rp result_type;
@@ -1066,7 +825,7 @@ function<_Rp(_A0)>::function(_Fp __f,
typename enable_if<!is_integral<_Fp>::value>::type*)
: __f_(0)
{
- if (__not_null(__f))
+ if (__function::__not_null(__f))
{
typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0)> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
@@ -1093,7 +852,7 @@ function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
: __f_(0)
{
typedef allocator_traits<_Alloc> __alloc_traits;
- if (__not_null(__f))
+ if (__function::__not_null(__f))
{
typedef __function::__func<_Fp, _Alloc, _Rp(_A0)> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
@@ -1244,27 +1003,6 @@ class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_A0, _A1)>
aligned_storage<3*sizeof(void*)>::type __buf_;
__base* __f_;
- template <class _Fp>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(const _Fp&) {return true;}
- template <class _R2, class _B0, class _B1>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (*__p)(_B0, _B1)) {return __p;}
- template <class _R2, class _Cp, class _B1>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)(_B1)) {return __p;}
- template <class _R2, class _Cp, class _B1>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)(_B1) const) {return __p;}
- template <class _R2, class _Cp, class _B1>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)(_B1) volatile) {return __p;}
- template <class _R2, class _Cp, class _B1>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)(_B1) const volatile) {return __p;}
- template <class _R2, class _B0, class _B1>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(const function<_R2(_B0, _B1)>& __p) {return __p;}
public:
typedef _Rp result_type;
@@ -1363,7 +1101,7 @@ function<_Rp(_A0, _A1)>::function(_Fp __f,
typename enable_if<!is_integral<_Fp>::value>::type*)
: __f_(0)
{
- if (__not_null(__f))
+ if (__function::__not_null(__f))
{
typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0, _A1)> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
@@ -1390,7 +1128,7 @@ function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
: __f_(0)
{
typedef allocator_traits<_Alloc> __alloc_traits;
- if (__not_null(__f))
+ if (__function::__not_null(__f))
{
typedef __function::__func<_Fp, _Alloc, _Rp(_A0, _A1)> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
@@ -1540,27 +1278,6 @@ class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_A0, _A1, _A2)>
aligned_storage<3*sizeof(void*)>::type __buf_;
__base* __f_;
- template <class _Fp>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(const _Fp&) {return true;}
- template <class _R2, class _B0, class _B1, class _B2>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (*__p)(_B0, _B1, _B2)) {return __p;}
- template <class _R2, class _Cp, class _B1, class _B2>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)(_B1, _B2)) {return __p;}
- template <class _R2, class _Cp, class _B1, class _B2>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)(_B1, _B2) const) {return __p;}
- template <class _R2, class _Cp, class _B1, class _B2>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)(_B1, _B2) volatile) {return __p;}
- template <class _R2, class _Cp, class _B1, class _B2>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)(_B1, _B2) const volatile) {return __p;}
- template <class _R2, class _B0, class _B1, class _B2>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(const function<_R2(_B0, _B1, _B2)>& __p) {return __p;}
public:
typedef _Rp result_type;
@@ -1660,7 +1377,7 @@ function<_Rp(_A0, _A1, _A2)>::function(_Fp __f,
typename enable_if<!is_integral<_Fp>::value>::type*)
: __f_(0)
{
- if (__not_null(__f))
+ if (__function::__not_null(__f))
{
typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0, _A1, _A2)> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
@@ -1687,7 +1404,7 @@ function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _Fp
: __f_(0)
{
typedef allocator_traits<_Alloc> __alloc_traits;
- if (__not_null(__f))
+ if (__function::__not_null(__f))
{
typedef __function::__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
@@ -1856,274 +1573,4 @@ void
swap(function<_Fp>& __x, function<_Fp>& __y)
{return __x.swap(__y);}
-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> {};
-
-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> {};
-
-namespace placeholders
-{
-
-template <int _Np> struct __ph {};
-
-extern __ph<1> _1;
-extern __ph<2> _2;
-extern __ph<3> _3;
-extern __ph<4> _4;
-extern __ph<5> _5;
-extern __ph<6> _6;
-extern __ph<7> _7;
-extern __ph<8> _8;
-extern __ph<9> _9;
-extern __ph<10> _10;
-
-} // placeholders
-
-template<int _Np>
-struct __is_placeholder<placeholders::__ph<_Np> >
- : public integral_constant<int, _Np> {};
-
-template <class _Tp, class _Uj>
-inline _LIBCPP_INLINE_VISIBILITY
-_Tp&
-__mu(reference_wrapper<_Tp> __t, _Uj&)
-{
- return __t.get();
-}
-/*
-template <bool _IsBindExpr, class _Ti, class ..._Uj>
-struct __mu_return1 {};
-
-template <class _Ti, class ..._Uj>
-struct __mu_return1<true, _Ti, _Uj...>
-{
- typedef typename result_of<_Ti(_Uj...)>::type type;
-};
-
-template <class _Ti, class ..._Uj, size_t ..._Indx>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __mu_return1<true, _Ti, _Uj...>::type
-__mu_expand(_Ti& __ti, tuple<_Uj...>&& __uj, __tuple_indices<_Indx...>)
-{
- __ti(_VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(_VSTD::get<_Indx>(__uj))...);
-}
-
-template <class _Ti, class ..._Uj>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_bind_expression<_Ti>::value,
- typename __mu_return1<is_bind_expression<_Ti>::value, _Ti, _Uj...>::type
->::type
-__mu(_Ti& __ti, tuple<_Uj...>& __uj)
-{
- typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices;
- return __mu_expand(__ti, __uj, __indices());
-}
-
-template <bool IsPh, class _Ti, class _Uj>
-struct __mu_return2 {};
-
-template <class _Ti, class _Uj>
-struct __mu_return2<true, _Ti, _Uj>
-{
- typedef typename tuple_element<is_placeholder<_Ti>::value - 1, _Uj>::type type;
-};
-
-template <class _Ti, class _Uj>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- 0 < is_placeholder<_Ti>::value,
- typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type
->::type
-__mu(_Ti&, _Uj& __uj)
-{
- const size_t _Indx = is_placeholder<_Ti>::value - 1;
- // compiler bug workaround
- typename tuple_element<_Indx, _Uj>::type __t = _VSTD::get<_Indx>(__uj);
- return __t;
-// return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(_VSTD::get<_Indx>(__uj));
-}
-
-template <class _Ti, class _Uj>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_bind_expression<_Ti>::value &&
- is_placeholder<_Ti>::value == 0 &&
- !__is_reference_wrapper<_Ti>::value,
- _Ti&
->::type
-__mu(_Ti& __ti, _Uj& __uj)
-{
- return __ti;
-}
-
-template <class _Ti, bool IsBindEx, bool IsPh, class _TupleUj>
-struct ____mu_return;
-
-template <class _Ti, class ..._Uj>
-struct ____mu_return<_Ti, true, false, tuple<_Uj...> >
-{
- typedef typename result_of<_Ti(_Uj...)>::type type;
-};
-
-template <class _Ti, class _TupleUj>
-struct ____mu_return<_Ti, false, true, _TupleUj>
-{
- typedef typename tuple_element<is_placeholder<_Ti>::value - 1,
- _TupleUj>::type&& type;
-};
-
-template <class _Ti, class _TupleUj>
-struct ____mu_return<_Ti, false, false, _TupleUj>
-{
- typedef _Ti& type;
-};
-
-template <class _Ti, class _TupleUj>
-struct __mu_return
- : public ____mu_return<_Ti,
- is_bind_expression<_Ti>::value,
- 0 < is_placeholder<_Ti>::value,
- _TupleUj>
-{
-};
-
-template <class _Ti, class _TupleUj>
-struct __mu_return<reference_wrapper<_Ti>, _TupleUj>
-{
- typedef _Ti& type;
-};
-
-template <class _Fp, class _BoundArgs, class _TupleUj>
-struct __bind_return;
-
-template <class _Fp, class ..._BoundArgs, class _TupleUj>
-struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj>
-{
- typedef typename __ref_return
- <
- _Fp&,
- typename __mu_return
- <
- _BoundArgs,
- _TupleUj
- >::type...
- >::type type;
-};
-
-template <class _Fp, class ..._BoundArgs, class _TupleUj>
-struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj>
-{
- typedef typename __ref_return
- <
- _Fp&,
- typename __mu_return
- <
- const _BoundArgs,
- _TupleUj
- >::type...
- >::type type;
-};
-
-template <class _Fp, class _BoundArgs, size_t ..._Indx, class _Args>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __bind_return<_Fp, _BoundArgs, _Args>::type
-__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
- _Args&& __args)
-{
- return __invoke(__f, __mu(_VSTD::get<_Indx>(__bound_args), __args)...);
-}
-
-template<class _Fp, class ..._BoundArgs>
-class __bind
-{
- _Fp __f_;
- tuple<_BoundArgs...> __bound_args_;
-
- typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
-public:
- template <class _Gp, class ..._BA>
- explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
- : __f_(_VSTD::forward<_Gp>(__f)),
- __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
-
- template <class ..._Args>
- typename __bind_return<_Fp, tuple<_BoundArgs...>, tuple<_Args&&...> >::type
- operator()(_Args&& ...__args)
- {
- // compiler bug workaround
- return __apply_functor(__f_, __bound_args_, __indices(),
- tuple<_Args&&...>(__args...));
- }
-
- template <class ..._Args>
- typename __bind_return<_Fp, tuple<_BoundArgs...>, tuple<_Args&&...> >::type
- operator()(_Args&& ...__args) const
- {
- return __apply_functor(__f_, __bound_args_, __indices(),
- tuple<_Args&&...>(__args...));
- }
-};
-
-template<class _Fp, class ..._BoundArgs>
-struct __is_bind_expression<__bind<_Fp, _BoundArgs...> > : public true_type {};
-
-template<class _Rp, class _Fp, class ..._BoundArgs>
-class __bind_r
- : public __bind<_Fp, _BoundArgs...>
-{
- typedef __bind<_Fp, _BoundArgs...> base;
-public:
- typedef _Rp result_type;
-
- template <class _Gp, class ..._BA>
- explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args)
- : base(_VSTD::forward<_Gp>(__f),
- _VSTD::forward<_BA>(__bound_args)...) {}
-
- template <class ..._Args>
- result_type
- operator()(_Args&& ...__args)
- {
- typedef __invoke_void_return_wrapper<_Rp> _Invoker;
- return _Invoker::__call(static_cast<base&>(*this), _VSTD::forward<_Args>(__args)...);
- }
-
- template <class ..._Args>
- result_type
- operator()(_Args&& ...__args) const
- {
- typedef __invoke_void_return_wrapper<_Rp> _Invoker;
- return _Invoker::__call(static_cast<base const&>(*this), _VSTD::forward<_Args>(__args)...);
- }
-};
-
-template<class _Rp, class _Fp, class ..._BoundArgs>
-struct __is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {};
-
-template<class _Fp, class ..._BoundArgs>
-inline _LIBCPP_INLINE_VISIBILITY
-__bind<typename decay<_Fp>::type, typename decay<_BoundArgs>::type...>
-bind(_Fp&& __f, _BoundArgs&&... __bound_args)
-{
- typedef __bind<typename decay<_Fp>::type, typename decay<_BoundArgs>::type...> type;
- return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
-}
-
-template<class _Rp, class _Fp, class ..._BoundArgs>
-inline _LIBCPP_INLINE_VISIBILITY
-__bind_r<_Rp, typename decay<_Fp>::type, typename decay<_BoundArgs>::type...>
-bind(_Fp&& __f, _BoundArgs&&... __bound_args)
-{
- typedef __bind_r<_Rp, typename decay<_Fp>::type, typename decay<_BoundArgs>::type...> type;
- return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
-}
-*/
-
#endif // _LIBCPP_FUNCTIONAL_03
diff --git a/include/__functional_base b/include/__functional_base
index 09424bc025a9..52c535aa3ea1 100644
--- a/include/__functional_base
+++ b/include/__functional_base
@@ -77,62 +77,6 @@ struct _LIBCPP_TYPE_VIS_ONLY less<void>
};
#endif
-// addressof
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_Tp*
-addressof(_Tp& __x) _NOEXCEPT
-{
- return (_Tp*)&reinterpret_cast<const volatile char&>(__x);
-}
-
-#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
-// Objective-C++ Automatic Reference Counting uses qualified pointers
-// that require special addressof() signatures. When
-// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
-// itself is providing these definitions. Otherwise, we provide them.
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__strong _Tp*
-addressof(__strong _Tp& __x) _NOEXCEPT
-{
- return &__x;
-}
-
-#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__weak _Tp*
-addressof(__weak _Tp& __x) _NOEXCEPT
-{
- return &__x;
-}
-#endif
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__autoreleasing _Tp*
-addressof(__autoreleasing _Tp& __x) _NOEXCEPT
-{
- return &__x;
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-__unsafe_unretained _Tp*
-addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
-{
- return &__x;
-}
-#endif
-
-#ifdef _LIBCPP_HAS_NO_VARIADICS
-
-#include <__functional_base_03>
-
-#else // _LIBCPP_HAS_NO_VARIADICS
-
// __weak_result_type
template <class _Tp>
@@ -314,6 +258,8 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile>
{
};
+
+#ifndef _LIBCPP_HAS_NO_VARIADICS
// 3 or more arguments
template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
@@ -358,8 +304,12 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile>
typedef _Rp result_type;
};
+#endif // _LIBCPP_HAS_NO_VARIADICS
+
// __invoke
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
// bullets 1 and 2
template <class _Fp, class _A0, class ..._Args,
@@ -414,31 +364,79 @@ __invoke(_Fp&& __f, _Args&& ...__args)
{
return _VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...);
}
-
template <class _Tp, class ..._Args>
struct __invoke_return
{
typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type;
};
+#else // _LIBCPP_HAS_NO_VARIADICS
+
+#include <__functional_base_03>
+
+#endif // _LIBCPP_HAS_NO_VARIADICS
+
+
template <class _Ret>
struct __invoke_void_return_wrapper
{
+#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class ..._Args>
- static _Ret __call(_Args&&... __args)
- {
+ static _Ret __call(_Args&&... __args) {
return __invoke(_VSTD::forward<_Args>(__args)...);
}
+#else
+ template <class _Fn>
+ static _Ret __call(_Fn __f) {
+ return __invoke(__f);
+ }
+
+ template <class _Fn, class _A0>
+ static _Ret __call(_Fn __f, _A0& __a0) {
+ return __invoke(__f, __a0);
+ }
+
+ template <class _Fn, class _A0, class _A1>
+ static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1) {
+ return __invoke(__f, __a0, __a1);
+ }
+
+ template <class _Fn, class _A0, class _A1, class _A2>
+ static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2){
+ return __invoke(__f, __a0, __a1, __a2);
+ }
+#endif
};
template <>
struct __invoke_void_return_wrapper<void>
{
+#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class ..._Args>
- static void __call(_Args&&... __args)
- {
+ static void __call(_Args&&... __args) {
__invoke(_VSTD::forward<_Args>(__args)...);
}
+#else
+ template <class _Fn>
+ static void __call(_Fn __f) {
+ __invoke(__f);
+ }
+
+ template <class _Fn, class _A0>
+ static void __call(_Fn __f, _A0& __a0) {
+ __invoke(__f, __a0);
+ }
+
+ template <class _Fn, class _A0, class _A1>
+ static void __call(_Fn __f, _A0& __a0, _A1& __a1) {
+ __invoke(__f, __a0, __a1);
+ }
+
+ template <class _Fn, class _A0, class _A1, class _A2>
+ static void __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2) {
+ __invoke(__f, __a0, __a1, __a2);
+ }
+#endif
};
template <class _Tp>
@@ -463,14 +461,120 @@ public:
_LIBCPP_INLINE_VISIBILITY operator type& () const _NOEXCEPT {return *__f_;}
_LIBCPP_INLINE_VISIBILITY type& get() const _NOEXCEPT {return *__f_;}
+#ifndef _LIBCPP_HAS_NO_VARIADICS
// invoke
template <class... _ArgTypes>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_of<type&, _ArgTypes...>::type
- operator() (_ArgTypes&&... __args) const
- {
- return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);
- }
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_of<type&, _ArgTypes...>::type
+ operator() (_ArgTypes&&... __args) const {
+ return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);
+ }
+#else
+
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return<type>::type
+ operator() () const {
+ return __invoke(get());
+ }
+
+ template <class _A0>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return0<type, _A0>::type
+ operator() (_A0& __a0) const {
+ return __invoke(get(), __a0);
+ }
+
+ template <class _A0>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return0<type, _A0 const>::type
+ operator() (_A0 const& __a0) const {
+ return __invoke(get(), __a0);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0, _A1>::type
+ operator() (_A0& __a0, _A1& __a1) const {
+ return __invoke(get(), __a0, __a1);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0 const, _A1>::type
+ operator() (_A0 const& __a0, _A1& __a1) const {
+ return __invoke(get(), __a0, __a1);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0, _A1 const>::type
+ operator() (_A0& __a0, _A1 const& __a1) const {
+ return __invoke(get(), __a0, __a1);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0 const, _A1 const>::type
+ operator() (_A0 const& __a0, _A1 const& __a1) const {
+ return __invoke(get(), __a0, __a1);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1, _A2>::type
+ operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {
+ return __invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1, _A2>::type
+ operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {
+ return __invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1 const, _A2>::type
+ operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {
+ return __invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1, _A2 const>::type
+ operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {
+ return __invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type
+ operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const {
+ return __invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type
+ operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const {
+ return __invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type
+ operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const {
+ return __invoke(get(), __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type
+ operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {
+ return __invoke(get(), __a0, __a1, __a2);
+ }
+#endif // _LIBCPP_HAS_NO_VARIADICS
};
template <class _Tp> struct __is_reference_wrapper_impl : public false_type {};
@@ -510,6 +614,7 @@ cref(reference_wrapper<_Tp> __t) _NOEXCEPT
return cref(__t.get());
}
+#ifndef _LIBCPP_HAS_NO_VARIADICS
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
diff --git a/include/__functional_base_03 b/include/__functional_base_03
index 655027786665..8407dcfa39ca 100644
--- a/include/__functional_base_03
+++ b/include/__functional_base_03
@@ -13,943 +13,166 @@
// manual variadic expansion for <functional>
-// __weak_result_type
-
-template <class _Tp>
-struct __derives_from_unary_function
-{
-private:
- struct __two {char __lx; char __lxx;};
- static __two __test(...);
- template <class _Ap, class _Rp>
- static unary_function<_Ap, _Rp>
- __test(const volatile unary_function<_Ap, _Rp>*);
-public:
- static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;
- typedef decltype(__test((_Tp*)0)) type;
-};
-
-template <class _Tp>
-struct __derives_from_binary_function
-{
-private:
- struct __two {char __lx; char __lxx;};
- static __two __test(...);
- template <class _A1, class _A2, class _Rp>
- static binary_function<_A1, _A2, _Rp>
- __test(const volatile binary_function<_A1, _A2, _Rp>*);
-public:
- static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;
- typedef decltype(__test((_Tp*)0)) type;
-};
-
-template <class _Tp, bool = __derives_from_unary_function<_Tp>::value>
-struct __maybe_derive_from_unary_function // bool is true
- : public __derives_from_unary_function<_Tp>::type
-{
-};
-
-template <class _Tp>
-struct __maybe_derive_from_unary_function<_Tp, false>
-{
-};
-
-template <class _Tp, bool = __derives_from_binary_function<_Tp>::value>
-struct __maybe_derive_from_binary_function // bool is true
- : public __derives_from_binary_function<_Tp>::type
-{
-};
-
-template <class _Tp>
-struct __maybe_derive_from_binary_function<_Tp, false>
-{
-};
-
-template <class _Tp, bool = __has_result_type<_Tp>::value>
-struct __weak_result_type_imp // bool is true
- : public __maybe_derive_from_unary_function<_Tp>,
- public __maybe_derive_from_binary_function<_Tp>
-{
- typedef typename _Tp::result_type result_type;
-};
-
-template <class _Tp>
-struct __weak_result_type_imp<_Tp, false>
- : public __maybe_derive_from_unary_function<_Tp>,
- public __maybe_derive_from_binary_function<_Tp>
-{
-};
-
-template <class _Tp>
-struct __weak_result_type
- : public __weak_result_type_imp<typename remove_reference<_Tp>::type>
-{
-};
-
-// 0 argument case
-
-template <class _Rp>
-struct __weak_result_type<_Rp ()>
-{
- typedef _Rp result_type;
-};
-
-template <class _Rp>
-struct __weak_result_type<_Rp (&)()>
-{
- typedef _Rp result_type;
-};
-
-template <class _Rp>
-struct __weak_result_type<_Rp (*)()>
-{
- typedef _Rp result_type;
-};
-
-// 1 argument case
-
-template <class _Rp, class _A1>
-struct __weak_result_type<_Rp (_A1)>
- : public unary_function<_A1, _Rp>
-{
-};
-
-template <class _Rp, class _A1>
-struct __weak_result_type<_Rp (&)(_A1)>
- : public unary_function<_A1, _Rp>
-{
-};
-
-template <class _Rp, class _A1>
-struct __weak_result_type<_Rp (*)(_A1)>
- : public unary_function<_A1, _Rp>
-{
-};
-
-template <class _Rp, class _Cp>
-struct __weak_result_type<_Rp (_Cp::*)()>
- : public unary_function<_Cp*, _Rp>
-{
-};
-
-template <class _Rp, class _Cp>
-struct __weak_result_type<_Rp (_Cp::*)() const>
- : public unary_function<const _Cp*, _Rp>
-{
-};
-
-template <class _Rp, class _Cp>
-struct __weak_result_type<_Rp (_Cp::*)() volatile>
- : public unary_function<volatile _Cp*, _Rp>
-{
-};
-
-template <class _Rp, class _Cp>
-struct __weak_result_type<_Rp (_Cp::*)() const volatile>
- : public unary_function<const volatile _Cp*, _Rp>
-{
-};
-
-// 2 argument case
-
-template <class _Rp, class _A1, class _A2>
-struct __weak_result_type<_Rp (_A1, _A2)>
- : public binary_function<_A1, _A2, _Rp>
-{
-};
-
-template <class _Rp, class _A1, class _A2>
-struct __weak_result_type<_Rp (*)(_A1, _A2)>
- : public binary_function<_A1, _A2, _Rp>
-{
-};
-
-template <class _Rp, class _A1, class _A2>
-struct __weak_result_type<_Rp (&)(_A1, _A2)>
- : public binary_function<_A1, _A2, _Rp>
-{
-};
-
-template <class _Rp, class _Cp, class _A1>
-struct __weak_result_type<_Rp (_Cp::*)(_A1)>
- : public binary_function<_Cp*, _A1, _Rp>
-{
-};
-
-template <class _Rp, class _Cp, class _A1>
-struct __weak_result_type<_Rp (_Cp::*)(_A1) const>
- : public binary_function<const _Cp*, _A1, _Rp>
-{
-};
-
-template <class _Rp, class _Cp, class _A1>
-struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile>
- : public binary_function<volatile _Cp*, _A1, _Rp>
-{
-};
-
-template <class _Rp, class _Cp, class _A1>
-struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile>
- : public binary_function<const volatile _Cp*, _A1, _Rp>
-{
-};
+// __invoke
-// 3 or more arguments
+template <class _Ret, class _T1, bool _IsFunc, bool _IsBase>
+struct __enable_invoke_imp;
-template <class _Rp, class _A1, class _A2, class _A3>
-struct __weak_result_type<_Rp (_A1, _A2, _A3)>
-{
- typedef _Rp result_type;
+template <class _Ret, class _T1>
+struct __enable_invoke_imp<_Ret, _T1, true, true> {
+ typedef _Ret _Bullet1;
+ typedef _Bullet1 type;
};
-template <class _Rp, class _A1, class _A2, class _A3>
-struct __weak_result_type<_Rp (&)(_A1, _A2, _A3)>
-{
- typedef _Rp result_type;
+template <class _Ret, class _T1>
+struct __enable_invoke_imp<_Ret, _T1, true, false> {
+ typedef _Ret _Bullet2;
+ typedef _Bullet2 type;
};
-template <class _Rp, class _A1, class _A2, class _A3>
-struct __weak_result_type<_Rp (*)(_A1, _A2, _A3)>
-{
- typedef _Rp result_type;
+template <class _Ret, class _T1>
+struct __enable_invoke_imp<_Ret, _T1, false, true> {
+ typedef typename add_lvalue_reference<
+ typename __apply_cv<_T1, _Ret>::type
+ >::type _Bullet3;
+ typedef _Bullet3 type;
};
-template <class _Rp, class _Cp, class _A1, class _A2>
-struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2)>
-{
- typedef _Rp result_type;
+template <class _Ret, class _T1>
+struct __enable_invoke_imp<_Ret, _T1, false, false> {
+ typedef typename add_lvalue_reference<
+ typename __apply_cv<decltype(*_VSTD::declval<_T1>()), _Ret>::type
+ >::type _Bullet4;
+ typedef _Bullet4 type;
};
-template <class _Rp, class _Cp, class _A1, class _A2>
-struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2) const>
-{
- typedef _Rp result_type;
+template <class _Ret, class _T1>
+struct __enable_invoke_imp<_Ret, _T1*, false, false> {
+ typedef typename add_lvalue_reference<
+ typename __apply_cv<_T1, _Ret>::type
+ >::type _Bullet4;
+ typedef _Bullet4 type;
};
-template <class _Rp, class _Cp, class _A1, class _A2>
-struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2) volatile>
+template <class _Fn, class _T1,
+ class _Traits = __member_pointer_traits<_Fn>,
+ class _Ret = typename _Traits::_ReturnType,
+ class _Class = typename _Traits::_ClassType>
+struct __enable_invoke : __enable_invoke_imp<
+ _Ret, _T1,
+ is_member_function_pointer<_Fn>::value,
+ is_base_of<_Class, typename remove_reference<_T1>::type>::value>
{
- typedef _Rp result_type;
};
-// __invoke
-
-// __ref_return0
-//
-// template <class _Tp, bool _HasResultType>
-// struct ________ref_return0 // _HasResultType is true
-// {
-// typedef typename _Tp::result_type type;
-// };
-//
-// template <class _Tp>
-// struct ________ref_return0<_Tp, false>
-// {
-// typedef void type;
-// };
-//
-// template <class _Tp, bool _IsClass>
-// struct ____ref_return0 // _IsClass is true
-// : public ________ref_return0<_Tp, __has_result_type<typename remove_cv<_Tp>::type>::value>
-// {
-// };
-//
-// template <class _Tp, bool _HasResultType>
-// struct ______ref_return0 // _HasResultType is true
-// {
-// typedef typename __callable_type<_Tp>::result_type type;
-// };
-//
-// template <class _Tp>
-// struct ______ref_return0<_Tp, false> // pointer to member data
-// {
-// typedef void type;
-// };
-//
-// template <class _Tp>
-// struct ____ref_return0<_Tp, false>
-// : public ______ref_return0<typename remove_cv<_Tp>::type,
-// __has_result_type<__callable_type<typename remove_cv<_Tp>::type> >::value>
-// {
-// };
-//
-// template <class _Tp>
-// struct __ref_return0
-// : public ____ref_return0<typename remove_reference<_Tp>::type,
-// is_class<typename remove_reference<_Tp>::type>::value>
-// {
-// };
-//
-// __ref_return1
-//
-// template <class _Tp, bool _IsClass, class _A0>
-// struct ____ref_return1 // _IsClass is true
-// {
-// typedef typename result_of<_Tp(_A0)>::type type;
-// };
-//
-// template <class _Tp, bool _HasResultType, class _A0>
-// struct ______ref_return1 // _HasResultType is true
-// {
-// typedef typename __callable_type<_Tp>::result_type type;
-// };
-//
-// template <class _Tp, class _A0, bool>
-// struct __ref_return1_member_data1;
-//
-// template <class _Rp, class _Cp, class _A0>
-// struct __ref_return1_member_data1<_Rp _Cp::*, _A0, true>
-// {
-// typedef typename __apply_cv<_A0, _Rp>::type& type;
-// };
-//
-// template <class _Rp, class _Cp, class _A0>
-// struct __ref_return1_member_data1<_Rp _Cp::*, _A0, false>
-// {
-// static _A0 __a;
-// typedef typename __apply_cv<decltype(*__a), _Rp>::type& type;
-// };
-//
-// template <class _Tp, class _A0>
-// struct __ref_return1_member_data;
-//
-// template <class _Rp, class _Cp, class _A0>
-// struct __ref_return1_member_data<_Rp _Cp::*, _A0>
-// : public __ref_return1_member_data1<_Rp _Cp::*, _A0,
-// is_same<typename remove_cv<_Cp>::type,
-// typename remove_cv<typename remove_reference<_A0>::type>::type>::value>
-// {
-// };
-//
-// template <class _Tp, class _A0>
-// struct ______ref_return1<_Tp, false, _A0> // pointer to member data
-// : public __ref_return1_member_data<typename remove_cv<_Tp>::type, _A0>
-// {
-// };
-//
-// template <class _Tp, class _A0>
-// struct ____ref_return1<_Tp, false, _A0>
-// : public ______ref_return1<typename remove_cv<_Tp>::type,
-// __has_result_type<__callable_type<typename remove_cv<_Tp>::type> >::value, _A0>
-// {
-// };
-//
-// template <class _Tp, class _A0>
-// struct __ref_return1
-// : public ____ref_return1<typename remove_reference<_Tp>::type,
-// is_class<typename remove_reference<_Tp>::type>::value, _A0>
-// {
-// };
-//
-// __ref_return2
-//
-// template <class _Tp, bool _IsClass, class _A0, class _A1>
-// struct ____ref_return2 // _IsClass is true
-// {
-// typedef typename result_of<_Tp(_A0, _A1)>::type type;
-// };
-//
-// template <class _Tp, bool _HasResultType, class _A0, class _A1>
-// struct ______ref_return2 // _HasResultType is true
-// {
-// typedef typename __callable_type<_Tp>::result_type type;
-// };
-//
-// template <class _Tp>
-// struct ______ref_return2<_Tp, false, class _A0, class _A1> // pointer to member data
-// {
-// static_assert(sizeof(_Tp) == 0, "An attempt has been made to `call` a pointer"
-// " to member data with too many arguments.");
-// };
-//
-// template <class _Tp, class _A0, class _A1>
-// struct ____ref_return2<_Tp, false, _A0, _A1>
-// : public ______ref_return2<typename remove_cv<_Tp>::type,
-// __has_result_type<__callable_type<typename remove_cv<_Tp>::type> >::value, _A0, _A1>
-// {
-// };
-//
-// template <class _Tp, class _A0, class _A1>
-// struct __ref_return2
-// : public ____ref_return2<typename remove_reference<_Tp>::type,
-// is_class<typename remove_reference<_Tp>::type>::value, _A0, _A1>
-// {
-// };
-//
-// __ref_return3
-//
-// template <class _Tp, bool _IsClass, class _A0, class _A1, class _A2>
-// struct ____ref_return3 // _IsClass is true
-// {
-// typedef typename result_of<_Tp(_A0, _A1, _A2)>::type type;
-// };
-//
-// template <class _Tp, bool _HasResultType, class _A0, class _A1, class _A2>
-// struct ______ref_return3 // _HasResultType is true
-// {
-// typedef typename __callable_type<_Tp>::result_type type;
-// };
-//
-// template <class _Tp>
-// struct ______ref_return3<_Tp, false, class _A0, class _A1, class _A2> // pointer to member data
-// {
-// static_assert(sizeof(_Tp) == 0, "An attempt has been made to `call` a pointer"
-// " to member data with too many arguments.");
-// };
-//
-// template <class _Tp, class _A0, class _A1, class _A2>
-// struct ____ref_return3<_Tp, false, _A0, _A1, _A2>
-// : public ______ref_return3<typename remove_cv<_Tp>::type,
-// __has_result_type<__callable_type<typename remove_cv<_Tp>::type> >::value, _A0, _A1, _A2>
-// {
-// };
-//
-// template <class _Tp, class _A0, class _A1, class _A2>
-// struct __ref_return3
-// : public ____ref_return3<typename remove_reference<_Tp>::type,
-// is_class<typename remove_reference<_Tp>::type>::value, _A0, _A1, _A2>
-// {
-// };
+__nat __invoke(__any, ...);
// first bullet
-template <class _Rp, class _Tp, class _T1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(), _T1& __t1)
-{
- return (__t1.*__f)();
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0), _T1& __t1, _A0& __a0)
-{
- return (__t1.*__f)(__a0);
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1), _T1& __t1, _A0& __a0, _A1& __a1)
-{
- return (__t1.*__f)(__a0, __a1);
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2), _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2)
-{
- return (__t1.*__f)(__a0, __a1, __a2);
-}
-
-template <class _Rp, class _Tp, class _T1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)() const, _T1& __t1)
-{
- return (__t1.*__f)();
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0) const, _T1& __t1, _A0& __a0)
-{
- return (__t1.*__f)(__a0);
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1) const, _T1& __t1, _A0& __a0, _A1& __a1)
-{
- return (__t1.*__f)(__a0, __a1);
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2) const, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2)
-{
- return (__t1.*__f)(__a0, __a1, __a2);
-}
-
-template <class _Rp, class _Tp, class _T1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)() volatile, _T1& __t1)
-{
- return (__t1.*__f)();
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0) volatile, _T1& __t1, _A0& __a0)
-{
- return (__t1.*__f)(__a0);
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1) volatile, _T1& __t1, _A0& __a0, _A1& __a1)
-{
- return (__t1.*__f)(__a0, __a1);
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2) volatile, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2)
-{
- return (__t1.*__f)(__a0, __a1, __a2);
-}
-
-template <class _Rp, class _Tp, class _T1>
+template <class _Fn, class _T1>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)() const volatile, _T1& __t1)
-{
+typename __enable_invoke<_Fn, _T1>::_Bullet1
+__invoke(_Fn __f, _T1& __t1) {
return (__t1.*__f)();
}
-template <class _Rp, class _Tp, class _T1, class _A0>
+template <class _Fn, class _T1, class _A0>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0) const volatile, _T1& __t1, _A0& __a0)
-{
+typename __enable_invoke<_Fn, _T1>::_Bullet1
+__invoke(_Fn __f, _T1& __t1, _A0& __a0) {
return (__t1.*__f)(__a0);
}
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1>
+template <class _Fn, class _T1, class _A0, class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1) const volatile, _T1& __t1, _A0& __a0, _A1& __a1)
-{
+typename __enable_invoke<_Fn, _T1>::_Bullet1
+__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1) {
return (__t1.*__f)(__a0, __a1);
}
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2>
+template <class _Fn, class _T1, class _A0, class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2) const volatile, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2)
-{
+typename __enable_invoke<_Fn, _T1>::_Bullet1
+__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) {
return (__t1.*__f)(__a0, __a1, __a2);
}
-// second bullet
-
-template <class _Rp, class _Tp, class _T1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(), _T1 __t1)
-{
- return ((*__t1).*__f)();
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0), _T1 __t1, _A0& __a0)
-{
- return ((*__t1).*__f)(__a0);
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1), _T1 __t1, _A0& __a0, _A1& __a1)
-{
- return ((*__t1).*__f)(__a0, __a1);
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2), _T1 __t1, _A0& __a0, _A1& __a1, _A2& __a2)
-{
- return ((*__t1).*__f)(__a0, __a1, __a2);
-}
-
-template <class _Rp, class _Tp, class _T1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)() const, _T1 __t1)
-{
- return ((*__t1).*__f)();
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0) const, _T1 __t1, _A0& __a0)
-{
- return ((*__t1).*__f)(__a0);
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1) const, _T1 __t1, _A0& __a0, _A1& __a1)
-{
- return ((*__t1).*__f)(__a0, __a1);
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2) const, _T1 __t1, _A0& __a0, _A1& __a1, _A2& __a2)
-{
- return ((*__t1).*__f)(__a0, __a1, __a2);
-}
-
-template <class _Rp, class _Tp, class _T1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)() volatile, _T1 __t1)
-{
- return ((*__t1).*__f)();
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0) volatile, _T1 __t1, _A0& __a0)
-{
- return ((*__t1).*__f)(__a0);
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1) volatile, _T1 __t1, _A0& __a0, _A1& __a1)
-{
- return ((*__t1).*__f)(__a0, __a1);
-}
-
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2) volatile, _T1 __t1, _A0& __a0, _A1& __a1, _A2& __a2)
-{
- return ((*__t1).*__f)(__a0, __a1, __a2);
-}
-
-template <class _Rp, class _Tp, class _T1>
+template <class _Fn, class _T1>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)() const volatile, _T1 __t1)
-{
+typename __enable_invoke<_Fn, _T1>::_Bullet2
+__invoke(_Fn __f, _T1& __t1) {
return ((*__t1).*__f)();
}
-template <class _Rp, class _Tp, class _T1, class _A0>
+template <class _Fn, class _T1, class _A0>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0) const volatile, _T1 __t1, _A0& __a0)
-{
+typename __enable_invoke<_Fn, _T1>::_Bullet2
+__invoke(_Fn __f, _T1& __t1, _A0& __a0) {
return ((*__t1).*__f)(__a0);
}
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1>
+template <class _Fn, class _T1, class _A0, class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1) const volatile, _T1 __t1, _A0& __a0, _A1& __a1)
-{
+typename __enable_invoke<_Fn, _T1>::_Bullet2
+__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1) {
return ((*__t1).*__f)(__a0, __a1);
}
-template <class _Rp, class _Tp, class _T1, class _A0, class _A1, class _A2>
+template <class _Fn, class _T1, class _A0, class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- _Rp
->::type
-__invoke(_Rp (_Tp::*__f)(_A0, _A1, _A2) const volatile, _T1 __t1, _A0& __a0, _A1& __a1, _A2& __a2)
-{
+typename __enable_invoke<_Fn, _T1>::_Bullet2
+__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) {
return ((*__t1).*__f)(__a0, __a1, __a2);
}
-// third bullet
-
-template <class _Rp, class _Tp, class _T1>
+template <class _Fn, class _T1>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
- typename __apply_cv<_T1, _Rp>::type&
->::type
-__invoke(_Rp _Tp::* __f, _T1& __t1)
-{
+typename __enable_invoke<_Fn, _T1>::_Bullet3
+__invoke(_Fn __f, _T1& __t1) {
return __t1.*__f;
}
-template <class _Rp, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-__invoke(_Rp _Tp::*)
-{
-}
-
-// template <class _Dp, class _Rp, class _Tp, class _T1>
-// inline _LIBCPP_INLINE_VISIBILITY
-// typename enable_if
-// <
-// is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
-// typename __ref_return1<_Rp _Tp::*, _T1>::type
-// >::type
-// __invoke(_Rp _Tp::* __f, _T1& __t1)
-// {
-// return __t1.*__f;
-// }
-
-// forth bullet
-
-template <class _T1, class _Rp, bool>
-struct __4th_helper
-{
-};
-
-template <class _T1, class _Rp>
-struct __4th_helper<_T1, _Rp, true>
-{
- typedef typename __apply_cv<decltype(*_VSTD::declval<_T1>()), _Rp>::type type;
-};
-
-template <class _Rp, class _Tp, class _T1>
+template <class _Fn, class _T1>
inline _LIBCPP_INLINE_VISIBILITY
-typename __4th_helper<_T1, _Rp,
- !is_base_of<_Tp,
- typename remove_reference<_T1>::type
- >::value
- >::type&
-__invoke(_Rp _Tp::* __f, _T1& __t1)
-{
+typename __enable_invoke<_Fn, _T1>::_Bullet4
+__invoke(_Fn __f, _T1& __t1) {
return (*__t1).*__f;
}
-// template <class _Dp, class _Rp, class _Tp, class _T1>
-// inline _LIBCPP_INLINE_VISIBILITY
-// typename enable_if
-// <
-// !is_base_of<_Tp, typename remove_reference<_T1>::type>::value,
-// typename __ref_return1<_Rp _Tp::*, _T1>::type
-// >::type
-// __invoke(_Rp _Tp::* __f, _T1 __t1)
-// {
-// return (*__t1).*__f;
-// }
-
// fifth bullet
template <class _Fp>
inline _LIBCPP_INLINE_VISIBILITY
-decltype(declval<_Fp>()())
-__invoke(_Fp __f)
+decltype(_VSTD::declval<_Fp&>()())
+__invoke(_Fp& __f)
{
return __f();
}
template <class _Fp, class _A0>
inline _LIBCPP_INLINE_VISIBILITY
-decltype(declval<_Fp>()(declval<_A0&>()))
-__invoke(_Fp __f, _A0& __a0)
+decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>()))
+__invoke(_Fp& __f, _A0& __a0)
{
return __f(__a0);
}
template <class _Fp, class _A0, class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-decltype(declval<_Fp>()(declval<_A0&>(), declval<_A1&>()))
-__invoke(_Fp __f, _A0& __a0, _A1& __a1)
+decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>(), _VSTD::declval<_A1&>()))
+__invoke(_Fp& __f, _A0& __a0, _A1& __a1)
{
return __f(__a0, __a1);
}
template <class _Fp, class _A0, class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-decltype(declval<_Fp>()(declval<_A0&>(), declval<_A1&>(), declval<_A2&>()))
-__invoke(_Fp __f, _A0& __a0, _A1& __a1, _A2& __a2)
+decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>(), _VSTD::declval<_A1&>(), _VSTD::declval<_A2&>()))
+__invoke(_Fp& __f, _A0& __a0, _A1& __a1, _A2& __a2)
{
return __f(__a0, __a1, __a2);
}
-// template <class _Rp, class _Fp>
-// inline _LIBCPP_INLINE_VISIBILITY
-// _Rp
-// __invoke(_Fp& __f)
-// {
-// return __f();
-// }
-//
-// template <class _Rp, class _Fp, class _A0>
-// inline _LIBCPP_INLINE_VISIBILITY
-// typename enable_if
-// <
-// !is_member_pointer<_Fp>::value,
-// _Rp
-// >::type
-// __invoke(_Fp& __f, _A0& __a0)
-// {
-// return __f(__a0);
-// }
-//
-// template <class _Rp, class _Fp, class _A0, class _A1>
-// inline _LIBCPP_INLINE_VISIBILITY
-// _Rp
-// __invoke(_Fp& __f, _A0& __a0, _A1& __a1)
-// {
-// return __f(__a0, __a1);
-// }
-//
-// template <class _Rp, class _Fp, class _A0, class _A1, class _A2>
-// inline _LIBCPP_INLINE_VISIBILITY
-// _Rp
-// __invoke(_Fp& __f, _A0& __a0, _A1& __a1, _A2& __a2)
-// {
-// return __f(__a0, __a1, __a2);
-// }
-
-template <class _Tp>
-struct __has_type
-{
-private:
- struct __two {char __lx; char __lxx;};
- template <class _Up> static __two __test(...);
- template <class _Up> static char __test(typename _Up::type* = 0);
-public:
- static const bool value = sizeof(__test<_Tp>(0)) == 1;
-};
-
template <class _Fp, bool = __has_result_type<__weak_result_type<_Fp> >::value>
struct __invoke_return
{
@@ -959,186 +182,43 @@ struct __invoke_return
template <class _Fp>
struct __invoke_return<_Fp, false>
{
- typedef decltype(__invoke(_VSTD::declval<_Fp>())) type;
+ typedef decltype(__invoke(_VSTD::declval<_Fp&>())) type;
};
template <class _Tp, class _A0>
struct __invoke_return0
{
- typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>())) type;
+ typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>())) type;
};
template <class _Rp, class _Tp, class _A0>
struct __invoke_return0<_Rp _Tp::*, _A0>
{
- typedef typename __apply_cv<_A0, _Rp>::type& type;
-};
-
-template <class _Rp, class _Tp, class _A0>
-struct __invoke_return0<_Rp _Tp::*, _A0*>
-{
- typedef typename __apply_cv<_A0, _Rp>::type& type;
+ typedef typename __enable_invoke<_Rp _Tp::*, _A0>::type type;
};
template <class _Tp, class _A0, class _A1>
struct __invoke_return1
{
- typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>(),
- _VSTD::declval<_A1>())) type;
+ typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>(),
+ _VSTD::declval<_A1&>())) type;
};
-template <class _Tp, class _A0, class _A1, class _A2>
-struct __invoke_return2
-{
- typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_A0>(),
- _VSTD::declval<_A1>(),
- _VSTD::declval<_A2>())) type;
+template <class _Rp, class _Class, class _A0, class _A1>
+struct __invoke_return1<_Rp _Class::*, _A0, _A1> {
+ typedef typename __enable_invoke<_Rp _Class::*, _A0>::type type;
};
-template <class _Ret>
-struct __invoke_void_return_wrapper
+template <class _Tp, class _A0, class _A1, class _A2>
+struct __invoke_return2
{
- template <class _Fn>
- static _Ret __call(_Fn __f)
- {
- return __invoke(__f);
- }
-
- template <class _Fn, class _A0>
- static _Ret __call(_Fn __f, _A0& __a0)
- {
- return __invoke(__f, __a0);
- }
-
- template <class _Fn, class _A0, class _A1>
- static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1)
- {
- return __invoke(__f, __a0, __a1);
- }
-
- template <class _Fn, class _A0, class _A1, class _A2>
- static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2)
- {
- return __invoke(__f, __a0, __a1, __a2);
- }
+ typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>(),
+ _VSTD::declval<_A1&>(),
+ _VSTD::declval<_A2&>())) type;
};
-
-template <>
-struct __invoke_void_return_wrapper<void>
-{
- template <class _Fn>
- static void __call(_Fn __f)
- {
- __invoke(__f);
- }
-
- template <class _Fn, class _A0>
- static void __call(_Fn __f, _A0& __a0)
- {
- __invoke(__f, __a0);
- }
-
- template <class _Fn, class _A0, class _A1>
- static void __call(_Fn __f, _A0& __a0, _A1& __a1)
- {
- __invoke(__f, __a0, __a1);
- }
-
- template <class _Fn, class _A0, class _A1, class _A2>
- static void __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2)
- {
- __invoke(__f, __a0, __a1, __a2);
- }
+template <class _Ret, class _Class, class _A0, class _A1, class _A2>
+struct __invoke_return2<_Ret _Class::*, _A0, _A1, _A2> {
+ typedef typename __enable_invoke<_Ret _Class::*, _A0>::type type;
};
-
-template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY reference_wrapper
- : public __weak_result_type<_Tp>
-{
-public:
- // types
- typedef _Tp type;
-private:
- type* __f_;
-
-public:
- // construct/copy/destroy
- _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) : __f_(&__f) {}
-
- // access
- _LIBCPP_INLINE_VISIBILITY operator type& () const {return *__f_;}
- _LIBCPP_INLINE_VISIBILITY type& get() const {return *__f_;}
-
- // invoke
-
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return<type&>::type
- operator() () const
- {
- return __invoke(get());
- }
-
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return0<type&, _A0>::type
- operator() (_A0& __a0) const
- {
- return __invoke<type&, _A0>(get(), __a0);
- }
-
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return1<type&, _A0, _A1>::type
- operator() (_A0& __a0, _A1& __a1) const
- {
- return __invoke<type&, _A0, _A1>(get(), __a0, __a1);
- }
-
- template <class _A0, class _A1, class _A2>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return2<type&, _A0, _A1, _A2>::type
- operator() (_A0& __a0, _A1& __a1, _A2& __a2) const
- {
- return __invoke<type&, _A0, _A1, _A2>(get(), __a0, __a1, __a2);
- }
-};
-
-template <class _Tp> struct __is_reference_wrapper_impl : public false_type {};
-template <class _Tp> struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {};
-template <class _Tp> struct __is_reference_wrapper
- : public __is_reference_wrapper_impl<typename remove_cv<_Tp>::type> {};
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-reference_wrapper<_Tp>
-ref(_Tp& __t)
-{
- return reference_wrapper<_Tp>(__t);
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-reference_wrapper<_Tp>
-ref(reference_wrapper<_Tp> __t)
-{
- return ref(__t.get());
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-reference_wrapper<const _Tp>
-cref(const _Tp& __t)
-{
- return reference_wrapper<const _Tp>(__t);
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-reference_wrapper<const _Tp>
-cref(reference_wrapper<_Tp> __t)
-{
- return cref(__t.get());
-}
-
#endif // _LIBCPP_FUNCTIONAL_BASE_03
diff --git a/include/__hash_table b/include/__hash_table
index f3a20309df71..cfa763ab217a 100644
--- a/include/__hash_table
+++ b/include/__hash_table
@@ -836,6 +836,7 @@ public:
typedef __hash_local_iterator<__node_pointer> local_iterator;
typedef __hash_const_local_iterator<__node_pointer> const_local_iterator;
+ _LIBCPP_INLINE_VISIBILITY
__hash_table()
_NOEXCEPT_(
is_nothrow_default_constructible<__bucket_list>::value &&
@@ -843,6 +844,7 @@ public:
is_nothrow_default_constructible<__node_allocator>::value &&
is_nothrow_default_constructible<hasher>::value &&
is_nothrow_default_constructible<key_equal>::value);
+ _LIBCPP_INLINE_VISIBILITY
__hash_table(const hasher& __hf, const key_equal& __eql);
__hash_table(const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
@@ -863,6 +865,7 @@ public:
__hash_table& operator=(const __hash_table& __u);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
__hash_table& operator=(__hash_table&& __u)
_NOEXCEPT_(
__node_traits::propagate_on_container_move_assignment::value &&
@@ -934,9 +937,13 @@ public:
return __bucket_list_.get_deleter().size();
}
+ _LIBCPP_INLINE_VISIBILITY
iterator begin() _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
iterator end() _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
const_iterator begin() const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
const_iterator end() const _NOEXCEPT;
template <class _Key>
@@ -965,6 +972,7 @@ public:
__node_holder remove(const_iterator __p) _NOEXCEPT;
template <class _Key>
+ _LIBCPP_INLINE_VISIBILITY
size_type __count_unique(const _Key& __k) const;
template <class _Key>
size_type __count_multi(const _Key& __k) const;
@@ -984,15 +992,17 @@ public:
__equal_range_multi(const _Key& __k) const;
void swap(__hash_table& __u)
+#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(
__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value
-#if _LIBCPP_STD_VER <= 11
&& (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value
|| __is_nothrow_swappable<__pointer_allocator>::value)
&& (!__node_traits::propagate_on_container_swap::value
|| __is_nothrow_swappable<__node_allocator>::value)
-#endif
);
+#else
+ _NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value);
+#endif
_LIBCPP_INLINE_VISIBILITY
size_type max_bucket_count() const _NOEXCEPT
@@ -1128,11 +1138,12 @@ private:
};
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table()
_NOEXCEPT_(
is_nothrow_default_constructible<__bucket_list>::value &&
is_nothrow_default_constructible<__first_node>::value &&
+ is_nothrow_default_constructible<__node_allocator>::value &&
is_nothrow_default_constructible<hasher>::value &&
is_nothrow_default_constructible<key_equal>::value)
: __p2_(0),
@@ -1141,7 +1152,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table()
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const hasher& __hf,
const key_equal& __eql)
: __bucket_list_(nullptr, __bucket_list_deleter()),
@@ -1201,6 +1212,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
_NOEXCEPT_(
is_nothrow_move_constructible<__bucket_list>::value &&
is_nothrow_move_constructible<__first_node>::value &&
+ is_nothrow_move_constructible<__node_allocator>::value &&
is_nothrow_move_constructible<hasher>::value &&
is_nothrow_move_constructible<key_equal>::value)
: __bucket_list_(_VSTD::move(__u.__bucket_list_)),
@@ -1408,7 +1420,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__hash_table<_Tp, _Hash, _Equal, _Alloc>&
__hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(__hash_table&& __u)
_NOEXCEPT_(
@@ -1493,7 +1505,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first,
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() _NOEXCEPT
{
@@ -1505,7 +1517,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() _NOEXCEPT
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() _NOEXCEPT
{
@@ -1517,7 +1529,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::end() _NOEXCEPT
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const _NOEXCEPT
{
@@ -1529,7 +1541,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const _NOEXCEPT
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() const _NOEXCEPT
{
@@ -2106,7 +2118,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v
__h.get_deleter().__value_constructed = true;
__h->__hash_ = hash_function()(__h->__value_);
__h->__next_ = nullptr;
- return _VSTD::move(__h); // explicitly moved for C++03
+ return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -2122,7 +2134,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v
__h.get_deleter().__value_constructed = true;
__h->__hash_ = __hash;
__h->__next_ = nullptr;
- return _VSTD::move(__h); // explicitly moved for C++03
+ return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -2254,7 +2266,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _Key>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::size_type
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__count_unique(const _Key& __k) const
{
@@ -2351,15 +2363,17 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__equal_range_multi(
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_(
__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value
-#if _LIBCPP_STD_VER <= 11
&& (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value
|| __is_nothrow_swappable<__pointer_allocator>::value)
&& (!__node_traits::propagate_on_container_swap::value
|| __is_nothrow_swappable<__node_allocator>::value)
-#endif
)
+#else
+ _NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value)
+#endif
{
{
__node_pointer_pointer __npp = __bucket_list_.release();
diff --git a/include/__locale b/include/__locale
index 19895582cac8..7bc701dda6e3 100644
--- a/include/__locale
+++ b/include/__locale
@@ -37,6 +37,8 @@
#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \
|| defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
# include <xlocale.h>
+#elif defined(_LIBCPP_HAS_MUSL_LIBC)
+# include <support/musl/xlocale.h>
#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -329,7 +331,7 @@ locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
class _LIBCPP_TYPE_VIS ctype_base
{
public:
-#ifdef __GLIBC__
+#if defined(__GLIBC__)
typedef unsigned short mask;
static const mask space = _ISspace;
static const mask print = _ISprint;
@@ -359,7 +361,7 @@ public:
typedef __uint32_t mask;
# elif defined(__FreeBSD__)
typedef unsigned long mask;
-# elif defined(__EMSCRIPTEN__) || defined(__NetBSD__)
+# elif defined(__EMSCRIPTEN__) || defined(__NetBSD__)
typedef unsigned short mask;
# endif
static const mask space = _CTYPE_S;
diff --git a/include/__mutex_base b/include/__mutex_base
index d5ece7c1454c..b019b4760d18 100644
--- a/include/__mutex_base
+++ b/include/__mutex_base
@@ -14,7 +14,9 @@
#include <__config>
#include <chrono>
#include <system_error>
+#ifndef _LIBCPP_HAS_NO_THREADS
#include <pthread.h>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -306,6 +308,7 @@ public:
template <class _Rep, class _Period, class _Predicate>
bool
+ _LIBCPP_INLINE_VISIBILITY
wait_for(unique_lock<mutex>& __lk,
const chrono::duration<_Rep, _Period>& __d,
_Predicate __pred);
@@ -390,7 +393,7 @@ condition_variable::wait_for(unique_lock<mutex>& __lk,
}
template <class _Rep, class _Period, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
condition_variable::wait_for(unique_lock<mutex>& __lk,
const chrono::duration<_Rep, _Period>& __d,
diff --git a/include/__nullptr b/include/__nullptr
new file mode 100644
index 000000000000..95415a6325a3
--- /dev/null
+++ b/include/__nullptr
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+//===--------------------------- __nullptr --------------------------------===//
+//
+// The 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_NULLPTR
+#define _LIBCPP_NULLPTR
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#ifdef _LIBCPP_HAS_NO_NULLPTR
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct _LIBCPP_TYPE_VIS_ONLY nullptr_t
+{
+ void* __lx;
+
+ struct __nat {int __for_bool_;};
+
+ _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : __lx(0) {}
+ _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : __lx(0) {}
+
+ _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;}
+
+ template <class _Tp>
+ _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR
+ operator _Tp* () const {return 0;}
+
+ template <class _Tp, class _Up>
+ _LIBCPP_ALWAYS_INLINE
+ operator _Tp _Up::* () const {return 0;}
+
+ friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;}
+ friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;}
+ friend _LIBCPP_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);}
+
+#define nullptr _VSTD::__get_nullptr_t()
+
+_LIBCPP_END_NAMESPACE_STD
+
+#else // _LIBCPP_HAS_NO_NULLPTR
+
+namespace std
+{
+ typedef decltype(nullptr) nullptr_t;
+}
+
+#endif // _LIBCPP_HAS_NO_NULLPTR
+
+#endif // _LIBCPP_NULLPTR
diff --git a/include/__split_buffer b/include/__split_buffer
index 727b1b6b5674..79d1aa1d7c4a 100644
--- a/include/__split_buffer
+++ b/include/__split_buffer
@@ -56,9 +56,12 @@ public:
_LIBCPP_INLINE_VISIBILITY pointer& __end_cap() _NOEXCEPT {return __end_cap_.first();}
_LIBCPP_INLINE_VISIBILITY const pointer& __end_cap() const _NOEXCEPT {return __end_cap_.first();}
+ _LIBCPP_INLINE_VISIBILITY
__split_buffer()
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
+ _LIBCPP_INLINE_VISIBILITY
explicit __split_buffer(__alloc_rr& __a);
+ _LIBCPP_INLINE_VISIBILITY
explicit __split_buffer(const __alloc_rr& __a);
__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
~__split_buffer();
@@ -128,7 +131,9 @@ public:
_LIBCPP_INLINE_VISIBILITY void __destruct_at_begin(pointer __new_begin)
{__destruct_at_begin(__new_begin, is_trivially_destructible<value_type>());}
+ _LIBCPP_INLINE_VISIBILITY
void __destruct_at_begin(pointer __new_begin, false_type);
+ _LIBCPP_INLINE_VISIBILITY
void __destruct_at_begin(pointer __new_begin, true_type);
_LIBCPP_INLINE_VISIBILITY
@@ -266,7 +271,7 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _F
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
__split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type)
{
@@ -275,7 +280,7 @@ __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
__split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, true_type)
{
@@ -309,7 +314,7 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __sta
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__split_buffer<_Tp, _Allocator>::__split_buffer()
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
: __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr)
@@ -317,14 +322,14 @@ __split_buffer<_Tp, _Allocator>::__split_buffer()
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__split_buffer<_Tp, _Allocator>::__split_buffer(__alloc_rr& __a)
: __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
{
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__split_buffer<_Tp, _Allocator>::__split_buffer(const __alloc_rr& __a)
: __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
{
diff --git a/include/__std_stream b/include/__std_stream
index 5403adabc343..f867cd23bdd5 100644
--- a/include/__std_stream
+++ b/include/__std_stream
@@ -276,7 +276,6 @@ __stdoutbuf<_CharT>::overflow(int_type __c)
codecvt_base::result __r;
char_type* pbase = &__1buf;
char_type* pptr = pbase + 1;
- char_type* epptr = pptr;
do
{
const char_type* __e;
diff --git a/include/__tree b/include/__tree
index 574e74baf26b..6391609b3982 100644
--- a/include/__tree
+++ b/include/__tree
@@ -1118,8 +1118,8 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp)
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(const allocator_type& __a)
- : __pair1_(__node_allocator(__a)),
- __begin_node_(__node_pointer()),
+ : __begin_node_(__node_pointer()),
+ __pair1_(__node_allocator(__a)),
__pair3_(0)
{
__begin_node() = __end_node();
@@ -1128,8 +1128,8 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const allocator_type& __a)
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp,
const allocator_type& __a)
- : __pair1_(__node_allocator(__a)),
- __begin_node_(__node_pointer()),
+ : __begin_node_(__node_pointer()),
+ __pair1_(__node_allocator(__a)),
__pair3_(0, __comp)
{
__begin_node() = __end_node();
@@ -1843,7 +1843,7 @@ __tree<_Tp, _Compare, _Allocator>::__construct_node(const value_type& __v)
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
__node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
__h.get_deleter().__value_constructed = true;
- return _VSTD::move(__h); // explicitly moved for C++03
+ return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/include/__tuple b/include/__tuple
index 2837ce708f09..8c31759774de 100644
--- a/include/__tuple
+++ b/include/__tuple
@@ -86,6 +86,11 @@ template <size_t _Ip, class ..._Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, tuple<_Tp...> >::type&&
get(tuple<_Tp...>&&) _NOEXCEPT;
+
+template <size_t _Ip, class ..._Tp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+const typename tuple_element<_Ip, tuple<_Tp...> >::type&&
+get(const tuple<_Tp...>&&) _NOEXCEPT;
#endif
// pair specializations
@@ -109,6 +114,11 @@ template <size_t _Ip, class _T1, class _T2>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
get(pair<_T1, _T2>&&) _NOEXCEPT;
+
+template <size_t _Ip, class _T1, class _T2>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
+get(const pair<_T1, _T2>&&) _NOEXCEPT;
#endif
// array specializations
@@ -132,35 +142,15 @@ template <size_t _Ip, class _Tp, size_t _Size>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp&&
get(array<_Tp, _Size>&&) _NOEXCEPT;
+
+template <size_t _Ip, class _Tp, size_t _Size>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+const _Tp&&
+get(const array<_Tp, _Size>&&) _NOEXCEPT;
#endif
#if !defined(_LIBCPP_HAS_NO_VARIADICS)
-// __lazy_and
-
-template <bool _Last, class ..._Preds>
-struct __lazy_and_impl;
-
-template <class ..._Preds>
-struct __lazy_and_impl<false, _Preds...> : false_type {};
-
-template <>
-struct __lazy_and_impl<true> : true_type {};
-
-template <class _Pred>
-struct __lazy_and_impl<true, _Pred> : integral_constant<bool, _Pred::type::value> {};
-
-template <class _Hp, class ..._Tp>
-struct __lazy_and_impl<true, _Hp, _Tp...> : __lazy_and_impl<_Hp::type::value, _Tp...> {};
-
-template <class _P1, class ..._Pr>
-struct __lazy_and : __lazy_and_impl<_P1::type::value, _Pr...> {};
-
-// __lazy_not
-
-template <class _Pred>
-struct __lazy_not : integral_constant<bool, !_Pred::type::value> {};
-
// __make_tuple_indices
template <size_t...> struct __tuple_indices {};
diff --git a/include/algorithm b/include/algorithm
index 7b0c53e05a5a..9c051198930d 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -851,7 +851,7 @@ for_each(_InputIterator __first, _InputIterator __last, _Function __f)
{
for (; __first != __last; ++__first)
__f(*__first);
- return _VSTD::move(__f); // explicitly moved for (emulated) C++03
+ return _LIBCPP_EXPLICIT_MOVE(__f); // explicitly moved for (emulated) C++03
}
// find
@@ -2330,7 +2330,7 @@ __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirec
{
if (__first == --__last)
break;
- swap(*__first, *__last);
+ _VSTD::iter_swap(__first, __last);
++__first;
}
}
@@ -2342,7 +2342,7 @@ __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_ac
{
if (__first != __last)
for (; __first < --__last; ++__first)
- swap(*__first, *__last);
+ _VSTD::iter_swap(__first, __last);
}
template <class _BidirectionalIterator>
@@ -3037,7 +3037,7 @@ uniform_int_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p
if (_Rp == 0)
return static_cast<result_type>(_Eng(__g, _Dt)());
size_t __w = _Dt - __clz(_Rp) - 1;
- if ((_Rp & (_UIntType(~0) >> (_Dt - __w))) != 0)
+ if ((_Rp & (std::numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0)
++__w;
_Eng __e(__g, __w);
_UIntType __u;
diff --git a/include/array b/include/array
index 2e02a43ed524..8866eaf6b463 100644
--- a/include/array
+++ b/include/array
@@ -89,12 +89,13 @@ template <class T, size_t N >
void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y)));
template <class T> class tuple_size;
-template <int I, class T> class tuple_element;
+template <size_t I, class T> class tuple_element;
template <class T, size_t N> struct tuple_size<array<T, N>>;
-template <int I, class T, size_t N> struct tuple_element<I, array<T, N>>;
-template <int I, class T, size_t N> T& get(array<T, N>&) noexcept; // constexpr in C++14
-template <int I, class T, size_t N> const T& get(const array<T, N>&) noexcept; // constexpr in C++14
-template <int I, class T, size_t N> T&& get(array<T, N>&&) noexcept; // constexpr in C++14
+template <size_t I, class T, size_t N> struct tuple_element<I, array<T, N>>;
+template <size_t I, class T, size_t N> T& get(array<T, N>&) noexcept; // constexpr in C++14
+template <size_t I, class T, size_t N> const T& get(const array<T, N>&) noexcept; // constexpr in C++14
+template <size_t I, class T, size_t N> T&& get(array<T, N>&&) noexcept; // constexpr in C++14
+template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexcept; // constexpr in C++14
} // std
@@ -324,6 +325,15 @@ get(array<_Tp, _Size>&& __a) _NOEXCEPT
return _VSTD::move(__a.__elems_[_Ip]);
}
+template <size_t _Ip, class _Tp, size_t _Size>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+const _Tp&&
+get(const array<_Tp, _Size>&& __a) _NOEXCEPT
+{
+ static_assert(_Ip < _Size, "Index out of bounds in std::get<> (const std::array &&)");
+ return _VSTD::move(__a.__elems_[_Ip]);
+}
+
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/atomic b/include/atomic
index 97a998d33633..abec2a0b565a 100644
--- a/include/atomic
+++ b/include/atomic
@@ -535,25 +535,35 @@ void atomic_signal_fence(memory_order m) noexcept;
#ifdef _LIBCPP_HAS_NO_THREADS
#error <atomic> is not supported on this single threaded system
-#else // !_LIBCPP_HAS_NO_THREADS
+#endif
+#if !defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
+#error <atomic> is not implemented
+#endif
_LIBCPP_BEGIN_NAMESPACE_STD
-#if !__has_feature(cxx_atomic) && _GNUC_VER < 407
-#error <atomic> is not implemented
-#else
-
typedef enum memory_order
{
memory_order_relaxed, memory_order_consume, memory_order_acquire,
memory_order_release, memory_order_acq_rel, memory_order_seq_cst
} memory_order;
-#if _GNUC_VER >= 407
+#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
namespace __gcc_atomic {
template <typename _Tp>
struct __gcc_atomic_t {
- __gcc_atomic_t() _NOEXCEPT {}
+
+#if _GNUC_VER >= 501
+ static_assert(is_trivially_copyable<_Tp>::value,
+ "std::atomic<Tp> requires that 'Tp' be a trivially copyable type");
+#endif
+
+ _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+ __gcc_atomic_t() _NOEXCEPT = default;
+#else
+ __gcc_atomic_t() _NOEXCEPT : __a_value() {}
+#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
_LIBCPP_CONSTEXPR explicit __gcc_atomic_t(_Tp value) _NOEXCEPT
: __a_value(value) {}
_Tp __a_value;
@@ -574,7 +584,7 @@ struct __can_assign {
sizeof(__test_atomic_assignable<_Tp, _Td>(1)) == sizeof(char);
};
-static inline constexpr int __to_gcc_order(memory_order __order) {
+static inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_order __order) {
// Avoid switch statement to make this a constexpr.
return __order == memory_order_relaxed ? __ATOMIC_RELAXED:
(__order == memory_order_acquire ? __ATOMIC_ACQUIRE:
@@ -584,7 +594,7 @@ static inline constexpr int __to_gcc_order(memory_order __order) {
__ATOMIC_CONSUME))));
}
-static inline constexpr int __to_gcc_failure_order(memory_order __order) {
+static inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(memory_order __order) {
// Avoid switch statement to make this a constexpr.
return __order == memory_order_relaxed ? __ATOMIC_RELAXED:
(__order == memory_order_acquire ? __ATOMIC_ACQUIRE:
@@ -805,7 +815,7 @@ static inline _Tp __c11_atomic_fetch_xor(_Atomic(_Tp)* __a, _Tp __pattern,
return __atomic_fetch_xor(&__a->__a_value, __pattern,
__gcc_atomic::__to_gcc_order(__order));
}
-#endif // _GNUC_VER >= 407
+#endif // _LIBCPP_HAS_GCC_ATOMIC_IMP
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
@@ -825,7 +835,7 @@ struct __atomic_base // false
_LIBCPP_INLINE_VISIBILITY
bool is_lock_free() const volatile _NOEXCEPT
{
-#if __has_feature(cxx_atomic)
+#if defined(_LIBCPP_HAS_C_ATOMIC_IMP)
return __c11_atomic_is_lock_free(sizeof(_Tp));
#else
return __atomic_is_lock_free(sizeof(_Tp), 0);
@@ -1779,8 +1789,6 @@ typedef atomic<uintmax_t> atomic_uintmax_t;
#define ATOMIC_FLAG_INIT {false}
#define ATOMIC_VAR_INIT(__v) {__v}
-// lock-free property
-
#define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
#define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
#define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
@@ -1792,10 +1800,6 @@ typedef atomic<uintmax_t> atomic_uintmax_t;
#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
-#endif // !__has_feature(cxx_atomic)
-
_LIBCPP_END_NAMESPACE_STD
-#endif // !_LIBCPP_HAS_NO_THREADS
-
#endif // _LIBCPP_ATOMIC
diff --git a/include/bitset b/include/bitset
index 8c278cc724f1..87d7afca5a73 100644
--- a/include/bitset
+++ b/include/bitset
@@ -168,7 +168,9 @@ protected:
typedef __bit_iterator<__bitset, false> iterator;
typedef __bit_iterator<__bitset, true> const_iterator;
+ _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
@@ -180,8 +182,11 @@ protected:
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
{return const_iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
+ _LIBCPP_INLINE_VISIBILITY
void operator&=(const __bitset& __v) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
void operator|=(const __bitset& __v) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
void operator^=(const __bitset& __v) _NOEXCEPT;
void flip() _NOEXCEPT;
@@ -192,22 +197,27 @@ protected:
bool all() const _NOEXCEPT;
bool any() const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
size_t __hash_code() const _NOEXCEPT;
private:
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
void __init(unsigned long long __v, false_type) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
void __init(unsigned long long __v, true_type) _NOEXCEPT;
#endif // _LIBCPP_HAS_NO_CONSTEXPR
unsigned long to_ulong(false_type) const;
+ _LIBCPP_INLINE_VISIBILITY
unsigned long to_ulong(true_type) const;
unsigned long long to_ullong(false_type) const;
+ _LIBCPP_INLINE_VISIBILITY
unsigned long long to_ullong(true_type) const;
+ _LIBCPP_INLINE_VISIBILITY
unsigned long long to_ullong(true_type, false_type) const;
unsigned long long to_ullong(true_type, true_type) const;
};
template <size_t _N_words, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
__bitset<_N_words, _Size>::__bitset() _NOEXCEPT
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
@@ -245,7 +255,7 @@ __bitset<_N_words, _Size>::__init(unsigned long long __v, true_type) _NOEXCEPT
#endif // _LIBCPP_HAS_NO_CONSTEXPR
template <size_t _N_words, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
__bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
@@ -264,7 +274,7 @@ __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
}
template <size_t _N_words, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
__bitset<_N_words, _Size>::operator&=(const __bitset& __v) _NOEXCEPT
{
@@ -273,7 +283,7 @@ __bitset<_N_words, _Size>::operator&=(const __bitset& __v) _NOEXCEPT
}
template <size_t _N_words, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
__bitset<_N_words, _Size>::operator|=(const __bitset& __v) _NOEXCEPT
{
@@ -282,7 +292,7 @@ __bitset<_N_words, _Size>::operator|=(const __bitset& __v) _NOEXCEPT
}
template <size_t _N_words, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
__bitset<_N_words, _Size>::operator^=(const __bitset& __v) _NOEXCEPT
{
@@ -325,7 +335,7 @@ __bitset<_N_words, _Size>::to_ulong(false_type) const
}
template <size_t _N_words, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unsigned long
__bitset<_N_words, _Size>::to_ulong(true_type) const
{
@@ -348,7 +358,7 @@ __bitset<_N_words, _Size>::to_ullong(false_type) const
}
template <size_t _N_words, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unsigned long long
__bitset<_N_words, _Size>::to_ullong(true_type) const
{
@@ -356,7 +366,7 @@ __bitset<_N_words, _Size>::to_ullong(true_type) const
}
template <size_t _N_words, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unsigned long long
__bitset<_N_words, _Size>::to_ullong(true_type, false_type) const
{
@@ -414,7 +424,7 @@ __bitset<_N_words, _Size>::any() const _NOEXCEPT
}
template <size_t _N_words, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
size_t
__bitset<_N_words, _Size>::__hash_code() const _NOEXCEPT
{
@@ -450,7 +460,9 @@ protected:
typedef __bit_iterator<__bitset, false> iterator;
typedef __bit_iterator<__bitset, true> const_iterator;
+ _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
@@ -462,23 +474,32 @@ protected:
_LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
{return const_iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
+ _LIBCPP_INLINE_VISIBILITY
void operator&=(const __bitset& __v) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
void operator|=(const __bitset& __v) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
void operator^=(const __bitset& __v) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
void flip() _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
unsigned long to_ulong() const;
+ _LIBCPP_INLINE_VISIBILITY
unsigned long long to_ullong() const;
+ _LIBCPP_INLINE_VISIBILITY
bool all() const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
bool any() const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
size_t __hash_code() const _NOEXCEPT;
};
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
__bitset<1, _Size>::__bitset() _NOEXCEPT
: __first_(0)
@@ -486,7 +507,7 @@ __bitset<1, _Size>::__bitset() _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
__bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
: __first_(static_cast<__storage_type>(__v))
@@ -494,7 +515,7 @@ __bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
__bitset<1, _Size>::operator&=(const __bitset& __v) _NOEXCEPT
{
@@ -502,7 +523,7 @@ __bitset<1, _Size>::operator&=(const __bitset& __v) _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
__bitset<1, _Size>::operator|=(const __bitset& __v) _NOEXCEPT
{
@@ -510,7 +531,7 @@ __bitset<1, _Size>::operator|=(const __bitset& __v) _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
__bitset<1, _Size>::operator^=(const __bitset& __v) _NOEXCEPT
{
@@ -518,7 +539,7 @@ __bitset<1, _Size>::operator^=(const __bitset& __v) _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
__bitset<1, _Size>::flip() _NOEXCEPT
{
@@ -528,7 +549,7 @@ __bitset<1, _Size>::flip() _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unsigned long
__bitset<1, _Size>::to_ulong() const
{
@@ -536,7 +557,7 @@ __bitset<1, _Size>::to_ulong() const
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unsigned long long
__bitset<1, _Size>::to_ullong() const
{
@@ -544,7 +565,7 @@ __bitset<1, _Size>::to_ullong() const
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
__bitset<1, _Size>::all() const _NOEXCEPT
{
@@ -553,7 +574,7 @@ __bitset<1, _Size>::all() const _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
__bitset<1, _Size>::any() const _NOEXCEPT
{
@@ -562,7 +583,7 @@ __bitset<1, _Size>::any() const _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
size_t
__bitset<1, _Size>::__hash_code() const _NOEXCEPT
{
@@ -593,7 +614,9 @@ protected:
typedef __bit_iterator<__bitset, false> iterator;
typedef __bit_iterator<__bitset, true> const_iterator;
+ _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT
@@ -620,13 +643,13 @@ protected:
_LIBCPP_INLINE_VISIBILITY size_t __hash_code() const _NOEXCEPT {return 0;}
};
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
__bitset<0, 0>::__bitset() _NOEXCEPT
{
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
__bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT
{
@@ -663,16 +686,23 @@ public:
_CharT __zero = _CharT('0'), _CharT __one = _CharT('1'));
// 23.3.5.2 bitset operations:
+ _LIBCPP_INLINE_VISIBILITY
bitset& operator&=(const bitset& __rhs) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
bitset& operator|=(const bitset& __rhs) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
bitset& operator^=(const bitset& __rhs) _NOEXCEPT;
bitset& operator<<=(size_t __pos) _NOEXCEPT;
bitset& operator>>=(size_t __pos) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
bitset& set() _NOEXCEPT;
bitset& set(size_t __pos, bool __val = true);
+ _LIBCPP_INLINE_VISIBILITY
bitset& reset() _NOEXCEPT;
bitset& reset(size_t __pos);
+ _LIBCPP_INLINE_VISIBILITY
bitset operator~() const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
bitset& flip() _NOEXCEPT;
bitset& flip(size_t __pos);
@@ -680,28 +710,40 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
const_reference operator[](size_t __p) const {return base::__make_ref(__p);}
_LIBCPP_INLINE_VISIBILITY reference operator[](size_t __p) {return base::__make_ref(__p);}
+ _LIBCPP_INLINE_VISIBILITY
unsigned long to_ulong() const;
+ _LIBCPP_INLINE_VISIBILITY
unsigned long long to_ullong() const;
template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator> to_string(_CharT __zero = _CharT('0'),
_CharT __one = _CharT('1')) const;
template <class _CharT, class _Traits>
+ _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, allocator<_CharT> > to_string(_CharT __zero = _CharT('0'),
_CharT __one = _CharT('1')) const;
template <class _CharT>
+ _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > to_string(_CharT __zero = _CharT('0'),
_CharT __one = _CharT('1')) const;
+ _LIBCPP_INLINE_VISIBILITY
basic_string<char, char_traits<char>, allocator<char> > to_string(char __zero = '0',
char __one = '1') const;
+ _LIBCPP_INLINE_VISIBILITY
size_t count() const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR size_t size() const _NOEXCEPT {return _Size;}
+ _LIBCPP_INLINE_VISIBILITY
bool operator==(const bitset& __rhs) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
bool operator!=(const bitset& __rhs) const _NOEXCEPT;
bool test(size_t __pos) const;
+ _LIBCPP_INLINE_VISIBILITY
bool all() const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
bool any() const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY bool none() const _NOEXCEPT {return !any();}
+ _LIBCPP_INLINE_VISIBILITY
bitset operator<<(size_t __pos) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
bitset operator>>(size_t __pos) const _NOEXCEPT;
private:
@@ -774,7 +816,7 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bitset<_Size>&
bitset<_Size>::operator&=(const bitset& __rhs) _NOEXCEPT
{
@@ -783,7 +825,7 @@ bitset<_Size>::operator&=(const bitset& __rhs) _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bitset<_Size>&
bitset<_Size>::operator|=(const bitset& __rhs) _NOEXCEPT
{
@@ -792,7 +834,7 @@ bitset<_Size>::operator|=(const bitset& __rhs) _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bitset<_Size>&
bitset<_Size>::operator^=(const bitset& __rhs) _NOEXCEPT
{
@@ -821,7 +863,7 @@ bitset<_Size>::operator>>=(size_t __pos) _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bitset<_Size>&
bitset<_Size>::set() _NOEXCEPT
{
@@ -844,7 +886,7 @@ bitset<_Size>::set(size_t __pos, bool __val)
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bitset<_Size>&
bitset<_Size>::reset() _NOEXCEPT
{
@@ -867,7 +909,7 @@ bitset<_Size>::reset(size_t __pos)
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bitset<_Size>
bitset<_Size>::operator~() const _NOEXCEPT
{
@@ -877,7 +919,7 @@ bitset<_Size>::operator~() const _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bitset<_Size>&
bitset<_Size>::flip() _NOEXCEPT
{
@@ -901,7 +943,7 @@ bitset<_Size>::flip(size_t __pos)
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unsigned long
bitset<_Size>::to_ulong() const
{
@@ -909,7 +951,7 @@ bitset<_Size>::to_ulong() const
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unsigned long long
bitset<_Size>::to_ullong() const
{
@@ -932,7 +974,7 @@ bitset<_Size>::to_string(_CharT __zero, _CharT __one) const
template <size_t _Size>
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_string<_CharT, _Traits, allocator<_CharT> >
bitset<_Size>::to_string(_CharT __zero, _CharT __one) const
{
@@ -941,7 +983,7 @@ bitset<_Size>::to_string(_CharT __zero, _CharT __one) const
template <size_t _Size>
template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> >
bitset<_Size>::to_string(_CharT __zero, _CharT __one) const
{
@@ -949,7 +991,7 @@ bitset<_Size>::to_string(_CharT __zero, _CharT __one) const
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_string<char, char_traits<char>, allocator<char> >
bitset<_Size>::to_string(char __zero, char __one) const
{
@@ -957,7 +999,7 @@ bitset<_Size>::to_string(char __zero, char __one) const
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
size_t
bitset<_Size>::count() const _NOEXCEPT
{
@@ -965,7 +1007,7 @@ bitset<_Size>::count() const _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT
{
@@ -973,7 +1015,7 @@ bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
bitset<_Size>::operator!=(const bitset& __rhs) const _NOEXCEPT
{
@@ -994,7 +1036,7 @@ bitset<_Size>::test(size_t __pos) const
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
bitset<_Size>::all() const _NOEXCEPT
{
@@ -1002,7 +1044,7 @@ bitset<_Size>::all() const _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
bitset<_Size>::any() const _NOEXCEPT
{
@@ -1010,7 +1052,7 @@ bitset<_Size>::any() const _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bitset<_Size>
bitset<_Size>::operator<<(size_t __pos) const _NOEXCEPT
{
@@ -1020,7 +1062,7 @@ bitset<_Size>::operator<<(size_t __pos) const _NOEXCEPT
}
template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bitset<_Size>
bitset<_Size>::operator>>(size_t __pos) const _NOEXCEPT
{
diff --git a/include/cctype b/include/cctype
index 26c740f7382d..a68c2a06604d 100644
--- a/include/cctype
+++ b/include/cctype
@@ -37,10 +37,6 @@ int toupper(int c);
#include <__config>
#include <ctype.h>
-#if defined(_LIBCPP_MSVCRT)
-#include "support/win32/support.h"
-#include "support/win32/locale_win32.h"
-#endif // _LIBCPP_MSVCRT
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -48,117 +44,20 @@ int toupper(int c);
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifdef isalnum
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalnum(int __c) {return isalnum(__c);}
-#undef isalnum
-inline _LIBCPP_INLINE_VISIBILITY int isalnum(int __c) {return __libcpp_isalnum(__c);}
-#else // isalnum
using ::isalnum;
-#endif // isalnum
-
-#ifdef isalpha
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalpha(int __c) {return isalpha(__c);}
-#undef isalpha
-inline _LIBCPP_INLINE_VISIBILITY int isalpha(int __c) {return __libcpp_isalpha(__c);}
-#else // isalpha
using ::isalpha;
-#endif // isalpha
-
-#ifdef isblank
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isblank(int __c) {return isblank(__c);}
-#undef isblank
-inline _LIBCPP_INLINE_VISIBILITY int isblank(int __c) {return __libcpp_isblank(__c);}
-#else // isblank
using ::isblank;
-#endif // isblank
-
-#ifdef iscntrl
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iscntrl(int __c) {return iscntrl(__c);}
-#undef iscntrl
-inline _LIBCPP_INLINE_VISIBILITY int iscntrl(int __c) {return __libcpp_iscntrl(__c);}
-#else // iscntrl
using ::iscntrl;
-#endif // iscntrl
-
-#ifdef isdigit
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isdigit(int __c) {return isdigit(__c);}
-#undef isdigit
-inline _LIBCPP_INLINE_VISIBILITY int isdigit(int __c) {return __libcpp_isdigit(__c);}
-#else // isdigit
using ::isdigit;
-#endif // isdigit
-
-#ifdef isgraph
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isgraph(int __c) {return isgraph(__c);}
-#undef isgraph
-inline _LIBCPP_INLINE_VISIBILITY int isgraph(int __c) {return __libcpp_isgraph(__c);}
-#else // isgraph
using ::isgraph;
-#endif // isgraph
-
-#ifdef islower
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_islower(int __c) {return islower(__c);}
-#undef islower
-inline _LIBCPP_INLINE_VISIBILITY int islower(int __c) {return __libcpp_islower(__c);}
-#else // islower
using ::islower;
-#endif // islower
-
-#ifdef isprint
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isprint(int __c) {return isprint(__c);}
-#undef isprint
-inline _LIBCPP_INLINE_VISIBILITY int isprint(int __c) {return __libcpp_isprint(__c);}
-#else // isprint
using ::isprint;
-#endif // isprint
-
-#ifdef ispunct
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_ispunct(int __c) {return ispunct(__c);}
-#undef ispunct
-inline _LIBCPP_INLINE_VISIBILITY int ispunct(int __c) {return __libcpp_ispunct(__c);}
-#else // ispunct
using ::ispunct;
-#endif // ispunct
-
-#ifdef isspace
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isspace(int __c) {return isspace(__c);}
-#undef isspace
-inline _LIBCPP_INLINE_VISIBILITY int isspace(int __c) {return __libcpp_isspace(__c);}
-#else // isspace
using ::isspace;
-#endif // isspace
-
-#ifdef isupper
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isupper(int __c) {return isupper(__c);}
-#undef isupper
-inline _LIBCPP_INLINE_VISIBILITY int isupper(int __c) {return __libcpp_isupper(__c);}
-#else // isupper
using ::isupper;
-#endif // isupper
-
-#ifdef isxdigit
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isxdigit(int __c) {return isxdigit(__c);}
-#undef isxdigit
-inline _LIBCPP_INLINE_VISIBILITY int isxdigit(int __c) {return __libcpp_isxdigit(__c);}
-#else // isxdigit
using ::isxdigit;
-#endif // isxdigit
-
-#ifdef tolower
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_tolower(int __c) {return tolower(__c);}
-#undef tolower
-inline _LIBCPP_INLINE_VISIBILITY int tolower(int __c) {return __libcpp_tolower(__c);}
-#else // tolower
using ::tolower;
-#endif // tolower
-
-#ifdef toupper
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_toupper(int __c) {return toupper(__c);}
-#undef toupper
-inline _LIBCPP_INLINE_VISIBILITY int toupper(int __c) {return __libcpp_toupper(__c);}
-#else // toupper
using ::toupper;
-#endif // toupper
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/cerrno b/include/cerrno
index 9804e4e3dcfe..bab13b8aa861 100644
--- a/include/cerrno
+++ b/include/cerrno
@@ -30,364 +30,4 @@ Macros:
#pragma GCC system_header
#endif
-#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
-
-#ifdef ELAST
-
-const int __elast1 = ELAST+1;
-const int __elast2 = ELAST+2;
-
-#else
-
-const int __elast1 = 104;
-const int __elast2 = 105;
-
-#endif
-
-#ifdef ENOTRECOVERABLE
-
-#define EOWNERDEAD __elast1
-
-#ifdef ELAST
-#undef ELAST
-#define ELAST EOWNERDEAD
-#endif
-
-#elif defined(EOWNERDEAD)
-
-#define ENOTRECOVERABLE __elast1
-#ifdef ELAST
-#undef ELAST
-#define ELAST ENOTRECOVERABLE
-#endif
-
-#else // defined(EOWNERDEAD)
-
-#define EOWNERDEAD __elast1
-#define ENOTRECOVERABLE __elast2
-#ifdef ELAST
-#undef ELAST
-#define ELAST ENOTRECOVERABLE
-#endif
-
-#endif // defined(EOWNERDEAD)
-
-#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
-
-// supply errno values likely to be missing, particularly on Windows
-
-#ifndef EAFNOSUPPORT
-#define EAFNOSUPPORT 9901
-#endif
-
-#ifndef EADDRINUSE
-#define EADDRINUSE 9902
-#endif
-
-#ifndef EADDRNOTAVAIL
-#define EADDRNOTAVAIL 9903
-#endif
-
-#ifndef EISCONN
-#define EISCONN 9904
-#endif
-
-#ifndef EBADMSG
-#define EBADMSG 9905
-#endif
-
-#ifndef ECONNABORTED
-#define ECONNABORTED 9906
-#endif
-
-#ifndef EALREADY
-#define EALREADY 9907
-#endif
-
-#ifndef ECONNREFUSED
-#define ECONNREFUSED 9908
-#endif
-
-#ifndef ECONNRESET
-#define ECONNRESET 9909
-#endif
-
-#ifndef EDESTADDRREQ
-#define EDESTADDRREQ 9910
-#endif
-
-#ifndef EHOSTUNREACH
-#define EHOSTUNREACH 9911
-#endif
-
-#ifndef EIDRM
-#define EIDRM 9912
-#endif
-
-#ifndef EMSGSIZE
-#define EMSGSIZE 9913
-#endif
-
-#ifndef ENETDOWN
-#define ENETDOWN 9914
-#endif
-
-#ifndef ENETRESET
-#define ENETRESET 9915
-#endif
-
-#ifndef ENETUNREACH
-#define ENETUNREACH 9916
-#endif
-
-#ifndef ENOBUFS
-#define ENOBUFS 9917
-#endif
-
-#ifndef ENOLINK
-#define ENOLINK 9918
-#endif
-
-#ifndef ENODATA
-#define ENODATA 9919
-#endif
-
-#ifndef ENOMSG
-#define ENOMSG 9920
-#endif
-
-#ifndef ENOPROTOOPT
-#define ENOPROTOOPT 9921
-#endif
-
-#ifndef ENOSR
-#define ENOSR 9922
-#endif
-
-#ifndef ENOTSOCK
-#define ENOTSOCK 9923
-#endif
-
-#ifndef ENOSTR
-#define ENOSTR 9924
-#endif
-
-#ifndef ENOTCONN
-#define ENOTCONN 9925
-#endif
-
-#ifndef ENOTSUP
-#define ENOTSUP 9926
-#endif
-
-#ifndef ECANCELED
-#define ECANCELED 9927
-#endif
-
-#ifndef EINPROGRESS
-#define EINPROGRESS 9928
-#endif
-
-#ifndef EOPNOTSUPP
-#define EOPNOTSUPP 9929
-#endif
-
-#ifndef EWOULDBLOCK
-#define EWOULDBLOCK 9930
-#endif
-
-#ifndef EOWNERDEAD
-#define EOWNERDEAD 9931
-#endif
-
-#ifndef EPROTO
-#define EPROTO 9932
-#endif
-
-#ifndef EPROTONOSUPPORT
-#define EPROTONOSUPPORT 9933
-#endif
-
-#ifndef ENOTRECOVERABLE
-#define ENOTRECOVERABLE 9934
-#endif
-
-#ifndef ETIME
-#define ETIME 9935
-#endif
-
-#ifndef ETXTBSY
-#define ETXTBSY 9936
-#endif
-
-#ifndef ETIMEDOUT
-#define ETIMEDOUT 9938
-#endif
-
-#ifndef ELOOP
-#define ELOOP 9939
-#endif
-
-#ifndef EOVERFLOW
-#define EOVERFLOW 9940
-#endif
-
-#ifndef EPROTOTYPE
-#define EPROTOTYPE 9941
-#endif
-
-#ifndef ENOSYS
-#define ENOSYS 9942
-#endif
-
-#ifndef EINVAL
-#define EINVAL 9943
-#endif
-
-#ifndef ERANGE
-#define ERANGE 9944
-#endif
-
-#ifndef EILSEQ
-#define EILSEQ 9945
-#endif
-
-// Windows Mobile doesn't appear to define these:
-
-#ifndef E2BIG
-#define E2BIG 9946
-#endif
-
-#ifndef EDOM
-#define EDOM 9947
-#endif
-
-#ifndef EFAULT
-#define EFAULT 9948
-#endif
-
-#ifndef EBADF
-#define EBADF 9949
-#endif
-
-#ifndef EPIPE
-#define EPIPE 9950
-#endif
-
-#ifndef EXDEV
-#define EXDEV 9951
-#endif
-
-#ifndef EBUSY
-#define EBUSY 9952
-#endif
-
-#ifndef ENOTEMPTY
-#define ENOTEMPTY 9953
-#endif
-
-#ifndef ENOEXEC
-#define ENOEXEC 9954
-#endif
-
-#ifndef EEXIST
-#define EEXIST 9955
-#endif
-
-#ifndef EFBIG
-#define EFBIG 9956
-#endif
-
-#ifndef ENAMETOOLONG
-#define ENAMETOOLONG 9957
-#endif
-
-#ifndef ENOTTY
-#define ENOTTY 9958
-#endif
-
-#ifndef EINTR
-#define EINTR 9959
-#endif
-
-#ifndef ESPIPE
-#define ESPIPE 9960
-#endif
-
-#ifndef EIO
-#define EIO 9961
-#endif
-
-#ifndef EISDIR
-#define EISDIR 9962
-#endif
-
-#ifndef ECHILD
-#define ECHILD 9963
-#endif
-
-#ifndef ENOLCK
-#define ENOLCK 9964
-#endif
-
-#ifndef ENOSPC
-#define ENOSPC 9965
-#endif
-
-#ifndef ENXIO
-#define ENXIO 9966
-#endif
-
-#ifndef ENODEV
-#define ENODEV 9967
-#endif
-
-#ifndef ENOENT
-#define ENOENT 9968
-#endif
-
-#ifndef ESRCH
-#define ESRCH 9969
-#endif
-
-#ifndef ENOTDIR
-#define ENOTDIR 9970
-#endif
-
-#ifndef ENOMEM
-#define ENOMEM 9971
-#endif
-
-#ifndef EPERM
-#define EPERM 9972
-#endif
-
-#ifndef EACCES
-#define EACCES 9973
-#endif
-
-#ifndef EROFS
-#define EROFS 9974
-#endif
-
-#ifndef EDEADLK
-#define EDEADLK 9975
-#endif
-
-#ifndef EAGAIN
-#define EAGAIN 9976
-#endif
-
-#ifndef ENFILE
-#define ENFILE 9977
-#endif
-
-#ifndef EMFILE
-#define EMFILE 9978
-#endif
-
-#ifndef EMLINK
-#define EMLINK 9979
-#endif
-
#endif // _LIBCPP_CERRNO
diff --git a/include/cfenv b/include/cfenv
index dd7db37f8e48..4fc630419bde 100644
--- a/include/cfenv
+++ b/include/cfenv
@@ -1,5 +1,5 @@
// -*- C++ -*-
-//===---------------------------- cctype ----------------------------------===//
+//===---------------------------- cfenv -----------------------------------===//
//
// The LLVM Compiler Infrastructure
//
diff --git a/include/cfloat b/include/cfloat
index 5fa56550fa6a..176fa9de3cec 100644
--- a/include/cfloat
+++ b/include/cfloat
@@ -67,12 +67,4 @@ Macros:
#pragma GCC system_header
#endif
-#ifndef FLT_EVAL_METHOD
-#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
-#endif
-
-#ifndef DECIMAL_DIG
-#define DECIMAL_DIG __DECIMAL_DIG__
-#endif
-
#endif // _LIBCPP_CFLOAT
diff --git a/include/chrono b/include/chrono
index 9229234ce55a..68484e982432 100644
--- a/include/chrono
+++ b/include/chrono
@@ -26,6 +26,9 @@ duration_cast(const duration<Rep, Period>& fd);
template <class Rep> struct treat_as_floating_point : is_floating_point<Rep> {};
+template <class Rep> constexpr bool treat_as_floating_point_v
+ = treat_as_floating_point<Rep>::value; // C++17
+
template <class Rep>
struct duration_values
{
@@ -194,6 +197,13 @@ template <class Rep1, class Period1, class Rep2, class Period2>
template <class ToDuration, class Rep, class Period>
ToDuration duration_cast(const duration<Rep, Period>& d);
+template <class ToDuration, class Rep, class Period>
+ constexpr ToDuration floor(const duration<Rep, Period>& d); // C++17
+template <class ToDuration, class Rep, class Period>
+ constexpr ToDuration ceil(const duration<Rep, Period>& d); // C++17
+template <class ToDuration, class Rep, class Period>
+ constexpr ToDuration round(const duration<Rep, Period>& d); // C++17
+
// time_point arithmetic (all constexpr in C++14)
template <class Clock, class Duration1, class Rep2, class Period2>
time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type>
@@ -227,6 +237,20 @@ template <class Clock, class Duration1, class Duration2>
template <class ToDuration, class Clock, class Duration>
time_point<Clock, ToDuration> time_point_cast(const time_point<Clock, Duration>& t);
+template <class ToDuration, class Clock, class Duration>
+ constexpr time_point<Clock, ToDuration>
+ floor(const time_point<Clock, Duration>& tp); // C++17
+
+template <class ToDuration, class Clock, class Duration>
+ constexpr time_point<Clock, ToDuration>
+ ceil(const time_point<Clock, Duration>& tp); // C++17
+
+template <class ToDuration, class Clock, class Duration>
+ constexpr time_point<Clock, ToDuration>
+ round(const time_point<Clock, Duration>& tp); // C++17
+
+template <class Rep, class Period>
+ constexpr duration<Rep, Period> abs(duration<Rep, Period> d); // C++17
// Clocks
class system_clock
@@ -392,6 +416,11 @@ duration_cast(const duration<_Rep, _Period>& __fd)
template <class _Rep>
struct _LIBCPP_TYPE_VIS_ONLY treat_as_floating_point : is_floating_point<_Rep> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Rep> _LIBCPP_CONSTEXPR bool treat_as_floating_point_v
+ = treat_as_floating_point<_Rep>::value;
+#endif
+
template <class _Rep>
struct _LIBCPP_TYPE_VIS_ONLY duration_values
{
@@ -401,6 +430,58 @@ public:
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep min() {return numeric_limits<_Rep>::lowest();}
};
+#if _LIBCPP_STD_VER > 14
+template <class _ToDuration, class _Rep, class _Period>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+typename enable_if
+<
+ __is_duration<_ToDuration>::value,
+ _ToDuration
+>::type
+floor(const duration<_Rep, _Period>& __d)
+{
+ _ToDuration __t = duration_cast<_ToDuration>(__d);
+ if (__t > __d)
+ __t = __t - _ToDuration{1};
+ return __t;
+}
+
+template <class _ToDuration, class _Rep, class _Period>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+typename enable_if
+<
+ __is_duration<_ToDuration>::value,
+ _ToDuration
+>::type
+ceil(const duration<_Rep, _Period>& __d)
+{
+ _ToDuration __t = duration_cast<_ToDuration>(__d);
+ if (__t < __d)
+ __t = __t + _ToDuration{1};
+ return __t;
+}
+
+template <class _ToDuration, class _Rep, class _Period>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+typename enable_if
+<
+ __is_duration<_ToDuration>::value,
+ _ToDuration
+>::type
+round(const duration<_Rep, _Period>& __d)
+{
+ _ToDuration __lower = floor<_ToDuration>(__d);
+ _ToDuration __upper = __lower + _ToDuration{1};
+ auto __lowerDiff = __d - __lower;
+ auto __upperDiff = __upper - __d;
+ if (__lowerDiff < __upperDiff)
+ return __lower;
+ if (__lowerDiff > __upperDiff)
+ return __upper;
+ return __lower.count() & 1 ? __upper : __lower;
+}
+#endif
+
// duration
template <class _Rep, class _Period>
@@ -807,6 +888,56 @@ time_point_cast(const time_point<_Clock, _Duration>& __t)
return time_point<_Clock, _ToDuration>(_VSTD::chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
}
+#if _LIBCPP_STD_VER > 14
+template <class _ToDuration, class _Clock, class _Duration>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+typename enable_if
+<
+ __is_duration<_ToDuration>::value,
+ time_point<_Clock, _ToDuration>
+>::type
+floor(const time_point<_Clock, _Duration>& __t)
+{
+ return time_point<_Clock, _ToDuration>{floor<_ToDuration>(__t.time_since_epoch())};
+}
+
+template <class _ToDuration, class _Clock, class _Duration>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+typename enable_if
+<
+ __is_duration<_ToDuration>::value,
+ time_point<_Clock, _ToDuration>
+>::type
+ceil(const time_point<_Clock, _Duration>& __t)
+{
+ return time_point<_Clock, _ToDuration>{ceil<_ToDuration>(__t.time_since_epoch())};
+}
+
+template <class _ToDuration, class _Clock, class _Duration>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+typename enable_if
+<
+ __is_duration<_ToDuration>::value,
+ time_point<_Clock, _ToDuration>
+>::type
+round(const time_point<_Clock, _Duration>& __t)
+{
+ return time_point<_Clock, _ToDuration>{round<_ToDuration>(__t.time_since_epoch())};
+}
+
+template <class _Rep, class _Period>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+typename enable_if
+<
+ numeric_limits<_Rep>::is_signed,
+ duration<_Rep, _Period>
+>::type
+abs(duration<_Rep, _Period> __d)
+{
+ return __d >= __d.zero() ? __d : -__d;
+}
+#endif
+
// time_point ==
template <class _Clock, class _Duration1, class _Duration2>
diff --git a/include/cinttypes b/include/cinttypes
index cfd763c98f4a..3f61b0634b17 100644
--- a/include/cinttypes
+++ b/include/cinttypes
@@ -246,10 +246,7 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
_LIBCPP_BEGIN_NAMESPACE_STD
using::imaxdiv_t;
-
-#undef imaxabs
using::imaxabs;
-#undef imaxdiv
using::imaxdiv;
using::strtoimax;
using::strtoumax;
diff --git a/include/cmath b/include/cmath
index 5f9aaedd5afa..ebbde18168ff 100644
--- a/include/cmath
+++ b/include/cmath
@@ -299,340 +299,11 @@ long double truncl(long double x);
#include <__config>
#include <math.h>
-#include <type_traits>
-
-#ifdef _LIBCPP_MSVCRT
-#include "support/win32/math_win32.h"
-#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
-// signbit
-
-#ifdef signbit
-
-template <class _A1>
-_LIBCPP_ALWAYS_INLINE
-bool
-__libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT
-{
- return signbit(__lcpp_x);
-}
-
-#undef signbit
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
-signbit(_A1 __lcpp_x) _NOEXCEPT
-{
- return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x);
-}
-
-#endif // signbit
-
-// fpclassify
-
-#ifdef fpclassify
-
-template <class _A1>
-_LIBCPP_ALWAYS_INLINE
-int
-__libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT
-{
- return fpclassify(__lcpp_x);
-}
-
-#undef fpclassify
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, int>::type
-fpclassify(_A1 __lcpp_x) _NOEXCEPT
-{
- return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x);
-}
-
-#endif // fpclassify
-
-// isfinite
-
-#ifdef isfinite
-
-template <class _A1>
-_LIBCPP_ALWAYS_INLINE
-bool
-__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
-{
- return isfinite(__lcpp_x);
-}
-
-#undef isfinite
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
-isfinite(_A1 __lcpp_x) _NOEXCEPT
-{
- return __libcpp_isfinite((typename std::__promote<_A1>::type)__lcpp_x);
-}
-
-#endif // isfinite
-
-// isinf
-
-#ifdef isinf
-
-template <class _A1>
-_LIBCPP_ALWAYS_INLINE
-bool
-__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
-{
- return isinf(__lcpp_x);
-}
-
-#undef isinf
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
-isinf(_A1 __lcpp_x) _NOEXCEPT
-{
- return __libcpp_isinf((typename std::__promote<_A1>::type)__lcpp_x);
-}
-
-#endif // isinf
-
-// isnan
-
-#ifdef isnan
-
-template <class _A1>
-_LIBCPP_ALWAYS_INLINE
-bool
-__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
-{
- return isnan(__lcpp_x);
-}
-
-#undef isnan
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
-isnan(_A1 __lcpp_x) _NOEXCEPT
-{
- return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x);
-}
-
-#endif // isnan
-
-// isnormal
-
-#ifdef isnormal
-
-template <class _A1>
-_LIBCPP_ALWAYS_INLINE
-bool
-__libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT
-{
- return isnormal(__lcpp_x);
-}
-
-#undef isnormal
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
-isnormal(_A1 __lcpp_x) _NOEXCEPT
-{
- return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x);
-}
-
-#endif // isnormal
-
-// isgreater
-
-#ifdef isgreater
-
-template <class _A1, class _A2>
-_LIBCPP_ALWAYS_INLINE
-bool
-__libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- return isgreater(__lcpp_x, __lcpp_y);
-}
-
-#undef isgreater
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if
-<
- std::is_arithmetic<_A1>::value &&
- std::is_arithmetic<_A2>::value,
- bool
->::type
-isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename std::__promote<_A1, _A2>::type type;
- return __libcpp_isgreater((type)__lcpp_x, (type)__lcpp_y);
-}
-
-#endif // isgreater
-
-// isgreaterequal
-
-#ifdef isgreaterequal
-
-template <class _A1, class _A2>
-_LIBCPP_ALWAYS_INLINE
-bool
-__libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- return isgreaterequal(__lcpp_x, __lcpp_y);
-}
-
-#undef isgreaterequal
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if
-<
- std::is_arithmetic<_A1>::value &&
- std::is_arithmetic<_A2>::value,
- bool
->::type
-isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename std::__promote<_A1, _A2>::type type;
- return __libcpp_isgreaterequal((type)__lcpp_x, (type)__lcpp_y);
-}
-
-#endif // isgreaterequal
-
-// isless
-
-#ifdef isless
-
-template <class _A1, class _A2>
-_LIBCPP_ALWAYS_INLINE
-bool
-__libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- return isless(__lcpp_x, __lcpp_y);
-}
-
-#undef isless
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if
-<
- std::is_arithmetic<_A1>::value &&
- std::is_arithmetic<_A2>::value,
- bool
->::type
-isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename std::__promote<_A1, _A2>::type type;
- return __libcpp_isless((type)__lcpp_x, (type)__lcpp_y);
-}
-
-#endif // isless
-
-// islessequal
-
-#ifdef islessequal
-
-template <class _A1, class _A2>
-_LIBCPP_ALWAYS_INLINE
-bool
-__libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- return islessequal(__lcpp_x, __lcpp_y);
-}
-
-#undef islessequal
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if
-<
- std::is_arithmetic<_A1>::value &&
- std::is_arithmetic<_A2>::value,
- bool
->::type
-islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename std::__promote<_A1, _A2>::type type;
- return __libcpp_islessequal((type)__lcpp_x, (type)__lcpp_y);
-}
-
-#endif // islessequal
-
-// islessgreater
-
-#ifdef islessgreater
-
-template <class _A1, class _A2>
-_LIBCPP_ALWAYS_INLINE
-bool
-__libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- return islessgreater(__lcpp_x, __lcpp_y);
-}
-
-#undef islessgreater
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if
-<
- std::is_arithmetic<_A1>::value &&
- std::is_arithmetic<_A2>::value,
- bool
->::type
-islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename std::__promote<_A1, _A2>::type type;
- return __libcpp_islessgreater((type)__lcpp_x, (type)__lcpp_y);
-}
-
-#endif // islessgreater
-
-// isunordered
-
-#ifdef isunordered
-
-template <class _A1, class _A2>
-_LIBCPP_ALWAYS_INLINE
-bool
-__libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- return isunordered(__lcpp_x, __lcpp_y);
-}
-
-#undef isunordered
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if
-<
- std::is_arithmetic<_A1>::value &&
- std::is_arithmetic<_A2>::value,
- bool
->::type
-isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename std::__promote<_A1, _A2>::type type;
- return __libcpp_isunordered((type)__lcpp_x, (type)__lcpp_y);
-}
-
-#endif // isunordered
-
_LIBCPP_BEGIN_NAMESPACE_STD
using ::signbit;
@@ -652,794 +323,130 @@ using ::isunordered;
using ::float_t;
using ::double_t;
-// abs
-
-#if defined(__sun__)
+#ifndef _AIX
using ::abs;
#endif
-#if !defined(_AIX) && !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY
-float
-abs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);}
-
-inline _LIBCPP_INLINE_VISIBILITY
-double
-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)
-
#ifndef __sun__
-
-// acos
-
using ::acos;
using ::acosf;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-acos(_A1 __lcpp_x) _NOEXCEPT {return acos((double)__lcpp_x);}
-
-// asin
-
using ::asin;
using ::asinf;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-asin(_A1 __lcpp_x) _NOEXCEPT {return asin((double)__lcpp_x);}
-
-// atan
-
using ::atan;
using ::atanf;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-atan(_A1 __lcpp_x) _NOEXCEPT {return atan((double)__lcpp_x);}
-
-// atan2
-
using ::atan2;
using ::atan2f;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __lazy_enable_if
-<
- is_arithmetic<_A1>::value &&
- is_arithmetic<_A2>::value,
- __promote<_A1, _A2>
->::type
-atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT
-{
- typedef typename __promote<_A1, _A2>::type __result_type;
- static_assert((!(is_same<_A1, __result_type>::value &&
- is_same<_A2, __result_type>::value)), "");
- return atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x);
-}
-
-// ceil
-
using ::ceil;
using ::ceilf;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-ceil(_A1 __lcpp_x) _NOEXCEPT {return ceil((double)__lcpp_x);}
-
-// cos
-
using ::cos;
using ::cosf;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-cos(_A1 __lcpp_x) _NOEXCEPT {return cos((double)__lcpp_x);}
-
-// cosh
-
using ::cosh;
using ::coshf;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-cosh(_A1 __lcpp_x) _NOEXCEPT {return cosh((double)__lcpp_x);}
-
#endif // __sun__
-// exp
using ::exp;
using ::expf;
#ifndef __sun__
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-exp(_A1 __lcpp_x) _NOEXCEPT {return exp((double)__lcpp_x);}
-
-// fabs
-
using ::fabs;
using ::fabsf;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-fabs(_A1 __lcpp_x) _NOEXCEPT {return fabs((double)__lcpp_x);}
-
-// floor
-
using ::floor;
using ::floorf;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-floor(_A1 __lcpp_x) _NOEXCEPT {return floor((double)__lcpp_x);}
-
-// fmod
-
#endif //__sun__
+
using ::fmod;
using ::fmodf;
-#ifndef __sun__
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __lazy_enable_if
-<
- is_arithmetic<_A1>::value &&
- is_arithmetic<_A2>::value,
- __promote<_A1, _A2>
->::type
-fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename __promote<_A1, _A2>::type __result_type;
- static_assert((!(is_same<_A1, __result_type>::value &&
- is_same<_A2, __result_type>::value)), "");
- return fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y);
-}
-
-
-// frexp
+#ifndef __sun__
using ::frexp;
using ::frexpf;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-frexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexp((double)__lcpp_x, __lcpp_e);}
-
-// ldexp
-
using ::ldexp;
using ::ldexpf;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-ldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexp((double)__lcpp_x, __lcpp_e);}
-
-// log
-
#endif // __sun__
+
using ::log;
using ::logf;
-#ifndef __sun__
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-log(_A1 __lcpp_x) _NOEXCEPT {return log((double)__lcpp_x);}
-
-
-// log10
+#ifndef __sun__
using ::log10;
using ::log10f;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-log10(_A1 __lcpp_x) _NOEXCEPT {return log10((double)__lcpp_x);}
-
-// modf
-
using ::modf;
using ::modff;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
#endif // __sun__
+
using ::pow;
using ::powf;
#ifndef __sun__
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __lazy_enable_if
-<
- is_arithmetic<_A1>::value &&
- is_arithmetic<_A2>::value,
- __promote<_A1, _A2>
->::type
-pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename __promote<_A1, _A2>::type __result_type;
- static_assert((!(is_same<_A1, __result_type>::value &&
- is_same<_A2, __result_type>::value)), "");
- return pow((__result_type)__lcpp_x, (__result_type)__lcpp_y);
-}
-
-// sin
-
using ::sin;
using ::sinf;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-sin(_A1 __lcpp_x) _NOEXCEPT {return sin((double)__lcpp_x);}
-
-// sinh
-
using ::sinh;
using ::sinhf;
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-sinh(_A1 __lcpp_x) _NOEXCEPT {return sinh((double)__lcpp_x);}
-
-// sqrt
-
#endif // __sun__
+
using ::sqrt;
using ::sqrtf;
-
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(__sun__) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-sqrt(_A1 __lcpp_x) _NOEXCEPT {return sqrt((double)__lcpp_x);}
-
-// tan
-
using ::tan;
using ::tanf;
-#ifndef __sun__
-
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-tan(_A1 __lcpp_x) _NOEXCEPT {return tan((double)__lcpp_x);}
-
-// tanh
+#ifndef __sun__
using ::tanh;
using ::tanhf;
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-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
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-tanh(_A1 __lcpp_x) _NOEXCEPT {return tanh((double)__lcpp_x);}
-
-// acosh
-
#ifndef _LIBCPP_MSVCRT
using ::acosh;
using ::acoshf;
-
-inline _LIBCPP_INLINE_VISIBILITY float acosh(float __lcpp_x) _NOEXCEPT {return acoshf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return acoshl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-acosh(_A1 __lcpp_x) _NOEXCEPT {return acosh((double)__lcpp_x);}
-#endif
-
-// asinh
-
-#ifndef _LIBCPP_MSVCRT
using ::asinh;
using ::asinhf;
-
-inline _LIBCPP_INLINE_VISIBILITY float asinh(float __lcpp_x) _NOEXCEPT {return asinhf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return asinhl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-asinh(_A1 __lcpp_x) _NOEXCEPT {return asinh((double)__lcpp_x);}
-#endif
-
-// atanh
-
-#ifndef _LIBCPP_MSVCRT
using ::atanh;
using ::atanhf;
-
-inline _LIBCPP_INLINE_VISIBILITY float atanh(float __lcpp_x) _NOEXCEPT {return atanhf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return atanhl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-atanh(_A1 __lcpp_x) _NOEXCEPT {return atanh((double)__lcpp_x);}
-#endif
-
-// cbrt
-
-#ifndef _LIBCPP_MSVCRT
using ::cbrt;
using ::cbrtf;
-
-inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __lcpp_x) _NOEXCEPT {return cbrtf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return cbrtl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-cbrt(_A1 __lcpp_x) _NOEXCEPT {return cbrt((double)__lcpp_x);}
#endif
-// copysign
-
using ::copysign;
using ::copysignf;
-#if !defined(_VC_CRT_MAJOR_VERSION) || (_VC_CRT_MAJOR_VERSION < 12)
-inline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x,
- float __lcpp_y) _NOEXCEPT {
- return copysignf(__lcpp_x, __lcpp_y);
-}
-inline _LIBCPP_INLINE_VISIBILITY long double
-copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {
- return copysignl(__lcpp_x, __lcpp_y);
-}
-#endif
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __lazy_enable_if
-<
- is_arithmetic<_A1>::value &&
- is_arithmetic<_A2>::value,
- __promote<_A1, _A2>
->::type
-copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename __promote<_A1, _A2>::type __result_type;
- static_assert((!(is_same<_A1, __result_type>::value &&
- is_same<_A2, __result_type>::value)), "");
- return copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y);
-}
-
#ifndef _LIBCPP_MSVCRT
-
-// erf
-
using ::erf;
using ::erff;
-
-inline _LIBCPP_INLINE_VISIBILITY float erf(float __lcpp_x) _NOEXCEPT {return erff(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return erfl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-erf(_A1 __lcpp_x) _NOEXCEPT {return erf((double)__lcpp_x);}
-
-// erfc
-
using ::erfc;
using ::erfcf;
-
-inline _LIBCPP_INLINE_VISIBILITY float erfc(float __lcpp_x) _NOEXCEPT {return erfcf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return erfcl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-erfc(_A1 __lcpp_x) _NOEXCEPT {return erfc((double)__lcpp_x);}
-
-// exp2
-
using ::exp2;
using ::exp2f;
-
-inline _LIBCPP_INLINE_VISIBILITY float exp2(float __lcpp_x) _NOEXCEPT {return exp2f(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return exp2l(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-exp2(_A1 __lcpp_x) _NOEXCEPT {return exp2((double)__lcpp_x);}
-
-// expm1
-
using ::expm1;
using ::expm1f;
-
-inline _LIBCPP_INLINE_VISIBILITY float expm1(float __lcpp_x) _NOEXCEPT {return expm1f(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return expm1l(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-expm1(_A1 __lcpp_x) _NOEXCEPT {return expm1((double)__lcpp_x);}
-
-// fdim
-
using ::fdim;
using ::fdimf;
-
-inline _LIBCPP_INLINE_VISIBILITY float fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fdimf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fdiml(__lcpp_x, __lcpp_y);}
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __lazy_enable_if
-<
- is_arithmetic<_A1>::value &&
- is_arithmetic<_A2>::value,
- __promote<_A1, _A2>
->::type
-fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename __promote<_A1, _A2>::type __result_type;
- static_assert((!(is_same<_A1, __result_type>::value &&
- is_same<_A2, __result_type>::value)), "");
- return fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y);
-}
-
-// fma
-
using ::fmaf;
using ::fma;
-
-inline _LIBCPP_INLINE_VISIBILITY float fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT {return fmaf(__lcpp_x, __lcpp_y, __lcpp_z);}
-inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long double __lcpp_y, long double __lcpp_z) _NOEXCEPT {return fmal(__lcpp_x, __lcpp_y, __lcpp_z);}
-
-template <class _A1, class _A2, class _A3>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __lazy_enable_if
-<
- is_arithmetic<_A1>::value &&
- is_arithmetic<_A2>::value &&
- is_arithmetic<_A3>::value,
- __promote<_A1, _A2, _A3>
->::type
-fma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
-{
- 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 fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
-}
-
-// fmax
-
using ::fmax;
using ::fmaxf;
-
-inline _LIBCPP_INLINE_VISIBILITY float fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmaxf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmaxl(__lcpp_x, __lcpp_y);}
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __lazy_enable_if
-<
- is_arithmetic<_A1>::value &&
- is_arithmetic<_A2>::value,
- __promote<_A1, _A2>
->::type
-fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename __promote<_A1, _A2>::type __result_type;
- static_assert((!(is_same<_A1, __result_type>::value &&
- is_same<_A2, __result_type>::value)), "");
- return fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y);
-}
-
-// fmin
-
using ::fmin;
using ::fminf;
-
-inline _LIBCPP_INLINE_VISIBILITY float fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fminf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fminl(__lcpp_x, __lcpp_y);}
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __lazy_enable_if
-<
- is_arithmetic<_A1>::value &&
- is_arithmetic<_A2>::value,
- __promote<_A1, _A2>
->::type
-fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename __promote<_A1, _A2>::type __result_type;
- static_assert((!(is_same<_A1, __result_type>::value &&
- is_same<_A2, __result_type>::value)), "");
- return fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y);
-}
-
-// hypot
-
using ::hypot;
using ::hypotf;
-
-inline _LIBCPP_INLINE_VISIBILITY float hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return hypotf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return hypotl(__lcpp_x, __lcpp_y);}
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __lazy_enable_if
-<
- is_arithmetic<_A1>::value &&
- is_arithmetic<_A2>::value,
- __promote<_A1, _A2>
->::type
-hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename __promote<_A1, _A2>::type __result_type;
- static_assert((!(is_same<_A1, __result_type>::value &&
- is_same<_A2, __result_type>::value)), "");
- return hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y);
-}
-
-// ilogb
-
using ::ilogb;
using ::ilogbf;
-
-inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT {return ilogbf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ilogbl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, int>::type
-ilogb(_A1 __lcpp_x) _NOEXCEPT {return ilogb((double)__lcpp_x);}
-
-// lgamma
-
using ::lgamma;
using ::lgammaf;
-
-inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __lcpp_x) _NOEXCEPT {return lgammaf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return lgammal(__lcpp_x);}
-
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-lgamma(_A1 __lcpp_x) _NOEXCEPT {return lgamma((double)__lcpp_x);}
-
-
-// llrint
-
using ::llrint;
using ::llrintf;
-
-inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT {return llrintf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT {return llrintl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, long long>::type
-llrint(_A1 __lcpp_x) _NOEXCEPT {return llrint((double)__lcpp_x);}
-
-// llround
-
using ::llround;
using ::llroundf;
-
-inline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT {return llroundf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT {return llroundl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, long long>::type
-llround(_A1 __lcpp_x) _NOEXCEPT {return llround((double)__lcpp_x);}
-
-// log1p
-
using ::log1p;
using ::log1pf;
-
-inline _LIBCPP_INLINE_VISIBILITY float log1p(float __lcpp_x) _NOEXCEPT {return log1pf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return log1pl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-log1p(_A1 __lcpp_x) _NOEXCEPT {return log1p((double)__lcpp_x);}
-
-// log2
-
using ::log2;
using ::log2f;
-
-inline _LIBCPP_INLINE_VISIBILITY float log2(float __lcpp_x) _NOEXCEPT {return log2f(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return log2l(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-log2(_A1 __lcpp_x) _NOEXCEPT {return log2((double)__lcpp_x);}
-
-// logb
-
using ::logb;
using ::logbf;
-
-inline _LIBCPP_INLINE_VISIBILITY float logb(float __lcpp_x) _NOEXCEPT {return logbf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return logbl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-logb(_A1 __lcpp_x) _NOEXCEPT {return logb((double)__lcpp_x);}
-
-// lrint
-
using ::lrint;
using ::lrintf;
-
-inline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT {return lrintf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT {return lrintl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, long>::type
-lrint(_A1 __lcpp_x) _NOEXCEPT {return lrint((double)__lcpp_x);}
-
-// lround
-
using ::lround;
using ::lroundf;
-
-inline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT {return lroundf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT {return lroundl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, long>::type
-lround(_A1 __lcpp_x) _NOEXCEPT {return lround((double)__lcpp_x);}
-
#endif // _LIBCPP_MSVCRT
#endif // __sun__
-// nan
-
#ifndef _LIBCPP_MSVCRT
using ::nan;
using ::nanf;
@@ -1447,183 +454,28 @@ using ::nanf;
#ifndef __sun__
#ifndef _LIBCPP_MSVCRT
-
-// nearbyint
-
using ::nearbyint;
using ::nearbyintf;
-
-inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __lcpp_x) _NOEXCEPT {return nearbyintf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return nearbyintl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-nearbyint(_A1 __lcpp_x) _NOEXCEPT {return nearbyint((double)__lcpp_x);}
-
-// nextafter
-
using ::nextafter;
using ::nextafterf;
-
-inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return nextafterf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nextafterl(__lcpp_x, __lcpp_y);}
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __lazy_enable_if
-<
- is_arithmetic<_A1>::value &&
- is_arithmetic<_A2>::value,
- __promote<_A1, _A2>
->::type
-nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename __promote<_A1, _A2>::type __result_type;
- static_assert((!(is_same<_A1, __result_type>::value &&
- is_same<_A2, __result_type>::value)), "");
- return nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y);
-}
-
-// nexttoward
-
using ::nexttoward;
using ::nexttowardf;
-
-inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardl(__lcpp_x, __lcpp_y);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-nexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttoward((double)__lcpp_x, __lcpp_y);}
-
-// remainder
-
using ::remainder;
using ::remainderf;
-
-inline _LIBCPP_INLINE_VISIBILITY float remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return remainderf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return remainderl(__lcpp_x, __lcpp_y);}
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __lazy_enable_if
-<
- is_arithmetic<_A1>::value &&
- is_arithmetic<_A2>::value,
- __promote<_A1, _A2>
->::type
-remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
-{
- typedef typename __promote<_A1, _A2>::type __result_type;
- static_assert((!(is_same<_A1, __result_type>::value &&
- is_same<_A2, __result_type>::value)), "");
- return remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y);
-}
-
-// remquo
-
using ::remquo;
using ::remquof;
-
-inline _LIBCPP_INLINE_VISIBILITY float remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquof(__lcpp_x, __lcpp_y, __lcpp_z);}
-inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long double __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquol(__lcpp_x, __lcpp_y, __lcpp_z);}
-
-template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __lazy_enable_if
-<
- is_arithmetic<_A1>::value &&
- is_arithmetic<_A2>::value,
- __promote<_A1, _A2>
->::type
-remquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT
-{
- typedef typename __promote<_A1, _A2>::type __result_type;
- static_assert((!(is_same<_A1, __result_type>::value &&
- is_same<_A2, __result_type>::value)), "");
- return remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z);
-}
-
-// rint
-
using ::rint;
using ::rintf;
-
-inline _LIBCPP_INLINE_VISIBILITY float rint(float __lcpp_x) _NOEXCEPT {return rintf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT {return rintl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-rint(_A1 __lcpp_x) _NOEXCEPT {return rint((double)__lcpp_x);}
-
-// round
-
using ::round;
using ::roundf;
-
-inline _LIBCPP_INLINE_VISIBILITY float round(float __lcpp_x) _NOEXCEPT {return roundf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT {return roundl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-round(_A1 __lcpp_x) _NOEXCEPT {return round((double)__lcpp_x);}
-
-// scalbln
-
using ::scalbln;
using ::scalblnf;
-
-inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnl(__lcpp_x, __lcpp_y);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-scalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalbln((double)__lcpp_x, __lcpp_y);}
-
-// scalbn
-
using ::scalbn;
using ::scalbnf;
-
-inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnl(__lcpp_x, __lcpp_y);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-scalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbn((double)__lcpp_x, __lcpp_y);}
-
-// tgamma
-
using ::tgamma;
using ::tgammaf;
-
-inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __lcpp_x) _NOEXCEPT {return tgammaf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return tgammal(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-tgamma(_A1 __lcpp_x) _NOEXCEPT {return tgamma((double)__lcpp_x);}
-
-// trunc
-
using ::trunc;
using ::truncf;
-
-inline _LIBCPP_INLINE_VISIBILITY float trunc(float __lcpp_x) _NOEXCEPT {return truncf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT {return truncl(__lcpp_x);}
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_integral<_A1>::value, double>::type
-trunc(_A1 __lcpp_x) _NOEXCEPT {return trunc((double)__lcpp_x);}
-
#endif // !_LIBCPP_MSVCRT
using ::acosl;
@@ -1647,6 +499,7 @@ using ::sinl;
using ::sinhl;
using ::sqrtl;
using ::tanl;
+
#ifndef _LIBCPP_MSVCRT
using ::tanhl;
using ::acoshl;
@@ -1654,7 +507,9 @@ using ::asinhl;
using ::atanhl;
using ::cbrtl;
#endif // !_LIBCPP_MSVCRT
+
using ::copysignl;
+
#ifndef _LIBCPP_MSVCRT
using ::erfl;
using ::erfcl;
@@ -1692,6 +547,7 @@ using ::truncl;
using ::lgamma;
using ::lgammaf;
#endif // __sun__
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CMATH
diff --git a/include/complex.h b/include/complex.h
index 7003d31a89cd..c2359665add5 100644
--- a/include/complex.h
+++ b/include/complex.h
@@ -18,6 +18,12 @@
*/
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
#ifdef __cplusplus
#include <ccomplex>
@@ -28,8 +34,4 @@
#endif // __cplusplus
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC system_header
-#endif
-
#endif // _LIBCPP_COMPLEX_H
diff --git a/include/condition_variable b/include/condition_variable
index 1af2484abd7b..10e007701672 100644
--- a/include/condition_variable
+++ b/include/condition_variable
@@ -124,14 +124,18 @@ class _LIBCPP_TYPE_VIS condition_variable_any
condition_variable __cv_;
shared_ptr<mutex> __mut_;
public:
+ _LIBCPP_INLINE_VISIBILITY
condition_variable_any();
+ _LIBCPP_INLINE_VISIBILITY
void notify_one() _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
void notify_all() _NOEXCEPT;
template <class _Lock>
void wait(_Lock& __lock);
template <class _Lock, class _Predicate>
+ _LIBCPP_INLINE_VISIBILITY
void wait(_Lock& __lock, _Predicate __pred);
template <class _Lock, class _Clock, class _Duration>
@@ -141,27 +145,30 @@ public:
template <class _Lock, class _Clock, class _Duration, class _Predicate>
bool
+ _LIBCPP_INLINE_VISIBILITY
wait_until(_Lock& __lock,
const chrono::time_point<_Clock, _Duration>& __t,
_Predicate __pred);
template <class _Lock, class _Rep, class _Period>
cv_status
+ _LIBCPP_INLINE_VISIBILITY
wait_for(_Lock& __lock,
const chrono::duration<_Rep, _Period>& __d);
template <class _Lock, class _Rep, class _Period, class _Predicate>
bool
+ _LIBCPP_INLINE_VISIBILITY
wait_for(_Lock& __lock,
const chrono::duration<_Rep, _Period>& __d,
_Predicate __pred);
};
-inline _LIBCPP_INLINE_VISIBILITY
+inline
condition_variable_any::condition_variable_any()
: __mut_(make_shared<mutex>()) {}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
condition_variable_any::notify_one() _NOEXCEPT
{
@@ -169,7 +176,7 @@ condition_variable_any::notify_one() _NOEXCEPT
__cv_.notify_one();
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
condition_variable_any::notify_all() _NOEXCEPT
{
@@ -196,7 +203,7 @@ condition_variable_any::wait(_Lock& __lock)
} // __mut_.unlock(), __lock.lock()
template <class _Lock, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
condition_variable_any::wait(_Lock& __lock, _Predicate __pred)
{
@@ -218,7 +225,7 @@ condition_variable_any::wait_until(_Lock& __lock,
} // __mut_.unlock(), __lock.lock()
template <class _Lock, class _Clock, class _Duration, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
condition_variable_any::wait_until(_Lock& __lock,
const chrono::time_point<_Clock, _Duration>& __t,
@@ -231,7 +238,7 @@ condition_variable_any::wait_until(_Lock& __lock,
}
template <class _Lock, class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
cv_status
condition_variable_any::wait_for(_Lock& __lock,
const chrono::duration<_Rep, _Period>& __d)
@@ -240,7 +247,7 @@ condition_variable_any::wait_for(_Lock& __lock,
}
template <class _Lock, class _Rep, class _Period, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
condition_variable_any::wait_for(_Lock& __lock,
const chrono::duration<_Rep, _Period>& __d,
diff --git a/include/csetjmp b/include/csetjmp
index d0b2c078967d..58a9c73ab56f 100644
--- a/include/csetjmp
+++ b/include/csetjmp
@@ -38,10 +38,6 @@ void longjmp(jmp_buf env, int val);
#pragma GCC system_header
#endif
-#ifndef setjmp
-#define setjmp(env) setjmp(env)
-#endif
-
_LIBCPP_BEGIN_NAMESPACE_STD
using ::jmp_buf;
diff --git a/include/cstddef b/include/cstddef
index c3ca64a9c014..edd106c001bc 100644
--- a/include/cstddef
+++ b/include/cstddef
@@ -35,12 +35,14 @@ Types:
#include <__config>
-#include <stddef.h>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
+// Don't include our own <stddef.h>; we don't want to declare ::nullptr_t.
+#include_next <stddef.h>
+#include <__nullptr>
+
_LIBCPP_BEGIN_NAMESPACE_STD
using ::ptrdiff_t;
@@ -53,50 +55,6 @@ using ::max_align_t;
typedef long double max_align_t;
#endif
-#ifdef _LIBCPP_HAS_NO_NULLPTR
-
-struct _LIBCPP_TYPE_VIS_ONLY nullptr_t
-{
- void* __lx;
-
- struct __nat {int __for_bool_;};
-
- _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : __lx(0) {}
- _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : __lx(0) {}
-
- _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;}
-
- template <class _Tp>
- _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR
- operator _Tp* () const {return 0;}
-
- template <class _Tp, class _Up>
- _LIBCPP_ALWAYS_INLINE
- operator _Tp _Up::* () const {return 0;}
-
- friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;}
- friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;}
- friend _LIBCPP_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);}
-
-#define nullptr _VSTD::__get_nullptr_t()
-
-#endif // _LIBCPP_HAS_NO_NULLPTR
-
_LIBCPP_END_NAMESPACE_STD
-#ifndef _LIBCPP_HAS_NO_NULLPTR
-
-namespace std
-{
- typedef decltype(nullptr) nullptr_t;
-}
-
-#endif // _LIBCPP_HAS_NO_NULLPTR
-
#endif // _LIBCPP_CSTDDEF
diff --git a/include/cstdio b/include/cstdio
index d8ba6c2ef383..50fdd3457426 100644
--- a/include/cstdio
+++ b/include/cstdio
@@ -103,41 +103,6 @@ void perror(const char* s);
#pragma GCC system_header
#endif
-// snprintf
-#if defined(_LIBCPP_MSVCRT)
-#include "support/win32/support.h"
-#endif
-
-#ifdef getc
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_getc(FILE* __stream) {return getc(__stream);}
-#undef getc
-inline _LIBCPP_INLINE_VISIBILITY int getc(FILE* __stream) {return __libcpp_getc(__stream);}
-#endif // getc
-
-#ifdef putc
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_putc(int __c, FILE* __stream) {return putc(__c, __stream);}
-#undef putc
-inline _LIBCPP_INLINE_VISIBILITY int putc(int __c, FILE* __stream) {return __libcpp_putc(__c, __stream);}
-#endif // putc
-
-#ifdef clearerr
-inline _LIBCPP_INLINE_VISIBILITY void __libcpp_clearerr(FILE* __stream) { return clearerr(__stream); }
-#undef clearerr
-inline _LIBCPP_INLINE_VISIBILITY void clearerr(FILE* __stream) { return __libcpp_clearerr(__stream); }
-#endif // clearerr
-
-#ifdef feof
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_feof(FILE* __stream) { return feof(__stream); }
-#undef feof
-inline _LIBCPP_INLINE_VISIBILITY int feof(FILE* __stream) { return __libcpp_feof(__stream); }
-#endif // feof
-
-#ifdef ferror
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_ferror(FILE* __stream) { return ferror(__stream); }
-#undef ferror
-inline _LIBCPP_INLINE_VISIBILITY int ferror(FILE* __stream) { return __libcpp_ferror(__stream); }
-#endif // ferror
-
_LIBCPP_BEGIN_NAMESPACE_STD
using ::FILE;
diff --git a/include/cstdlib b/include/cstdlib
index 55e15c82192e..10ed231078d8 100644
--- a/include/cstdlib
+++ b/include/cstdlib
@@ -84,9 +84,6 @@ void *aligned_alloc(size_t alignment, size_t size); // C11
#include <__config>
#include <stdlib.h>
-#ifdef _LIBCPP_MSVCRT
-#include "support/win32/locale_win32.h"
-#endif // _LIBCPP_MSVCRT
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -131,20 +128,14 @@ using ::getenv;
using ::system;
using ::bsearch;
using ::qsort;
-#undef abs
using ::abs;
-#undef labs
using ::labs;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
-#undef llabs
using ::llabs;
#endif // _LIBCPP_HAS_NO_LONG_LONG
-#undef div
using ::div;
-#undef ldiv
using ::ldiv;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
-#undef lldiv
using ::lldiv;
#endif // _LIBCPP_HAS_NO_LONG_LONG
#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
@@ -162,19 +153,6 @@ using ::quick_exit;
using ::aligned_alloc;
#endif
-// MSVCRT already has the correct prototype in <stdlib.h> #ifdef __cplusplus
-#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX)
-inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);}
-#ifndef _LIBCPP_HAS_NO_LONG_LONG
-inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
-#endif // _LIBCPP_HAS_NO_LONG_LONG
-
-inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);}
-#ifndef _LIBCPP_HAS_NO_LONG_LONG
-inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);}
-#endif // _LIBCPP_HAS_NO_LONG_LONG
-#endif // _LIBCPP_MSVCRT
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CSTDLIB
diff --git a/include/ctype.h b/include/ctype.h
new file mode 100644
index 000000000000..22d6c49be9e1
--- /dev/null
+++ b/include/ctype.h
@@ -0,0 +1,69 @@
+// -*- C++ -*-
+//===---------------------------- ctype.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_CTYPE_H
+#define _LIBCPP_CTYPE_H
+
+/*
+ ctype.h synopsis
+
+int isalnum(int c);
+int isalpha(int c);
+int isblank(int c); // C99
+int iscntrl(int c);
+int isdigit(int c);
+int isgraph(int c);
+int islower(int c);
+int isprint(int c);
+int ispunct(int c);
+int isspace(int c);
+int isupper(int c);
+int isxdigit(int c);
+int tolower(int c);
+int toupper(int c);
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <ctype.h>
+
+#ifdef __cplusplus
+
+#if defined(_LIBCPP_MSVCRT)
+// We support including .h headers inside 'extern "C"' contexts, so switch
+// back to C++ linkage before including these C++ headers.
+extern "C++" {
+ #include "support/win32/support.h"
+ #include "support/win32/locale_win32.h"
+}
+#endif // _LIBCPP_MSVCRT
+
+#undef isalnum
+#undef isalpha
+#undef isblank
+#undef iscntrl
+#undef isdigit
+#undef isgraph
+#undef islower
+#undef isprint
+#undef ispunct
+#undef isspace
+#undef isupper
+#undef isxdigit
+#undef tolower
+#undef toupper
+
+#endif
+
+#endif // _LIBCPP_CTYPE_H
diff --git a/include/cwchar b/include/cwchar
index 797a1777c22f..ef4806db2bde 100644
--- a/include/cwchar
+++ b/include/cwchar
@@ -106,9 +106,6 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
#include <__config>
#include <cwctype>
#include <wchar.h>
-#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
-#include <support/win32/support.h> // pull in *swprintf defines
-#endif // _LIBCPP_MSVCRT
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -161,16 +158,13 @@ using ::wcscoll;
using ::wcsncmp;
using ::wcsxfrm;
-#if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_)
-
+#ifdef _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS
using ::wcschr;
using ::wcspbrk;
using ::wcsrchr;
using ::wcsstr;
using ::wmemchr;
-
#else
-
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
@@ -185,7 +179,6 @@ inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsstr( wchar_t* __s1, cons
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);}
inline _LIBCPP_INLINE_VISIBILITY wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);}
-
#endif
using ::wcscspn;
diff --git a/include/cwctype b/include/cwctype
index 4f89b52db27c..25b2489edf2c 100644
--- a/include/cwctype
+++ b/include/cwctype
@@ -63,150 +63,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD
using ::wint_t;
using ::wctrans_t;
using ::wctype_t;
-
-#ifdef iswalnum
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalnum(wint_t __wc) {return iswalnum(__wc);}
-#undef iswalnum
-inline _LIBCPP_INLINE_VISIBILITY int iswalnum(wint_t __wc) {return __libcpp_iswalnum(__wc);}
-#else // iswalnum
using ::iswalnum;
-#endif
-
-#ifdef iswalpha
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalpha(wint_t __wc) {return iswalpha(__wc);}
-#undef iswalpha
-inline _LIBCPP_INLINE_VISIBILITY int iswalpha(wint_t __wc) {return __libcpp_iswalpha(__wc);}
-#else // iswalpha
using ::iswalpha;
-#endif
-
-#ifdef iswblank
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswblank(wint_t __wc) {return iswblank(__wc);}
-#undef iswblank
-inline _LIBCPP_INLINE_VISIBILITY int iswblank(wint_t __wc) {return __libcpp_iswblank(__wc);}
-#else // iswblank
using ::iswblank;
-#endif
-
-#ifdef iswcntrl
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswcntrl(wint_t __wc) {return iswcntrl(__wc);}
-#undef iswcntrl
-inline _LIBCPP_INLINE_VISIBILITY int iswcntrl(wint_t __wc) {return __libcpp_iswcntrl(__wc);}
-#else // iswcntrl
using ::iswcntrl;
-#endif
-
-#ifdef iswdigit
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswdigit(wint_t __wc) {return iswdigit(__wc);}
-#undef iswdigit
-inline _LIBCPP_INLINE_VISIBILITY int iswdigit(wint_t __wc) {return __libcpp_iswdigit(__wc);}
-#else // iswdigit
using ::iswdigit;
-#endif
-
-#ifdef iswgraph
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswgraph(wint_t __wc) {return iswgraph(__wc);}
-#undef iswgraph
-inline _LIBCPP_INLINE_VISIBILITY int iswgraph(wint_t __wc) {return __libcpp_iswgraph(__wc);}
-#else // iswgraph
using ::iswgraph;
-#endif
-
-#ifdef iswlower
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswlower(wint_t __wc) {return iswlower(__wc);}
-#undef iswlower
-inline _LIBCPP_INLINE_VISIBILITY int iswlower(wint_t __wc) {return __libcpp_iswlower(__wc);}
-#else // iswlower
using ::iswlower;
-#endif
-
-#ifdef iswprint
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswprint(wint_t __wc) {return iswprint(__wc);}
-#undef iswprint
-inline _LIBCPP_INLINE_VISIBILITY int iswprint(wint_t __wc) {return __libcpp_iswprint(__wc);}
-#else // iswprint
using ::iswprint;
-#endif
-
-#ifdef iswpunct
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswpunct(wint_t __wc) {return iswpunct(__wc);}
-#undef iswpunct
-inline _LIBCPP_INLINE_VISIBILITY int iswpunct(wint_t __wc) {return __libcpp_iswpunct(__wc);}
-#else // iswpunct
using ::iswpunct;
-#endif
-
-#ifdef iswspace
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswspace(wint_t __wc) {return iswspace(__wc);}
-#undef iswspace
-inline _LIBCPP_INLINE_VISIBILITY int iswspace(wint_t __wc) {return __libcpp_iswspace(__wc);}
-#else // iswspace
using ::iswspace;
-#endif
-
-#ifdef iswupper
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswupper(wint_t __wc) {return iswupper(__wc);}
-#undef iswupper
-inline _LIBCPP_INLINE_VISIBILITY int iswupper(wint_t __wc) {return __libcpp_iswupper(__wc);}
-#else // iswupper
using ::iswupper;
-#endif
-
-#ifdef iswxdigit
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswxdigit(wint_t __wc) {return iswxdigit(__wc);}
-#undef iswxdigit
-inline _LIBCPP_INLINE_VISIBILITY int iswxdigit(wint_t __wc) {return __libcpp_iswxdigit(__wc);}
-#else // iswxdigit
using ::iswxdigit;
-#endif
-
-#ifdef iswctype
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswctype(wint_t __w, wctype_t __d) {return iswctype(__w, __d);}
-#undef iswctype
-inline _LIBCPP_INLINE_VISIBILITY int iswctype(wint_t __w, wctype_t __d) {return __libcpp_iswctype(__w, __d);}
-#else // iswctype
using ::iswctype;
-#endif
-
-#ifdef wctype
-inline _LIBCPP_INLINE_VISIBILITY wctype_t __libcpp_wctype(const char* __p) {return wctype(__p);}
-#undef wctype
-inline _LIBCPP_INLINE_VISIBILITY wctype_t wctype(const char* __p) {return __libcpp_wctype(__p);}
-#else // wctype
using ::wctype;
-#endif
-
-#ifdef towlower
-inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towlower(wint_t __wc) {return towlower(__wc);}
-#undef towlower
-inline _LIBCPP_INLINE_VISIBILITY wint_t towlower(wint_t __wc) {return __libcpp_towlower(__wc);}
-#else // towlower
using ::towlower;
-#endif
-
-#ifdef towupper
-inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towupper(wint_t __wc) {return towupper(__wc);}
-#undef towupper
-inline _LIBCPP_INLINE_VISIBILITY wint_t towupper(wint_t __wc) {return __libcpp_towupper(__wc);}
-#else // towupper
using ::towupper;
-#endif
-
-#ifdef towctrans
-inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towctrans(wint_t __wc, wctype_t __d) {return towctrans(__wc, __d);}
-#undef towctrans
-inline _LIBCPP_INLINE_VISIBILITY wint_t towctrans(wint_t __wc, wctype_t __d) {return __libcpp_towctrans(__wc, __d);}
-#else // towctrans
using ::towctrans;
-#endif
-
-#ifdef wctrans
-inline _LIBCPP_INLINE_VISIBILITY wctrans_t __libcpp_wctrans(const char* __p) {return wctrans(__p);}
-#undef wctrans
-inline _LIBCPP_INLINE_VISIBILITY wctrans_t wctrans(const char* __p) {return __libcpp_wctrans(__p);}
-#else // wctrans
using ::wctrans;
-#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/deque b/include/deque
index 5e152e425d0b..c6fbd512a1c6 100644
--- a/include/deque
+++ b/include/deque
@@ -261,8 +261,21 @@ move_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l,
__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r);
+template <class _ValueType, class _DiffType>
+struct __deque_block_size {
+ static const _DiffType value = sizeof(_ValueType) < 256 ? 4096 / sizeof(_ValueType) : 16;
+};
+
template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
- class _DiffType, _DiffType _BlockSize>
+ class _DiffType, _DiffType _BS =
+#ifdef _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
+// Keep template parameter to avoid changing all template declarations thoughout
+// this file.
+ 0
+#else
+ __deque_block_size<_ValueType, _DiffType>::value
+#endif
+ >
class _LIBCPP_TYPE_VIS_ONLY __deque_iterator
{
typedef _MapPointer __map_iterator;
@@ -273,7 +286,7 @@ private:
__map_iterator __m_iter_;
pointer __ptr_;
- static const difference_type __block_size = _BlockSize;
+ static const difference_type __block_size;
public:
typedef _ValueType value_type;
typedef random_access_iterator_tag iterator_category;
@@ -287,7 +300,7 @@ public:
template <class _Pp, class _Rp, class _MP>
_LIBCPP_INLINE_VISIBILITY
- __deque_iterator(const __deque_iterator<value_type, _Pp, _Rp, _MP, difference_type, __block_size>& __it,
+ __deque_iterator(const __deque_iterator<value_type, _Pp, _Rp, _MP, difference_type, _BS>& __it,
typename enable_if<is_convertible<_Pp, pointer>::value>::type* = 0) _NOEXCEPT
: __m_iter_(__it.__m_iter_), __ptr_(__it.__ptr_) {}
@@ -520,6 +533,12 @@ private:
__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r);
};
+template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
+ class _DiffType, _DiffType _BlockSize>
+const _DiffType __deque_iterator<_ValueType, _Pointer, _Reference, _MapPointer,
+ _DiffType, _BlockSize>::__block_size =
+ __deque_block_size<_ValueType, _DiffType>::value;
+
// copy
template <class _RAIter,
@@ -532,10 +551,11 @@ copy(_RAIter __f,
{
typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::difference_type difference_type;
typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::pointer pointer;
+ const difference_type __block_size = __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::__block_size;
while (__f != __l)
{
pointer __rb = __r.__ptr_;
- pointer __re = *__r.__m_iter_ + _B2;
+ pointer __re = *__r.__m_iter_ + __block_size;
difference_type __bs = __re - __rb;
difference_type __n = __l - __f;
_RAIter __m = __l;
@@ -560,11 +580,12 @@ copy(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
{
typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::difference_type difference_type;
typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::pointer pointer;
+ const difference_type __block_size = __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::__block_size;
difference_type __n = __l - __f;
while (__n > 0)
{
pointer __fb = __f.__ptr_;
- pointer __fe = *__f.__m_iter_ + _B1;
+ pointer __fe = *__f.__m_iter_ + __block_size;
difference_type __bs = __fe - __fb;
if (__bs > __n)
{
@@ -587,11 +608,12 @@ copy(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
{
typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::difference_type difference_type;
typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::pointer pointer;
+ const difference_type __block_size = __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::__block_size;
difference_type __n = __l - __f;
while (__n > 0)
{
pointer __fb = __f.__ptr_;
- pointer __fe = *__f.__m_iter_ + _B1;
+ pointer __fe = *__f.__m_iter_ + __block_size;
difference_type __bs = __fe - __fb;
if (__bs > __n)
{
@@ -705,10 +727,11 @@ move(_RAIter __f,
{
typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::difference_type difference_type;
typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::pointer pointer;
+ const difference_type __block_size = __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::__block_size;
while (__f != __l)
{
pointer __rb = __r.__ptr_;
- pointer __re = *__r.__m_iter_ + _B2;
+ pointer __re = *__r.__m_iter_ + __block_size;
difference_type __bs = __re - __rb;
difference_type __n = __l - __f;
_RAIter __m = __l;
@@ -733,11 +756,12 @@ move(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
{
typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::difference_type difference_type;
typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::pointer pointer;
+ const difference_type __block_size = __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::__block_size;
difference_type __n = __l - __f;
while (__n > 0)
{
pointer __fb = __f.__ptr_;
- pointer __fe = *__f.__m_iter_ + _B1;
+ pointer __fe = *__f.__m_iter_ + __block_size;
difference_type __bs = __fe - __fb;
if (__bs > __n)
{
@@ -760,11 +784,12 @@ move(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
{
typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::difference_type difference_type;
typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::pointer pointer;
+ const difference_type __block_size = __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::__block_size;
difference_type __n = __l - __f;
while (__n > 0)
{
pointer __fb = __f.__ptr_;
- pointer __fe = *__f.__m_iter_ + _B1;
+ pointer __fe = *__f.__m_iter_ + __block_size;
difference_type __bs = __fe - __fb;
if (__bs > __n)
{
@@ -909,7 +934,7 @@ protected:
typedef typename __alloc_traits::pointer pointer;
typedef typename __alloc_traits::const_pointer const_pointer;
- static const difference_type __block_size = sizeof(value_type) < 256 ? 4096 / sizeof(value_type) : 16;
+ static const difference_type __block_size;
typedef typename __rebind_alloc_helper<__alloc_traits, pointer>::type __pointer_allocator;
typedef allocator_traits<__pointer_allocator> __map_traits;
@@ -919,9 +944,9 @@ protected:
typedef __split_buffer<pointer, __pointer_allocator> __map;
typedef __deque_iterator<value_type, pointer, reference, __map_pointer,
- difference_type, __block_size> iterator;
+ difference_type> iterator;
typedef __deque_iterator<value_type, const_pointer, const_reference, __map_const_pointer,
- difference_type, __block_size> const_iterator;
+ difference_type> const_iterator;
__map __map_;
size_type __start_;
@@ -939,8 +964,10 @@ protected:
_LIBCPP_INLINE_VISIBILITY
const allocator_type& __alloc() const _NOEXCEPT {return __size_.second();}
+ _LIBCPP_INLINE_VISIBILITY
__deque_base()
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
+ _LIBCPP_INLINE_VISIBILITY
explicit __deque_base(const allocator_type& __a);
public:
~__deque_base();
@@ -997,6 +1024,11 @@ private:
};
template <class _Tp, class _Allocator>
+const typename __deque_base<_Tp, _Allocator>::difference_type
+ __deque_base<_Tp, _Allocator>::__block_size =
+ __deque_block_size<value_type, difference_type>::value;
+
+template <class _Tp, class _Allocator>
bool
__deque_base<_Tp, _Allocator>::__invariants() const
{
@@ -1060,13 +1092,13 @@ __deque_base<_Tp, _Allocator>::end() const _NOEXCEPT
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__deque_base<_Tp, _Allocator>::__deque_base()
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
: __start_(0), __size_(0) {}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__deque_base<_Tp, _Allocator>::__deque_base(const allocator_type& __a)
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a) {}
@@ -1164,6 +1196,9 @@ public:
typedef _Tp value_type;
typedef _Allocator allocator_type;
+ static_assert((is_same<typename allocator_type::value_type, value_type>::value),
+ "Allocator::value_type must be same type as value_type");
+
typedef __deque_base<value_type, allocator_type> __base;
typedef typename __base::__alloc_traits __alloc_traits;
@@ -1211,8 +1246,11 @@ public:
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value);
+ _LIBCPP_INLINE_VISIBILITY
deque(deque&& __c, const allocator_type& __a);
+ _LIBCPP_INLINE_VISIBILITY
deque& operator=(deque&& __c)
_NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<allocator_type>::value);
@@ -1231,6 +1269,7 @@ public:
void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+ _LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT;
// iterators:
@@ -1283,13 +1322,21 @@ public:
bool empty() const _NOEXCEPT {return __base::size() == 0;}
// element access:
+ _LIBCPP_INLINE_VISIBILITY
reference operator[](size_type __i);
+ _LIBCPP_INLINE_VISIBILITY
const_reference operator[](size_type __i) const;
+ _LIBCPP_INLINE_VISIBILITY
reference at(size_type __i);
+ _LIBCPP_INLINE_VISIBILITY
const_reference at(size_type __i) const;
+ _LIBCPP_INLINE_VISIBILITY
reference front();
+ _LIBCPP_INLINE_VISIBILITY
const_reference front() const;
+ _LIBCPP_INLINE_VISIBILITY
reference back();
+ _LIBCPP_INLINE_VISIBILITY
const_reference back() const;
// 23.2.2.3 modifiers:
@@ -1328,6 +1375,7 @@ public:
iterator erase(const_iterator __p);
iterator erase(const_iterator __f, const_iterator __l);
+ _LIBCPP_INLINE_VISIBILITY
void swap(deque& __c)
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT;
@@ -1335,6 +1383,7 @@ public:
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value);
#endif
+ _LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
@@ -1507,7 +1556,7 @@ deque<_Tp, _Allocator>::operator=(const deque& __c)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
deque<_Tp, _Allocator>::deque(deque&& __c)
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
: __base(_VSTD::move(__c))
@@ -1515,7 +1564,7 @@ deque<_Tp, _Allocator>::deque(deque&& __c)
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
deque<_Tp, _Allocator>::deque(deque&& __c, const allocator_type& __a)
: __base(_VSTD::move(__c), __a)
{
@@ -1527,7 +1576,7 @@ deque<_Tp, _Allocator>::deque(deque&& __c, const allocator_type& __a)
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
deque<_Tp, _Allocator>&
deque<_Tp, _Allocator>::operator=(deque&& __c)
_NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
@@ -1611,7 +1660,7 @@ deque<_Tp, _Allocator>::assign(size_type __n, const value_type& __v)
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_Allocator
deque<_Tp, _Allocator>::get_allocator() const _NOEXCEPT
{
@@ -1670,7 +1719,7 @@ deque<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename deque<_Tp, _Allocator>::reference
deque<_Tp, _Allocator>::operator[](size_type __i)
{
@@ -1679,7 +1728,7 @@ deque<_Tp, _Allocator>::operator[](size_type __i)
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename deque<_Tp, _Allocator>::const_reference
deque<_Tp, _Allocator>::operator[](size_type __i) const
{
@@ -1688,7 +1737,7 @@ deque<_Tp, _Allocator>::operator[](size_type __i) const
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename deque<_Tp, _Allocator>::reference
deque<_Tp, _Allocator>::at(size_type __i)
{
@@ -1699,7 +1748,7 @@ deque<_Tp, _Allocator>::at(size_type __i)
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename deque<_Tp, _Allocator>::const_reference
deque<_Tp, _Allocator>::at(size_type __i) const
{
@@ -1710,7 +1759,7 @@ deque<_Tp, _Allocator>::at(size_type __i) const
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename deque<_Tp, _Allocator>::reference
deque<_Tp, _Allocator>::front()
{
@@ -1719,7 +1768,7 @@ deque<_Tp, _Allocator>::front()
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename deque<_Tp, _Allocator>::const_reference
deque<_Tp, _Allocator>::front() const
{
@@ -1728,7 +1777,7 @@ deque<_Tp, _Allocator>::front() const
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename deque<_Tp, _Allocator>::reference
deque<_Tp, _Allocator>::back()
{
@@ -1737,7 +1786,7 @@ deque<_Tp, _Allocator>::back()
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename deque<_Tp, _Allocator>::const_reference
deque<_Tp, _Allocator>::back() const
{
@@ -2029,7 +2078,6 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
if (__n > __front_spare())
__add_front_capacity(__n - __front_spare());
// __n <= __front_spare()
- size_type __old_n = __n;
iterator __old_begin = __base::begin();
iterator __i = __old_begin;
if (__n > __pos)
@@ -2054,7 +2102,6 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
if (__n > __back_capacity)
__add_back_capacity(__n - __back_capacity);
// __n <= __back_capacity
- size_type __old_n = __n;
iterator __old_end = __base::end();
iterator __i = __old_end;
size_type __de = __base::size() - __pos;
@@ -2119,7 +2166,6 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
if (__n > __front_spare())
__add_front_capacity(__n - __front_spare());
// __n <= __front_spare()
- size_type __old_n = __n;
iterator __old_begin = __base::begin();
iterator __i = __old_begin;
_BiIter __m = __f;
@@ -2150,7 +2196,6 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
if (__n > __back_capacity)
__add_back_capacity(__n - __back_capacity);
// __n <= __back_capacity
- size_type __old_n = __n;
iterator __old_end = __base::end();
iterator __i = __old_end;
_BiIter __m = __l;
@@ -2685,7 +2730,6 @@ template <class _Tp, class _Allocator>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::erase(const_iterator __f)
{
- difference_type __n = 1;
iterator __b = __base::begin();
difference_type __pos = __f - __b;
iterator __p = __b + __pos;
@@ -2781,7 +2825,7 @@ deque<_Tp, _Allocator>::__erase_to_end(const_iterator __f)
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
deque<_Tp, _Allocator>::swap(deque& __c)
#if _LIBCPP_STD_VER >= 14
@@ -2795,7 +2839,7 @@ deque<_Tp, _Allocator>::swap(deque& __c)
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
deque<_Tp, _Allocator>::clear() _NOEXCEPT
{
diff --git a/include/errno.h b/include/errno.h
new file mode 100644
index 000000000000..ee6429110cc1
--- /dev/null
+++ b/include/errno.h
@@ -0,0 +1,398 @@
+// -*- C++ -*-
+//===-------------------------- errno.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_ERRNO_H
+#define _LIBCPP_ERRNO_H
+
+/*
+ errno.h synopsis
+
+Macros:
+
+ EDOM
+ EILSEQ // C99
+ ERANGE
+ errno
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <errno.h>
+
+#ifdef __cplusplus
+
+#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
+
+#ifdef ELAST
+
+static const int __elast1 = ELAST+1;
+static const int __elast2 = ELAST+2;
+
+#else
+
+static const int __elast1 = 104;
+static const int __elast2 = 105;
+
+#endif
+
+#ifdef ENOTRECOVERABLE
+
+#define EOWNERDEAD __elast1
+
+#ifdef ELAST
+#undef ELAST
+#define ELAST EOWNERDEAD
+#endif
+
+#elif defined(EOWNERDEAD)
+
+#define ENOTRECOVERABLE __elast1
+#ifdef ELAST
+#undef ELAST
+#define ELAST ENOTRECOVERABLE
+#endif
+
+#else // defined(EOWNERDEAD)
+
+#define EOWNERDEAD __elast1
+#define ENOTRECOVERABLE __elast2
+#ifdef ELAST
+#undef ELAST
+#define ELAST ENOTRECOVERABLE
+#endif
+
+#endif // defined(EOWNERDEAD)
+
+#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
+
+// supply errno values likely to be missing, particularly on Windows
+
+#ifndef EAFNOSUPPORT
+#define EAFNOSUPPORT 9901
+#endif
+
+#ifndef EADDRINUSE
+#define EADDRINUSE 9902
+#endif
+
+#ifndef EADDRNOTAVAIL
+#define EADDRNOTAVAIL 9903
+#endif
+
+#ifndef EISCONN
+#define EISCONN 9904
+#endif
+
+#ifndef EBADMSG
+#define EBADMSG 9905
+#endif
+
+#ifndef ECONNABORTED
+#define ECONNABORTED 9906
+#endif
+
+#ifndef EALREADY
+#define EALREADY 9907
+#endif
+
+#ifndef ECONNREFUSED
+#define ECONNREFUSED 9908
+#endif
+
+#ifndef ECONNRESET
+#define ECONNRESET 9909
+#endif
+
+#ifndef EDESTADDRREQ
+#define EDESTADDRREQ 9910
+#endif
+
+#ifndef EHOSTUNREACH
+#define EHOSTUNREACH 9911
+#endif
+
+#ifndef EIDRM
+#define EIDRM 9912
+#endif
+
+#ifndef EMSGSIZE
+#define EMSGSIZE 9913
+#endif
+
+#ifndef ENETDOWN
+#define ENETDOWN 9914
+#endif
+
+#ifndef ENETRESET
+#define ENETRESET 9915
+#endif
+
+#ifndef ENETUNREACH
+#define ENETUNREACH 9916
+#endif
+
+#ifndef ENOBUFS
+#define ENOBUFS 9917
+#endif
+
+#ifndef ENOLINK
+#define ENOLINK 9918
+#endif
+
+#ifndef ENODATA
+#define ENODATA 9919
+#endif
+
+#ifndef ENOMSG
+#define ENOMSG 9920
+#endif
+
+#ifndef ENOPROTOOPT
+#define ENOPROTOOPT 9921
+#endif
+
+#ifndef ENOSR
+#define ENOSR 9922
+#endif
+
+#ifndef ENOTSOCK
+#define ENOTSOCK 9923
+#endif
+
+#ifndef ENOSTR
+#define ENOSTR 9924
+#endif
+
+#ifndef ENOTCONN
+#define ENOTCONN 9925
+#endif
+
+#ifndef ENOTSUP
+#define ENOTSUP 9926
+#endif
+
+#ifndef ECANCELED
+#define ECANCELED 9927
+#endif
+
+#ifndef EINPROGRESS
+#define EINPROGRESS 9928
+#endif
+
+#ifndef EOPNOTSUPP
+#define EOPNOTSUPP 9929
+#endif
+
+#ifndef EWOULDBLOCK
+#define EWOULDBLOCK 9930
+#endif
+
+#ifndef EOWNERDEAD
+#define EOWNERDEAD 9931
+#endif
+
+#ifndef EPROTO
+#define EPROTO 9932
+#endif
+
+#ifndef EPROTONOSUPPORT
+#define EPROTONOSUPPORT 9933
+#endif
+
+#ifndef ENOTRECOVERABLE
+#define ENOTRECOVERABLE 9934
+#endif
+
+#ifndef ETIME
+#define ETIME 9935
+#endif
+
+#ifndef ETXTBSY
+#define ETXTBSY 9936
+#endif
+
+#ifndef ETIMEDOUT
+#define ETIMEDOUT 9938
+#endif
+
+#ifndef ELOOP
+#define ELOOP 9939
+#endif
+
+#ifndef EOVERFLOW
+#define EOVERFLOW 9940
+#endif
+
+#ifndef EPROTOTYPE
+#define EPROTOTYPE 9941
+#endif
+
+#ifndef ENOSYS
+#define ENOSYS 9942
+#endif
+
+#ifndef EINVAL
+#define EINVAL 9943
+#endif
+
+#ifndef ERANGE
+#define ERANGE 9944
+#endif
+
+#ifndef EILSEQ
+#define EILSEQ 9945
+#endif
+
+// Windows Mobile doesn't appear to define these:
+
+#ifndef E2BIG
+#define E2BIG 9946
+#endif
+
+#ifndef EDOM
+#define EDOM 9947
+#endif
+
+#ifndef EFAULT
+#define EFAULT 9948
+#endif
+
+#ifndef EBADF
+#define EBADF 9949
+#endif
+
+#ifndef EPIPE
+#define EPIPE 9950
+#endif
+
+#ifndef EXDEV
+#define EXDEV 9951
+#endif
+
+#ifndef EBUSY
+#define EBUSY 9952
+#endif
+
+#ifndef ENOTEMPTY
+#define ENOTEMPTY 9953
+#endif
+
+#ifndef ENOEXEC
+#define ENOEXEC 9954
+#endif
+
+#ifndef EEXIST
+#define EEXIST 9955
+#endif
+
+#ifndef EFBIG
+#define EFBIG 9956
+#endif
+
+#ifndef ENAMETOOLONG
+#define ENAMETOOLONG 9957
+#endif
+
+#ifndef ENOTTY
+#define ENOTTY 9958
+#endif
+
+#ifndef EINTR
+#define EINTR 9959
+#endif
+
+#ifndef ESPIPE
+#define ESPIPE 9960
+#endif
+
+#ifndef EIO
+#define EIO 9961
+#endif
+
+#ifndef EISDIR
+#define EISDIR 9962
+#endif
+
+#ifndef ECHILD
+#define ECHILD 9963
+#endif
+
+#ifndef ENOLCK
+#define ENOLCK 9964
+#endif
+
+#ifndef ENOSPC
+#define ENOSPC 9965
+#endif
+
+#ifndef ENXIO
+#define ENXIO 9966
+#endif
+
+#ifndef ENODEV
+#define ENODEV 9967
+#endif
+
+#ifndef ENOENT
+#define ENOENT 9968
+#endif
+
+#ifndef ESRCH
+#define ESRCH 9969
+#endif
+
+#ifndef ENOTDIR
+#define ENOTDIR 9970
+#endif
+
+#ifndef ENOMEM
+#define ENOMEM 9971
+#endif
+
+#ifndef EPERM
+#define EPERM 9972
+#endif
+
+#ifndef EACCES
+#define EACCES 9973
+#endif
+
+#ifndef EROFS
+#define EROFS 9974
+#endif
+
+#ifndef EDEADLK
+#define EDEADLK 9975
+#endif
+
+#ifndef EAGAIN
+#define EAGAIN 9976
+#endif
+
+#ifndef ENFILE
+#define ENFILE 9977
+#endif
+
+#ifndef EMFILE
+#define EMFILE 9978
+#endif
+
+#ifndef EMLINK
+#define EMLINK 9979
+#endif
+
+#endif // __cplusplus
+
+#endif // _LIBCPP_ERRNO_H
diff --git a/include/exception b/include/exception
index 5a905e7e58d8..686e4ecd0578 100644
--- a/include/exception
+++ b/include/exception
@@ -235,7 +235,7 @@ rethrow_if_nested(const _Ep& __e, typename enable_if<
is_polymorphic<_Ep>::value
>::type* = 0)
{
- const nested_exception* __nep = dynamic_cast<const nested_exception*>(&__e);
+ const nested_exception* __nep = dynamic_cast<const nested_exception*>(_VSTD::addressof(__e));
if (__nep)
__nep->rethrow_nested();
}
diff --git a/include/experimental/algorithm b/include/experimental/algorithm
index a2e956f281a0..ffaa793b6d4e 100644
--- a/include/experimental/algorithm
+++ b/include/experimental/algorithm
@@ -50,6 +50,12 @@ SampleIterator sample(PopulationIterator first, PopulationIterator last,
_LIBCPP_BEGIN_NAMESPACE_LFTS
+template <class _ForwardIterator, class _Searcher>
+_LIBCPP_INLINE_VISIBILITY
+_ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s)
+{ return __s(__f, __l); }
+
+
template <class _PopulationIterator, class _SampleIterator, class _Distance,
class _UniformRandomNumberGenerator>
_LIBCPP_INLINE_VISIBILITY
diff --git a/include/experimental/any b/include/experimental/any
new file mode 100644
index 000000000000..603788484dd5
--- /dev/null
+++ b/include/experimental/any
@@ -0,0 +1,590 @@
+// -*- 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_EXPERIMENTAL_ANY
+#define _LIBCPP_EXPERIMENTAL_ANY
+
+/*
+ experimental/any synopsis
+
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+
+ 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 clear() noexcept;
+ void swap(any& rhs) noexcept;
+
+ // 6.3.4 any observers
+ bool empty() const noexcept;
+ const type_info& type() const noexcept;
+ };
+
+ // 6.4 Non-member functions
+ void swap(any& x, any& y) noexcept;
+
+ 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>
+#include <cassert>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS
+
+class _LIBCPP_EXCEPTION_ABI bad_any_cast : public bad_cast
+{
+public:
+ virtual const char* what() const _NOEXCEPT;
+};
+
+#if _LIBCPP_STD_VER > 11 // C++ > 11
+
+_LIBCPP_NORETURN _LIBCPP_INLINE_VISIBILITY
+inline void __throw_bad_any_cast()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_any_cast();
+#else
+ assert(!"bad_any_cast");
+#endif
+}
+
+// Forward declarations
+class any;
+
+template <class _ValueType>
+typename add_pointer<typename add_const<_ValueType>::type>::type
+any_cast(any const *) _NOEXCEPT;
+
+template <class _ValueType>
+typename add_pointer<_ValueType>::type
+any_cast(any *) _NOEXCEPT;
+
+namespace __any_imp
+{
+ typedef typename aligned_storage<3*sizeof(void*), alignment_of<void*>::value>::type
+ _Buffer;
+
+ template <class _Tp>
+ struct _IsSmallObject
+ : public 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>
+ using _Handler = typename conditional<_IsSmallObject<_Tp>::value
+ , _SmallHandler<_Tp>
+ , _LargeHandler<_Tp>
+ >::type;
+ template <class _ValueType>
+ using _EnableIfNotAny = typename
+ enable_if<
+ !is_same<typename decay<_ValueType>::type, any>::value
+ >::type;
+
+} // namespace __any_imp
+
+class any
+{
+public:
+ // 6.3.1 any construct/destruct
+ _LIBCPP_INLINE_VISIBILITY
+ 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 = __any_imp::_EnableIfNotAny<_ValueType>
+ >
+ any(_ValueType && __value);
+
+ _LIBCPP_INLINE_VISIBILITY
+ ~any()
+ {
+ this->clear();
+ }
+
+ // 6.3.2 any 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 = __any_imp::_EnableIfNotAny<_ValueType>
+ >
+ any & operator=(_ValueType && __rhs);
+
+ // 6.3.3 any modifiers
+ _LIBCPP_INLINE_VISIBILITY
+ void clear() _NOEXCEPT
+ {
+ if (__h) this->__call(_Action::_Destroy);
+ }
+
+ void swap(any & __rhs) _NOEXCEPT;
+
+ // 6.3.4 any observers
+ _LIBCPP_INLINE_VISIBILITY
+ bool empty() 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;
+
+ typedef void* (*_HandleFuncPtr)(_Action, any const *, any *, const type_info *);
+
+ union _Storage
+ {
+ void * __ptr;
+ __any_imp::_Buffer __buf;
+ };
+
+ _LIBCPP_ALWAYS_INLINE
+ void * __call(_Action __a, any * __other = nullptr,
+ type_info const * __info = nullptr) const
+ {
+ return __h(__a, this, __other, __info);
+ }
+
+ _LIBCPP_ALWAYS_INLINE
+ void * __call(_Action __a, any * __other = nullptr,
+ type_info const * __info = nullptr)
+ {
+ return __h(__a, this, __other, __info);
+ }
+
+ template <class>
+ friend struct __any_imp::_SmallHandler;
+ template <class>
+ friend struct __any_imp::_LargeHandler;
+
+ template <class _ValueType>
+ friend typename add_pointer<typename add_const<_ValueType>::type>::type
+ any_cast(any const *) _NOEXCEPT;
+
+ template <class _ValueType>
+ friend typename add_pointer<_ValueType>::type
+ any_cast(any *) _NOEXCEPT;
+
+ _HandleFuncPtr __h;
+ _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)
+ {
+ 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);
+ case _Action::_TypeInfo:
+ return __type_info();
+ }
+ }
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ static void __create(any & __dest, _Up && __v)
+ {
+ ::new (static_cast<void*>(&__dest.__s.__buf)) _Tp(_VSTD::forward<_Up>(__v));
+ __dest.__h = &_SmallHandler::__handle;
+ }
+
+ private:
+ _LIBCPP_ALWAYS_INLINE _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_ALWAYS_INLINE _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_ALWAYS_INLINE _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_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY
+ static void* __get(any & __this, type_info const * __info)
+ {
+#if !defined(_LIBCPP_NO_RTTI)
+ if (typeid(_Tp) == *__info) {
+ return static_cast<void*>(&__this.__s.__buf);
+ }
+ return nullptr;
+#else
+ return static_cast<void*>(&__this.__s.__buf);
+#endif
+ }
+
+ _LIBCPP_ALWAYS_INLINE _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)
+ {
+ 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);
+ case _Action::_TypeInfo:
+ return __type_info();
+ }
+ }
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ static void __create(any & __dest, _Up && __v)
+ {
+ 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<_Up>(__v));
+ __dest.__s.__ptr = __hold.release();
+ __dest.__h = &_LargeHandler::__handle;
+ }
+
+ private:
+
+ _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY
+ static void __destroy(any & __this)
+ {
+ delete static_cast<_Tp*>(__this.__s.__ptr);
+ __this.__h = nullptr;
+ }
+
+ _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY
+ static void __copy(any const & __this, any & __dest)
+ {
+ _LargeHandler::__create(__dest, *static_cast<_Tp const *>(__this.__s.__ptr));
+ }
+
+ _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY
+ static void __move(any & __this, any & __dest)
+ {
+ __dest.__s.__ptr = __this.__s.__ptr;
+ __dest.__h = &_LargeHandler::__handle;
+ __this.__h = nullptr;
+ }
+
+ _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY
+ static void* __get(any & __this, type_info const * __info)
+ {
+#if !defined(_LIBCPP_NO_RTTI)
+ if (typeid(_Tp) == *__info) {
+ return static_cast<void*>(__this.__s.__ptr);
+ }
+ return nullptr;
+#else
+ return static_cast<void*>(__this.__s.__ptr);
+#endif
+ }
+
+ _LIBCPP_ALWAYS_INLINE _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>
+_LIBCPP_INLINE_VISIBILITY
+any::any(_ValueType && __v) : __h(nullptr)
+{
+ typedef typename decay<_ValueType>::type _Tp;
+ static_assert(is_copy_constructible<_Tp>::value,
+ "_ValueType must be CopyConstructible.");
+ typedef __any_imp::_Handler<_Tp> _HandlerType;
+ _HandlerType::__create(*this, _VSTD::forward<_ValueType>(__v));
+}
+
+template <class _ValueType, class>
+_LIBCPP_INLINE_VISIBILITY
+any & any::operator=(_ValueType && __v)
+{
+ typedef typename decay<_ValueType>::type _Tp;
+ static_assert(is_copy_constructible<_Tp>::value,
+ "_ValueType must be CopyConstructible.");
+ any(_VSTD::forward<_ValueType>(__v)).swap(*this);
+ return *this;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void any::swap(any & __rhs) _NOEXCEPT
+{
+ 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 _ValueType>
+_LIBCPP_INLINE_VISIBILITY
+_ValueType any_cast(any const & __v)
+{
+ static_assert(
+ is_reference<_ValueType>::value
+ || is_copy_constructible<_ValueType>::value,
+ "_ValueType is required to be a reference or a CopyConstructible type.");
+ typedef typename add_const<typename remove_reference<_ValueType>::type>::type
+ _Tp;
+ _Tp * __tmp = any_cast<_Tp>(&__v);
+ if (__tmp == nullptr)
+ __throw_bad_any_cast();
+ return *__tmp;
+}
+
+template <class _ValueType>
+_LIBCPP_INLINE_VISIBILITY
+_ValueType any_cast(any & __v)
+{
+ static_assert(
+ is_reference<_ValueType>::value
+ || is_copy_constructible<_ValueType>::value,
+ "_ValueType is required to be a reference or a CopyConstructible type.");
+ typedef typename remove_reference<_ValueType>::type _Tp;
+ _Tp * __tmp = any_cast<_Tp>(&__v);
+ if (__tmp == nullptr)
+ __throw_bad_any_cast();
+ return *__tmp;
+}
+
+template <class _ValueType>
+_LIBCPP_INLINE_VISIBILITY
+_ValueType any_cast(any && __v)
+{
+ static_assert(
+ is_reference<_ValueType>::value
+ || is_copy_constructible<_ValueType>::value,
+ "_ValueType is required to be a reference or a CopyConstructible type.");
+ typedef typename remove_reference<_ValueType>::type _Tp;
+ _Tp * __tmp = any_cast<_Tp>(&__v);
+ if (__tmp == nullptr)
+ __throw_bad_any_cast();
+ return *__tmp;
+}
+
+template <class _ValueType>
+inline _LIBCPP_INLINE_VISIBILITY
+typename add_pointer<typename add_const<_ValueType>::type>::type
+any_cast(any const * __any) _NOEXCEPT
+{
+ static_assert(!is_reference<_ValueType>::value,
+ "_ValueType may not be a reference.");
+ return any_cast<_ValueType>(const_cast<any *>(__any));
+}
+
+template <class _ValueType>
+_LIBCPP_INLINE_VISIBILITY
+typename add_pointer<_ValueType>::type
+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) {
+
+ return static_cast<_ReturnType>(
+ __any->__call(_Action::_Get, nullptr,
+#if !defined(_LIBCPP_NO_RTTI)
+ &typeid(_ValueType)
+#else
+ nullptr
+#endif
+ ));
+
+ }
+ return nullptr;
+}
+
+#endif // _LIBCPP_STD_VER > 11
+
+_LIBCPP_END_NAMESPACE_LFTS
+
+#endif // _LIBCPP_EXPERIMENTAL_ANY
diff --git a/include/experimental/dynarray b/include/experimental/dynarray
index a0258628dfa6..f40a6ca188b8 100644
--- a/include/experimental/dynarray
+++ b/include/experimental/dynarray
@@ -137,7 +137,7 @@ public:
private:
size_t __size_;
value_type * __base_;
- _LIBCPP_ALWAYS_INLINE dynarray () noexcept : __base_(nullptr), __size_(0) {}
+ _LIBCPP_ALWAYS_INLINE dynarray () noexcept : __size_(0), __base_(nullptr) {}
static inline _LIBCPP_INLINE_VISIBILITY value_type* __allocate ( size_t count )
{
diff --git a/include/experimental/functional b/include/experimental/functional
new file mode 100644
index 000000000000..c7a78695b809
--- /dev/null
+++ b/include/experimental/functional
@@ -0,0 +1,454 @@
+// -*- C++ -*-
+//===-------------------------- functional --------------------------------===//
+//
+// The 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_FUNCTIONAL
+#define _LIBCPP_EXPERIMENTAL_FUNCTIONAL
+
+/*
+ experimental/functional synopsis
+
+#include <algorithm>
+
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+
+ // See C++14 20.9.9, Function object binders
+ template <class T> constexpr bool is_bind_expression_v
+ = is_bind_expression<T>::value;
+ template <class T> constexpr int is_placeholder_v
+ = is_placeholder<T>::value;
+
+ // 4.2, Class template function
+ template<class> class function; // undefined
+ template<class R, class... ArgTypes> class function<R(ArgTypes...)>;
+
+ template<class R, class... ArgTypes>
+ void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&);
+
+ template<class R, class... ArgTypes>
+ bool operator==(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
+ template<class R, class... ArgTypes>
+ bool operator==(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
+ template<class R, class... ArgTypes>
+ bool operator!=(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
+ template<class R, class... ArgTypes>
+ bool operator!=(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
+
+ // 4.3, Searchers
+ template<class ForwardIterator, class BinaryPredicate = equal_to<>>
+ class default_searcher;
+
+ template<class RandomAccessIterator,
+ class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>,
+ class BinaryPredicate = equal_to<>>
+ class boyer_moore_searcher;
+
+ template<class RandomAccessIterator,
+ class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>,
+ class BinaryPredicate = equal_to<>>
+ class boyer_moore_horspool_searcher;
+
+ template<class ForwardIterator, class BinaryPredicate = equal_to<>>
+ default_searcher<ForwardIterator, BinaryPredicate>
+ make_default_searcher(ForwardIterator pat_first, ForwardIterator pat_last,
+ BinaryPredicate pred = BinaryPredicate());
+
+ template<class RandomAccessIterator,
+ class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>,
+ class BinaryPredicate = equal_to<>>
+ boyer_moore_searcher<RandomAccessIterator, Hash, BinaryPredicate>
+ make_boyer_moore_searcher(
+ RandomAccessIterator pat_first, RandomAccessIterator pat_last,
+ Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+
+ template<class RandomAccessIterator,
+ class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>,
+ class BinaryPredicate = equal_to<>>
+ boyer_moore_horspool_searcher<RandomAccessIterator, Hash, BinaryPredicate>
+ make_boyer_moore_horspool_searcher(
+ RandomAccessIterator pat_first, RandomAccessIterator pat_last,
+ Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+
+ } // namespace fundamentals_v1
+ } // namespace experimental
+
+ template<class R, class... ArgTypes, class Alloc>
+ struct uses_allocator<experimental::function<R(ArgTypes...)>, Alloc>;
+
+} // namespace std
+
+*/
+
+#include <experimental/__config>
+#include <functional>
+
+#include <algorithm>
+#include <type_traits>
+#include <vector>
+#include <array>
+#include <unordered_map>
+
+#include <__undef_min_max>
+
+#include <__debug>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS
+
+#if _LIBCPP_STD_VER > 11
+// default searcher
+template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
+_LIBCPP_TYPE_VIS
+class default_searcher {
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ default_searcher(_ForwardIterator __f, _ForwardIterator __l,
+ _BinaryPredicate __p = _BinaryPredicate())
+ : __first_(__f), __last_(__l), __pred_(__p) {}
+
+ template <typename _ForwardIterator2>
+ _LIBCPP_INLINE_VISIBILITY
+ _ForwardIterator2 operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
+ {
+ return _VSTD::search(__f, __l, __first_, __last_, __pred_);
+ }
+
+private:
+ _ForwardIterator __first_;
+ _ForwardIterator __last_;
+ _BinaryPredicate __pred_;
+ };
+
+template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
+_LIBCPP_INLINE_VISIBILITY
+default_searcher<_ForwardIterator, _BinaryPredicate>
+make_default_searcher( _ForwardIterator __f, _ForwardIterator __l, _BinaryPredicate __p = _BinaryPredicate ())
+{
+ return default_searcher<_ForwardIterator, _BinaryPredicate>(__f, __l, __p);
+}
+
+template<class _Key, class _Value, class _Hash, class _BinaryPredicate, bool /*useArray*/> class _BMSkipTable;
+
+// General case for BM data searching; use a map
+template<class _Key, typename _Value, class _Hash, class _BinaryPredicate>
+class _BMSkipTable<_Key, _Value, _Hash, _BinaryPredicate, false> {
+public: // TODO private:
+ typedef _Value value_type;
+ typedef _Key key_type;
+
+ const _Value __default_value_;
+ std::unordered_map<_Key, _Value, _Hash, _BinaryPredicate> __table;
+
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ _BMSkipTable(std::size_t __sz, _Value __default, _Hash __hf, _BinaryPredicate __pred)
+ : __default_value_(__default), __table(__sz, __hf, __pred) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ void insert(const key_type &__key, value_type __val)
+ {
+ __table [__key] = __val; // Would skip_.insert (val) be better here?
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ value_type operator [](const key_type & __key) const
+ {
+ auto __it = __table.find (__key);
+ return __it == __table.end() ? __default_value_ : __it->second;
+ }
+};
+
+
+// Special case small numeric values; use an array
+template<class _Key, typename _Value, class _Hash, class _BinaryPredicate>
+class _BMSkipTable<_Key, _Value, _Hash, _BinaryPredicate, true> {
+private:
+ typedef _Value value_type;
+ typedef _Key key_type;
+
+ typedef typename std::make_unsigned<key_type>::type unsigned_key_type;
+ typedef std::array<value_type, _VSTD::numeric_limits<unsigned_key_type>::max()> skip_map;
+ skip_map __table;
+
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ _BMSkipTable(std::size_t /*__sz*/, _Value __default, _Hash /*__hf*/, _BinaryPredicate /*__pred*/)
+ {
+ std::fill_n(__table.begin(), __table.size(), __default);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void insert(key_type __key, value_type __val)
+ {
+ __table[static_cast<unsigned_key_type>(__key)] = __val;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ value_type operator [](key_type __key) const
+ {
+ return __table[static_cast<unsigned_key_type>(__key)];
+ }
+};
+
+
+template <class _RandomAccessIterator1,
+ class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>,
+ class _BinaryPredicate = equal_to<>>
+_LIBCPP_TYPE_VIS
+class boyer_moore_searcher {
+private:
+ typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type;
+ typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type value_type;
+ typedef _BMSkipTable<value_type, difference_type, _Hash, _BinaryPredicate,
+ _VSTD::is_integral<value_type>::value && // what about enums?
+ sizeof(value_type) == 1 &&
+ is_same<_Hash, hash<value_type>>::value &&
+ is_same<_BinaryPredicate, equal_to<>>::value
+ > skip_table_type;
+
+public:
+ boyer_moore_searcher(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l,
+ _Hash __hf = _Hash(), _BinaryPredicate __pred = _BinaryPredicate())
+ : __first_(__f), __last_(__l), __pred_(__pred),
+ __pattern_length_(_VSTD::distance(__first_, __last_)),
+ __skip_{make_shared<skip_table_type>(__pattern_length_, -1, __hf, __pred_)},
+ __suffix_{make_shared<vector<difference_type>>(__pattern_length_ + 1)}
+ {
+ // build the skip table
+ for ( difference_type __i = 0; __f != __l; ++__f, (void) ++__i )
+ __skip_->insert(*__f, __i);
+
+ this->__build_suffix_table ( __first_, __last_, __pred_ );
+ }
+
+ template <typename _RandomAccessIterator2>
+ _RandomAccessIterator2
+ operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const
+ {
+ static_assert ( std::is_same<
+ typename std::decay<typename std::iterator_traits<_RandomAccessIterator1>::value_type>::type,
+ typename std::decay<typename std::iterator_traits<_RandomAccessIterator2>::value_type>::type
+ >::value,
+ "Corpus and Pattern iterators must point to the same type" );
+
+ if (__f == __l ) return __l; // empty corpus
+ if (__first_ == __last_) return __f; // empty pattern
+
+ // If the pattern is larger than the corpus, we can't find it!
+ if ( __pattern_length_ > _VSTD::distance (__f, __l))
+ return __l;
+
+ // Do the search
+ return this->__search(__f, __l);
+ }
+
+public: // TODO private:
+ _RandomAccessIterator1 __first_;
+ _RandomAccessIterator1 __last_;
+ _BinaryPredicate __pred_;
+ difference_type __pattern_length_;
+ shared_ptr<skip_table_type> __skip_;
+ shared_ptr<vector<difference_type>> __suffix_;
+
+ template <typename _RandomAccessIterator2>
+ _RandomAccessIterator2 __search(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const
+ {
+ _RandomAccessIterator2 __cur = __f;
+ const _RandomAccessIterator2 __last = __l - __pattern_length_;
+ const skip_table_type & __skip = *__skip_.get();
+ const vector<difference_type> & __suffix = *__suffix_.get();
+
+ while (__cur <= __last)
+ {
+
+ // Do we match right where we are?
+ difference_type __j = __pattern_length_;
+ while (__pred_(__first_ [__j-1], __cur [__j-1])) {
+ __j--;
+ // We matched - we're done!
+ if ( __j == 0 )
+ return __cur;
+ }
+
+ // Since we didn't match, figure out how far to skip forward
+ difference_type __k = __skip[__cur [ __j - 1 ]];
+ difference_type __m = __j - __k - 1;
+ if (__k < __j && __m > __suffix[ __j ])
+ __cur += __m;
+ else
+ __cur += __suffix[ __j ];
+ }
+
+ return __l; // We didn't find anything
+ }
+
+
+ template<typename _Iterator, typename _Container>
+ void __compute_bm_prefix ( _Iterator __f, _Iterator __l, _BinaryPredicate __pred, _Container &__prefix )
+ {
+ const std::size_t __count = _VSTD::distance(__f, __l);
+
+ __prefix[0] = 0;
+ std::size_t __k = 0;
+ for ( std::size_t __i = 1; __i < __count; ++__i )
+ {
+ while ( __k > 0 && !__pred ( __f[__k], __f[__i] ))
+ __k = __prefix [ __k - 1 ];
+
+ if ( __pred ( __f[__k], __f[__i] ))
+ __k++;
+ __prefix [ __i ] = __k;
+ }
+ }
+
+ void __build_suffix_table(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l,
+ _BinaryPredicate __pred)
+ {
+ const std::size_t __count = _VSTD::distance(__f, __l);
+ vector<difference_type> & __suffix = *__suffix_.get();
+ if (__count > 0)
+ {
+ _VSTD::vector<value_type> __scratch(__count);
+
+ __compute_bm_prefix(__f, __l, __pred, __scratch);
+ for ( std::size_t __i = 0; __i <= __count; __i++ )
+ __suffix[__i] = __count - __scratch[__count-1];
+
+ typedef _VSTD::reverse_iterator<_RandomAccessIterator1> _RevIter;
+ __compute_bm_prefix(_RevIter(__l), _RevIter(__f), __pred, __scratch);
+
+ for ( std::size_t __i = 0; __i < __count; __i++ )
+ {
+ const std::size_t __j = __count - __scratch[__i];
+ const difference_type __k = __i - __scratch[__i] + 1;
+
+ if (__suffix[__j] > __k)
+ __suffix[__j] = __k;
+ }
+ }
+ }
+
+};
+
+template<class _RandomAccessIterator,
+ class _Hash = hash<typename iterator_traits<_RandomAccessIterator>::value_type>,
+ class _BinaryPredicate = equal_to<>>
+_LIBCPP_INLINE_VISIBILITY
+boyer_moore_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>
+make_boyer_moore_searcher( _RandomAccessIterator __f, _RandomAccessIterator __l,
+ _Hash __hf = _Hash(), _BinaryPredicate __p = _BinaryPredicate ())
+{
+ return boyer_moore_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>(__f, __l, __hf, __p);
+}
+
+// boyer-moore-horspool
+template <class _RandomAccessIterator1,
+ class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>,
+ class _BinaryPredicate = equal_to<>>
+_LIBCPP_TYPE_VIS
+class boyer_moore_horspool_searcher {
+private:
+ typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type;
+ typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type value_type;
+ typedef _BMSkipTable<value_type, difference_type, _Hash, _BinaryPredicate,
+ _VSTD::is_integral<value_type>::value && // what about enums?
+ sizeof(value_type) == 1 &&
+ is_same<_Hash, hash<value_type>>::value &&
+ is_same<_BinaryPredicate, equal_to<>>::value
+ > skip_table_type;
+
+public:
+ boyer_moore_horspool_searcher(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l,
+ _Hash __hf = _Hash(), _BinaryPredicate __pred = _BinaryPredicate())
+ : __first_(__f), __last_(__l), __pred_(__pred),
+ __pattern_length_(_VSTD::distance(__first_, __last_)),
+ __skip_{_VSTD::make_shared<skip_table_type>(__pattern_length_, __pattern_length_, __hf, __pred_)}
+ {
+ // build the skip table
+ if ( __f != __l )
+ {
+ __l = __l - 1;
+ for ( difference_type __i = 0; __f != __l; ++__f, (void) ++__i )
+ __skip_->insert(*__f, __pattern_length_ - 1 - __i);
+ }
+ }
+
+ template <typename _RandomAccessIterator2>
+ _RandomAccessIterator2
+ operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const
+ {
+ static_assert ( std::is_same<
+ typename std::decay<typename std::iterator_traits<_RandomAccessIterator1>::value_type>::type,
+ typename std::decay<typename std::iterator_traits<_RandomAccessIterator2>::value_type>::type
+ >::value,
+ "Corpus and Pattern iterators must point to the same type" );
+
+ if (__f == __l ) return __l; // empty corpus
+ if (__first_ == __last_) return __f; // empty pattern
+
+ // If the pattern is larger than the corpus, we can't find it!
+ if ( __pattern_length_ > _VSTD::distance (__f, __l))
+ return __l;
+
+ // Do the search
+ return this->__search(__f, __l);
+ }
+
+private:
+ _RandomAccessIterator1 __first_;
+ _RandomAccessIterator1 __last_;
+ _BinaryPredicate __pred_;
+ difference_type __pattern_length_;
+ shared_ptr<skip_table_type> __skip_;
+
+ template <typename _RandomAccessIterator2>
+ _RandomAccessIterator2 __search ( _RandomAccessIterator2 __f, _RandomAccessIterator2 __l ) const {
+ _RandomAccessIterator2 __cur = __f;
+ const _RandomAccessIterator2 __last = __l - __pattern_length_;
+ const skip_table_type & __skip = *__skip_.get();
+
+ while (__cur <= __last)
+ {
+ // Do we match right where we are?
+ difference_type __j = __pattern_length_;
+ while (__pred_(__first_[__j-1], __cur[__j-1]))
+ {
+ __j--;
+ // We matched - we're done!
+ if ( __j == 0 )
+ return __cur;
+ }
+ __cur += __skip[__cur[__pattern_length_-1]];
+ }
+
+ return __l;
+ }
+};
+
+template<class _RandomAccessIterator,
+ class _Hash = hash<typename iterator_traits<_RandomAccessIterator>::value_type>,
+ class _BinaryPredicate = equal_to<>>
+_LIBCPP_INLINE_VISIBILITY
+boyer_moore_horspool_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>
+make_boyer_moore_horspool_searcher( _RandomAccessIterator __f, _RandomAccessIterator __l,
+ _Hash __hf = _Hash(), _BinaryPredicate __p = _BinaryPredicate ())
+{
+ return boyer_moore_horspool_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>(__f, __l, __hf, __p);
+}
+
+#endif // _LIBCPP_STD_VER > 11
+
+_LIBCPP_END_NAMESPACE_LFTS
+
+#endif /* _LIBCPP_EXPERIMENTAL_FUNCTIONAL */
diff --git a/include/ext/hash_map b/include/ext/hash_map
index 31fcedfb9f9e..0e4ab6910eb5 100644
--- a/include/ext/hash_map
+++ b/include/ext/hash_map
@@ -681,7 +681,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
__h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
__h.get_deleter().__second_constructed = true;
- return _VSTD::move(__h); // explicitly moved for C++03
+ return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
diff --git a/include/float.h b/include/float.h
new file mode 100644
index 000000000000..1acfdc6188f2
--- /dev/null
+++ b/include/float.h
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+//===--------------------------- float.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_FLOAT_H
+#define _LIBCPP_FLOAT_H
+
+/*
+ float.h synopsis
+
+Macros:
+
+ FLT_ROUNDS
+ FLT_EVAL_METHOD // C99
+ FLT_RADIX
+
+ FLT_MANT_DIG
+ DBL_MANT_DIG
+ LDBL_MANT_DIG
+
+ DECIMAL_DIG // C99
+
+ FLT_DIG
+ DBL_DIG
+ LDBL_DIG
+
+ FLT_MIN_EXP
+ DBL_MIN_EXP
+ LDBL_MIN_EXP
+
+ FLT_MIN_10_EXP
+ DBL_MIN_10_EXP
+ LDBL_MIN_10_EXP
+
+ FLT_MAX_EXP
+ DBL_MAX_EXP
+ LDBL_MAX_EXP
+
+ FLT_MAX_10_EXP
+ DBL_MAX_10_EXP
+ LDBL_MAX_10_EXP
+
+ FLT_MAX
+ DBL_MAX
+ LDBL_MAX
+
+ FLT_EPSILON
+ DBL_EPSILON
+ LDBL_EPSILON
+
+ FLT_MIN
+ DBL_MIN
+ LDBL_MIN
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <float.h>
+
+#ifdef __cplusplus
+
+#ifndef FLT_EVAL_METHOD
+#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+#endif
+
+#ifndef DECIMAL_DIG
+#define DECIMAL_DIG __DECIMAL_DIG__
+#endif
+
+#endif // __cplusplus
+
+#endif // _LIBCPP_FLOAT_H
diff --git a/include/forward_list b/include/forward_list
index 8a87fc5e1f26..adbc32cf861c 100644
--- a/include/forward_list
+++ b/include/forward_list
@@ -537,6 +537,9 @@ public:
typedef _Tp value_type;
typedef _Alloc allocator_type;
+ static_assert((is_same<typename allocator_type::value_type, value_type>::value),
+ "Allocator::value_type must be same type as value_type");
+
typedef value_type& reference;
typedef const value_type& const_reference;
typedef typename allocator_traits<allocator_type>::pointer pointer;
diff --git a/include/functional b/include/functional
index 5ee941763020..dbe9b01bbd86 100644
--- a/include/functional
+++ b/include/functional
@@ -1234,11 +1234,9 @@ const_mem_fun1_ref_t<_Sp,_Tp,_Ap>
mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const)
{return const_mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
-#ifdef _LIBCPP_HAS_NO_VARIADICS
-
-#include <__functional_03>
-
-#else // _LIBCPP_HAS_NO_VARIADICS
+////////////////////////////////////////////////////////////////////////////////
+// MEMFUN
+//==============================================================================
template <class _Tp>
class __mem_fn
@@ -1251,26 +1249,130 @@ private:
type __f_;
public:
- _LIBCPP_INLINE_VISIBILITY __mem_fn(type __f) : __f_(__f) {}
+ _LIBCPP_INLINE_VISIBILITY __mem_fn(type __f) _NOEXCEPT : __f_(__f) {}
+#ifndef _LIBCPP_HAS_NO_VARIADICS
// invoke
template <class... _ArgTypes>
- _LIBCPP_INLINE_VISIBILITY
- typename __invoke_return<type, _ArgTypes...>::type
- operator() (_ArgTypes&&... __args) const
- {
- return __invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...);
- }
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return<type, _ArgTypes...>::type
+ operator() (_ArgTypes&&... __args) const {
+ return __invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...);
+ }
+#else
+
+ template <class _A0>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return0<type, _A0>::type
+ operator() (_A0& __a0) const {
+ return __invoke(__f_, __a0);
+ }
+
+ template <class _A0>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return0<type, _A0 const>::type
+ operator() (_A0 const& __a0) const {
+ return __invoke(__f_, __a0);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0, _A1>::type
+ operator() (_A0& __a0, _A1& __a1) const {
+ return __invoke(__f_, __a0, __a1);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0 const, _A1>::type
+ operator() (_A0 const& __a0, _A1& __a1) const {
+ return __invoke(__f_, __a0, __a1);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0, _A1 const>::type
+ operator() (_A0& __a0, _A1 const& __a1) const {
+ return __invoke(__f_, __a0, __a1);
+ }
+
+ template <class _A0, class _A1>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return1<type, _A0 const, _A1 const>::type
+ operator() (_A0 const& __a0, _A1 const& __a1) const {
+ return __invoke(__f_, __a0, __a1);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1, _A2>::type
+ operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {
+ return __invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1, _A2>::type
+ operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {
+ return __invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1 const, _A2>::type
+ operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {
+ return __invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1, _A2 const>::type
+ operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {
+ return __invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type
+ operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const {
+ return __invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type
+ operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const {
+ return __invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type
+ operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const {
+ return __invoke(__f_, __a0, __a1, __a2);
+ }
+
+ template <class _A0, class _A1, class _A2>
+ _LIBCPP_INLINE_VISIBILITY
+ typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type
+ operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {
+ return __invoke(__f_, __a0, __a1, __a2);
+ }
+#endif
};
template<class _Rp, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
__mem_fn<_Rp _Tp::*>
-mem_fn(_Rp _Tp::* __pm)
+mem_fn(_Rp _Tp::* __pm) _NOEXCEPT
{
return __mem_fn<_Rp _Tp::*>(__pm);
}
+////////////////////////////////////////////////////////////////////////////////
+// FUNCTION
+//==============================================================================
+
// bad_function_call
class _LIBCPP_EXCEPTION_ABI bad_function_call
@@ -1283,7 +1385,7 @@ template<class _Fp> class _LIBCPP_TYPE_VIS_ONLY function; // undefined
namespace __function
{
-template<class _Rp, class ..._ArgTypes>
+template<class _Rp>
struct __maybe_derive_from_unary_function
{
};
@@ -1294,7 +1396,7 @@ struct __maybe_derive_from_unary_function<_Rp(_A1)>
{
};
-template<class _Rp, class ..._ArgTypes>
+template<class _Rp>
struct __maybe_derive_from_binary_function
{
};
@@ -1305,6 +1407,28 @@ struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)>
{
};
+template <class _Fp>
+_LIBCPP_INLINE_VISIBILITY
+bool __not_null(_Fp const&) { return true; }
+
+template <class _Fp>
+_LIBCPP_INLINE_VISIBILITY
+bool __not_null(_Fp* __ptr) { return __ptr; }
+
+template <class _Ret, class _Class>
+_LIBCPP_INLINE_VISIBILITY
+bool __not_null(_Ret _Class::*__ptr) { return __ptr; }
+
+template <class _Fp>
+_LIBCPP_INLINE_VISIBILITY
+bool __not_null(function<_Fp> const& __f) { return !!__f; }
+
+} // namespace __function
+
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
+namespace __function {
+
template<class _Fp> class __base;
template<class _Rp, class ..._ArgTypes>
@@ -1440,28 +1564,6 @@ class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_ArgTypes...)>
typename aligned_storage<3*sizeof(void*)>::type __buf_;
__base* __f_;
- template <class _Fp>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(const _Fp&) {return true;}
- template <class _R2, class ..._Ap>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (*__p)(_Ap...)) {return __p;}
- template <class _R2, class _Cp, class ..._Ap>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)(_Ap...)) {return __p;}
- template <class _R2, class _Cp, class ..._Ap>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)(_Ap...) const) {return __p;}
- template <class _R2, class _Cp, class ..._Ap>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)(_Ap...) volatile) {return __p;}
- template <class _R2, class _Cp, class ..._Ap>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(_R2 (_Cp::*__p)(_Ap...) const volatile) {return __p;}
- template <class _R2, class ..._Ap>
- _LIBCPP_INLINE_VISIBILITY
- static bool __not_null(const function<_R2(_Ap...)>& __p) {return !!__p;}
-
template <class _Fp, bool = !is_same<_Fp, function>::value &&
__invokable<_Fp&, _ArgTypes...>::value>
struct __callable;
@@ -1626,7 +1728,7 @@ function<_Rp(_ArgTypes...)>::function(_Fp __f,
>::type*)
: __f_(0)
{
- if (__not_null(__f))
+ if (__function::__not_null(__f))
{
typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_ArgTypes...)> _FF;
if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_Fp>::value)
@@ -1653,7 +1755,7 @@ function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _Fp _
: __f_(0)
{
typedef allocator_traits<_Alloc> __alloc_traits;
- if (__not_null(__f))
+ if (__function::__not_null(__f))
{
typedef __function::__func<_Fp, _Alloc, _Rp(_ArgTypes...)> _FF;
typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap;
@@ -1848,6 +1950,16 @@ void
swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCEPT
{return __x.swap(__y);}
+#else // _LIBCPP_HAS_NO_VARIADICS
+
+#include <__functional_03>
+
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// BIND
+//==============================================================================
+
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> {};
@@ -1878,6 +1990,9 @@ template<int _Np>
struct __is_placeholder<placeholders::__ph<_Np> >
: public integral_constant<int, _Np> {};
+
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
template <class _Tp, class _Uj>
inline _LIBCPP_INLINE_VISIBILITY
_Tp&
@@ -2402,14 +2517,14 @@ struct _LIBCPP_TYPE_VIS_ONLY hash<long double>
size_t __b;
size_t __c;
size_t __d;
- };
+ } __s;
} __u;
- __u.__a = 0;
- __u.__b = 0;
- __u.__c = 0;
- __u.__d = 0;
+ __u.__s.__a = 0;
+ __u.__s.__b = 0;
+ __u.__s.__c = 0;
+ __u.__s.__d = 0;
__u.__t = __v;
- return __u.__a ^ __u.__b ^ __u.__c ^ __u.__d;
+ return __u.__s.__a ^ __u.__s.__b ^ __u.__s.__c ^ __u.__s.__d;
#elif defined(__x86_64__)
// Zero out padding bits
union
@@ -2419,12 +2534,12 @@ struct _LIBCPP_TYPE_VIS_ONLY hash<long double>
{
size_t __a;
size_t __b;
- };
+ } __s;
} __u;
- __u.__a = 0;
- __u.__b = 0;
+ __u.__s.__a = 0;
+ __u.__s.__b = 0;
__u.__t = __v;
- return __u.__a ^ __u.__b;
+ return __u.__s.__a ^ __u.__s.__b;
#else
return __scalar_hash<long double>::operator()(__v);
#endif
diff --git a/include/future b/include/future
index 5b5afe6e2771..ce15eafbf7e4 100644
--- a/include/future
+++ b/include/future
@@ -512,6 +512,16 @@ public:
virtual ~future_error() _NOEXCEPT;
};
+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");
+#endif
+}
+
class _LIBCPP_TYPE_VIS __assoc_sub_state
: public __shared_count
{
@@ -566,6 +576,7 @@ public:
void wait();
template <class _Rep, class _Period>
future_status
+ _LIBCPP_INLINE_VISIBILITY
wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const;
template <class _Clock, class _Duration>
future_status
@@ -589,7 +600,7 @@ __assoc_sub_state::wait_until(const chrono::time_point<_Clock, _Duration>& __abs
}
template <class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
future_status
__assoc_sub_state::wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const
{
@@ -645,10 +656,8 @@ __assoc_state<_Rp>::set_value(_Arg& __arg)
#endif
{
unique_lock<mutex> __lk(this->__mut_);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (this->__has_value())
- throw future_error(make_error_code(future_errc::promise_already_satisfied));
-#endif
+ __throw_future_error(future_errc::promise_already_satisfied);
::new(&__value_) _Rp(_VSTD::forward<_Arg>(__arg));
this->__state_ |= base::__constructed | base::ready;
__cv_.notify_all();
@@ -664,10 +673,8 @@ __assoc_state<_Rp>::set_value_at_thread_exit(_Arg& __arg)
#endif
{
unique_lock<mutex> __lk(this->__mut_);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (this->__has_value())
- throw future_error(make_error_code(future_errc::promise_already_satisfied));
-#endif
+ __throw_future_error(future_errc::promise_already_satisfied);
::new(&__value_) _Rp(_VSTD::forward<_Arg>(__arg));
this->__state_ |= base::__constructed;
__thread_local_data()->__make_ready_at_thread_exit(this);
@@ -725,10 +732,8 @@ void
__assoc_state<_Rp&>::set_value(_Rp& __arg)
{
unique_lock<mutex> __lk(this->__mut_);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (this->__has_value())
- throw future_error(make_error_code(future_errc::promise_already_satisfied));
-#endif
+ __throw_future_error(future_errc::promise_already_satisfied);
__value_ = _VSTD::addressof(__arg);
this->__state_ |= base::__constructed | base::ready;
__cv_.notify_all();
@@ -739,10 +744,8 @@ void
__assoc_state<_Rp&>::set_value_at_thread_exit(_Rp& __arg)
{
unique_lock<mutex> __lk(this->__mut_);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (this->__has_value())
- throw future_error(make_error_code(future_errc::promise_already_satisfied));
-#endif
+ __throw_future_error(future_errc::promise_already_satisfied);
__value_ = _VSTD::addressof(__arg);
this->__state_ |= base::__constructed;
__thread_local_data()->__make_ready_at_thread_exit(this);
@@ -849,6 +852,7 @@ class __deferred_assoc_state
public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
explicit __deferred_assoc_state(_Fp&& __f);
#endif
@@ -858,7 +862,7 @@ public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Rp, class _Fp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f)
: __func_(_VSTD::forward<_Fp>(__f))
{
@@ -895,6 +899,7 @@ class __deferred_assoc_state<void, _Fp>
public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
explicit __deferred_assoc_state(_Fp&& __f);
#endif
@@ -904,7 +909,7 @@ public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Fp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__deferred_assoc_state<void, _Fp>::__deferred_assoc_state(_Fp&& __f)
: __func_(_VSTD::forward<_Fp>(__f))
{
@@ -943,6 +948,7 @@ class __async_assoc_state
virtual void __on_zero_shared() _NOEXCEPT;
public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
explicit __async_assoc_state(_Fp&& __f);
#endif
@@ -952,7 +958,7 @@ public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Rp, class _Fp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f)
: __func_(_VSTD::forward<_Fp>(__f))
{
@@ -997,6 +1003,7 @@ class __async_assoc_state<void, _Fp>
virtual void __on_zero_shared() _NOEXCEPT;
public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
explicit __async_assoc_state(_Fp&& __f);
#endif
@@ -1006,7 +1013,7 @@ public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Fp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__async_assoc_state<void, _Fp>::__async_assoc_state(_Fp&& __f)
: __func_(_VSTD::forward<_Fp>(__f))
{
@@ -1108,6 +1115,7 @@ private:
public:
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~future();
+ _LIBCPP_INLINE_VISIBILITY
shared_future<_Rp> share();
// retrieving the value
@@ -1138,10 +1146,8 @@ template <class _Rp>
future<_Rp>::future(__assoc_state<_Rp>* __state)
: __state_(__state)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_->__has_future_attached())
- throw future_error(make_error_code(future_errc::future_already_retrieved));
-#endif
+ __throw_future_error(future_errc::future_already_retrieved);
__state_->__add_shared();
__state_->__set_future_attached();
}
@@ -1212,6 +1218,7 @@ private:
public:
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~future();
+ _LIBCPP_INLINE_VISIBILITY
shared_future<_Rp&> share();
// retrieving the value
@@ -1242,10 +1249,8 @@ template <class _Rp>
future<_Rp&>::future(__assoc_state<_Rp&>* __state)
: __state_(__state)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_->__has_future_attached())
- throw future_error(make_error_code(future_errc::future_already_retrieved));
-#endif
+ __throw_future_error(future_errc::future_already_retrieved);
__state_->__add_shared();
__state_->__set_future_attached();
}
@@ -1311,6 +1316,7 @@ private:
public:
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~future();
+ _LIBCPP_INLINE_VISIBILITY
shared_future<void> share();
// retrieving the value
@@ -1445,10 +1451,8 @@ template <class _Rp>
future<_Rp>
promise<_Rp>::get_future()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
-#endif
+ __throw_future_error(future_errc::no_state);
return future<_Rp>(__state_);
}
@@ -1456,10 +1460,8 @@ template <class _Rp>
void
promise<_Rp>::set_value(const _Rp& __r)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
-#endif
+ __throw_future_error(future_errc::no_state);
__state_->set_value(__r);
}
@@ -1469,10 +1471,8 @@ template <class _Rp>
void
promise<_Rp>::set_value(_Rp&& __r)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
-#endif
+ __throw_future_error(future_errc::no_state);
__state_->set_value(_VSTD::move(__r));
}
@@ -1482,10 +1482,8 @@ template <class _Rp>
void
promise<_Rp>::set_exception(exception_ptr __p)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
-#endif
+ __throw_future_error(future_errc::no_state);
__state_->set_exception(__p);
}
@@ -1493,10 +1491,8 @@ template <class _Rp>
void
promise<_Rp>::set_value_at_thread_exit(const _Rp& __r)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
-#endif
+ __throw_future_error(future_errc::no_state);
__state_->set_value_at_thread_exit(__r);
}
@@ -1506,10 +1502,8 @@ template <class _Rp>
void
promise<_Rp>::set_value_at_thread_exit(_Rp&& __r)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
-#endif
+ __throw_future_error(future_errc::no_state);
__state_->set_value_at_thread_exit(_VSTD::move(__r));
}
@@ -1519,10 +1513,8 @@ template <class _Rp>
void
promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
-#endif
+ __throw_future_error(future_errc::no_state);
__state_->set_exception_at_thread_exit(__p);
}
@@ -1619,10 +1611,8 @@ template <class _Rp>
future<_Rp&>
promise<_Rp&>::get_future()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
-#endif
+ __throw_future_error(future_errc::no_state);
return future<_Rp&>(__state_);
}
@@ -1630,10 +1620,8 @@ template <class _Rp>
void
promise<_Rp&>::set_value(_Rp& __r)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
-#endif
+ __throw_future_error(future_errc::no_state);
__state_->set_value(__r);
}
@@ -1641,10 +1629,8 @@ template <class _Rp>
void
promise<_Rp&>::set_exception(exception_ptr __p)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
-#endif
+ __throw_future_error(future_errc::no_state);
__state_->set_exception(__p);
}
@@ -1652,10 +1638,8 @@ template <class _Rp>
void
promise<_Rp&>::set_value_at_thread_exit(_Rp& __r)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
-#endif
+ __throw_future_error(future_errc::no_state);
__state_->set_value_at_thread_exit(__r);
}
@@ -1663,10 +1647,8 @@ template <class _Rp>
void
promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
-#endif
+ __throw_future_error(future_errc::no_state);
__state_->set_exception_at_thread_exit(__p);
}
@@ -1861,6 +1843,7 @@ public:
void swap(__packaged_task_function&) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
_Rp operator()(_ArgTypes...) const;
};
@@ -2000,7 +1983,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::swap(__packaged_task_function& __f)
}
template<class _Rp, class ..._ArgTypes>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_Rp
__packaged_task_function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
{
@@ -2087,11 +2070,11 @@ template<class _Rp, class ..._ArgTypes>
void
packaged_task<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __args)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__p_.__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
+ __throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
- throw future_error(make_error_code(future_errc::promise_already_satisfied));
+ __throw_future_error(future_errc::promise_already_satisfied);
+#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
@@ -2109,11 +2092,11 @@ template<class _Rp, class ..._ArgTypes>
void
packaged_task<_Rp(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__p_.__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
+ __throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
- throw future_error(make_error_code(future_errc::promise_already_satisfied));
+ __throw_future_error(future_errc::promise_already_satisfied);
+#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
@@ -2131,10 +2114,8 @@ template<class _Rp, class ..._ArgTypes>
void
packaged_task<_Rp(_ArgTypes...)>::reset()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (!valid())
- throw future_error(make_error_code(future_errc::no_state));
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_future_error(future_errc::no_state);
__p_ = promise<result_type>();
}
@@ -2218,11 +2199,11 @@ template<class ..._ArgTypes>
void
packaged_task<void(_ArgTypes...)>::operator()(_ArgTypes... __args)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__p_.__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
+ __throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
- throw future_error(make_error_code(future_errc::promise_already_satisfied));
+ __throw_future_error(future_errc::promise_already_satisfied);
+#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
@@ -2241,11 +2222,11 @@ template<class ..._ArgTypes>
void
packaged_task<void(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__p_.__state_ == nullptr)
- throw future_error(make_error_code(future_errc::no_state));
+ __throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
- throw future_error(make_error_code(future_errc::promise_already_satisfied));
+ __throw_future_error(future_errc::promise_already_satisfied);
+#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
@@ -2264,10 +2245,8 @@ template<class ..._ArgTypes>
void
packaged_task<void(_ArgTypes...)>::reset()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (!valid())
- throw future_error(make_error_code(future_errc::no_state));
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_future_error(future_errc::no_state);
__p_ = promise<result_type>();
}
@@ -2592,7 +2571,7 @@ swap(shared_future<_Rp>& __x, shared_future<_Rp>& __y) _NOEXCEPT
}
template <class _Rp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
shared_future<_Rp>
future<_Rp>::share()
{
@@ -2600,7 +2579,7 @@ future<_Rp>::share()
}
template <class _Rp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
shared_future<_Rp&>
future<_Rp&>::share()
{
@@ -2609,7 +2588,7 @@ future<_Rp&>::share()
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-inline _LIBCPP_INLINE_VISIBILITY
+inline
shared_future<void>
future<void>::share()
{
diff --git a/include/inttypes.h b/include/inttypes.h
new file mode 100644
index 000000000000..5c5618bef884
--- /dev/null
+++ b/include/inttypes.h
@@ -0,0 +1,251 @@
+// -*- C++ -*-
+//===--------------------------- inttypes.h -------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_INTTYPES_H
+#define _LIBCPP_INTTYPES_H
+
+/*
+ inttypes.h synopsis
+
+This entire header is C99 / C++0X
+
+#include <stdint.h> // <cinttypes> includes <cstdint>
+
+Macros:
+
+ PRId8
+ PRId16
+ PRId32
+ PRId64
+
+ PRIdLEAST8
+ PRIdLEAST16
+ PRIdLEAST32
+ PRIdLEAST64
+
+ PRIdFAST8
+ PRIdFAST16
+ PRIdFAST32
+ PRIdFAST64
+
+ PRIdMAX
+ PRIdPTR
+
+ PRIi8
+ PRIi16
+ PRIi32
+ PRIi64
+
+ PRIiLEAST8
+ PRIiLEAST16
+ PRIiLEAST32
+ PRIiLEAST64
+
+ PRIiFAST8
+ PRIiFAST16
+ PRIiFAST32
+ PRIiFAST64
+
+ PRIiMAX
+ PRIiPTR
+
+ PRIo8
+ PRIo16
+ PRIo32
+ PRIo64
+
+ PRIoLEAST8
+ PRIoLEAST16
+ PRIoLEAST32
+ PRIoLEAST64
+
+ PRIoFAST8
+ PRIoFAST16
+ PRIoFAST32
+ PRIoFAST64
+
+ PRIoMAX
+ PRIoPTR
+
+ PRIu8
+ PRIu16
+ PRIu32
+ PRIu64
+
+ PRIuLEAST8
+ PRIuLEAST16
+ PRIuLEAST32
+ PRIuLEAST64
+
+ PRIuFAST8
+ PRIuFAST16
+ PRIuFAST32
+ PRIuFAST64
+
+ PRIuMAX
+ PRIuPTR
+
+ PRIx8
+ PRIx16
+ PRIx32
+ PRIx64
+
+ PRIxLEAST8
+ PRIxLEAST16
+ PRIxLEAST32
+ PRIxLEAST64
+
+ PRIxFAST8
+ PRIxFAST16
+ PRIxFAST32
+ PRIxFAST64
+
+ PRIxMAX
+ PRIxPTR
+
+ PRIX8
+ PRIX16
+ PRIX32
+ PRIX64
+
+ PRIXLEAST8
+ PRIXLEAST16
+ PRIXLEAST32
+ PRIXLEAST64
+
+ PRIXFAST8
+ PRIXFAST16
+ PRIXFAST32
+ PRIXFAST64
+
+ PRIXMAX
+ PRIXPTR
+
+ SCNd8
+ SCNd16
+ SCNd32
+ SCNd64
+
+ SCNdLEAST8
+ SCNdLEAST16
+ SCNdLEAST32
+ SCNdLEAST64
+
+ SCNdFAST8
+ SCNdFAST16
+ SCNdFAST32
+ SCNdFAST64
+
+ SCNdMAX
+ SCNdPTR
+
+ SCNi8
+ SCNi16
+ SCNi32
+ SCNi64
+
+ SCNiLEAST8
+ SCNiLEAST16
+ SCNiLEAST32
+ SCNiLEAST64
+
+ SCNiFAST8
+ SCNiFAST16
+ SCNiFAST32
+ SCNiFAST64
+
+ SCNiMAX
+ SCNiPTR
+
+ SCNo8
+ SCNo16
+ SCNo32
+ SCNo64
+
+ SCNoLEAST8
+ SCNoLEAST16
+ SCNoLEAST32
+ SCNoLEAST64
+
+ SCNoFAST8
+ SCNoFAST16
+ SCNoFAST32
+ SCNoFAST64
+
+ SCNoMAX
+ SCNoPTR
+
+ SCNu8
+ SCNu16
+ SCNu32
+ SCNu64
+
+ SCNuLEAST8
+ SCNuLEAST16
+ SCNuLEAST32
+ SCNuLEAST64
+
+ SCNuFAST8
+ SCNuFAST16
+ SCNuFAST32
+ SCNuFAST64
+
+ SCNuMAX
+ SCNuPTR
+
+ SCNx8
+ SCNx16
+ SCNx32
+ SCNx64
+
+ SCNxLEAST8
+ SCNxLEAST16
+ SCNxLEAST32
+ SCNxLEAST64
+
+ SCNxFAST8
+ SCNxFAST16
+ SCNxFAST32
+ SCNxFAST64
+
+ SCNxMAX
+ SCNxPTR
+
+Types:
+
+ imaxdiv_t
+
+intmax_t imaxabs(intmax_t j);
+imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
+intmax_t strtoimax(const char* restrict nptr, char** restrict endptr, int base);
+uintmax_t strtoumax(const char* restrict nptr, char** restrict endptr, int base);
+intmax_t wcstoimax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
+uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <inttypes.h>
+
+#ifdef __cplusplus
+
+#include <stdint.h>
+
+#undef imaxabs
+#undef imaxdiv
+
+#endif // __cplusplus
+
+#endif // _LIBCPP_INTTYPES_H
diff --git a/include/ios b/include/ios
index ff79998b0bbf..1deb5f613c8a 100644
--- a/include/ios
+++ b/include/ios
@@ -114,9 +114,9 @@ class basic_ios
public:
// types:
typedef charT char_type;
- typedef typename traits::int_type int_type;
- typedef typename traits::pos_type pos_type;
- typedef typename traits::off_type off_type;
+ typedef typename traits::int_type int_type; // removed in C++17
+ typedef typename traits::pos_type pos_type; // removed in C++17
+ typedef typename traits::off_type off_type; // removed in C++17
typedef traits traits_type;
operator unspecified-bool-type() const;
@@ -216,7 +216,7 @@ storage-class-specifier const error_category& iostream_category() noexcept;
#include <__locale>
#include <system_error>
-#if __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
+#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
#include <atomic> // for __xindex_
#endif
@@ -254,14 +254,12 @@ public:
static const fmtflags floatfield = scientific | fixed;
typedef unsigned int iostate;
- typedef iostate io_state;
static const iostate badbit = 0x1;
static const iostate eofbit = 0x2;
static const iostate failbit = 0x4;
static const iostate goodbit = 0x0;
typedef unsigned int openmode;
- typedef openmode open_mode;
static const openmode app = 0x01;
static const openmode ate = 0x02;
static const openmode binary = 0x04;
@@ -270,10 +268,15 @@ public:
static const openmode trunc = 0x20;
enum seekdir {beg, cur, end};
- typedef seekdir seek_dir;
+
+#if _LIBCPP_STD_VER <= 14
+ typedef iostate io_state;
+ typedef openmode open_mode;
+ typedef seekdir seek_dir;
typedef _VSTD::streamoff streamoff;
typedef _VSTD::streampos streampos;
+#endif
class _LIBCPP_TYPE_VIS Init;
@@ -367,7 +370,9 @@ private:
int* __index_;
size_t __event_size_;
size_t __event_cap_;
-#if __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
+// TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
+// enabled with clang.
+#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
static atomic<int> __xindex_;
#else
static int __xindex_;
diff --git a/include/istream b/include/istream
index 168a4d0635f6..c6a272e75ef1 100644
--- a/include/istream
+++ b/include/istream
@@ -304,7 +304,7 @@ basic_istream<_CharT, _Traits>::sentry::sentry(basic_istream<_CharT, _Traits>& _
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>::basic_istream(basic_streambuf<char_type, traits_type>* __sb)
: __gc_(0)
{
@@ -314,7 +314,7 @@ basic_istream<_CharT, _Traits>::basic_istream(basic_streambuf<char_type, traits_
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
: __gc_(__rhs.__gc_)
{
@@ -323,7 +323,7 @@ basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::operator=(basic_istream&& __rhs)
{
@@ -339,7 +339,7 @@ basic_istream<_CharT, _Traits>::~basic_istream()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_istream<_CharT, _Traits>::swap(basic_istream& __rhs)
{
@@ -725,7 +725,7 @@ basic_istream<_CharT, _Traits>::operator>>(int& __n)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::operator>>(basic_istream& (*__pf)(basic_istream&))
{
@@ -733,7 +733,7 @@ basic_istream<_CharT, _Traits>::operator>>(basic_istream& (*__pf)(basic_istream&
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::operator>>(basic_ios<char_type, traits_type>&
(*__pf)(basic_ios<char_type, traits_type>&))
@@ -743,7 +743,7 @@ basic_istream<_CharT, _Traits>::operator>>(basic_ios<char_type, traits_type>&
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::operator>>(ios_base& (*__pf)(ios_base&))
{
@@ -800,7 +800,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)
}
template<class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<char, _Traits>&
operator>>(basic_istream<char, _Traits>& __is, unsigned char* __s)
{
@@ -808,7 +808,7 @@ operator>>(basic_istream<char, _Traits>& __is, unsigned char* __s)
}
template<class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<char, _Traits>&
operator>>(basic_istream<char, _Traits>& __is, signed char* __s)
{
@@ -843,7 +843,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
}
template<class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<char, _Traits>&
operator>>(basic_istream<char, _Traits>& __is, unsigned char& __c)
{
@@ -851,7 +851,7 @@ operator>>(basic_istream<char, _Traits>& __is, unsigned char& __c)
}
template<class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<char, _Traits>&
operator>>(basic_istream<char, _Traits>& __is, signed char& __c)
{
@@ -947,7 +947,7 @@ basic_istream<_CharT, _Traits>::get()
}
template<class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::get(char_type& __c)
{
@@ -1006,7 +1006,7 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __
}
template<class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n)
{
@@ -1068,7 +1068,7 @@ basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __s
}
template<class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __sb)
{
@@ -1129,7 +1129,7 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
}
template<class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n)
{
@@ -1407,6 +1407,7 @@ basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir)
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
+ this->clear(this->rdstate() & ~ios_base::eofbit);
sentry __sen(*this, true);
if (__sen)
{
@@ -1461,7 +1462,7 @@ ws(basic_istream<_CharT, _Traits>& __is)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
{
@@ -1503,7 +1504,7 @@ public:
};
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_iostream<_CharT, _Traits>::basic_iostream(basic_streambuf<char_type, traits_type>* __sb)
: basic_istream<_CharT, _Traits>(__sb)
{
@@ -1512,14 +1513,14 @@ basic_iostream<_CharT, _Traits>::basic_iostream(basic_streambuf<char_type, trait
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
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
+inline
basic_iostream<_CharT, _Traits>&
basic_iostream<_CharT, _Traits>::operator=(basic_iostream&& __rhs)
{
@@ -1535,7 +1536,7 @@ basic_iostream<_CharT, _Traits>::~basic_iostream()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_iostream<_CharT, _Traits>::swap(basic_iostream& __rhs)
{
@@ -1644,7 +1645,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Allocator>& __str)
@@ -1655,7 +1656,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>&& __is,
basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm)
@@ -1664,7 +1665,7 @@ getline(basic_istream<_CharT, _Traits>&& __is,
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>&& __is,
basic_string<_CharT, _Traits, _Allocator>& __str)
diff --git a/include/iterator b/include/iterator
index c06ef8f6777d..8dd6bd59c1a8 100644
--- a/include/iterator
+++ b/include/iterator
@@ -513,12 +513,12 @@ distance(_InputIter __first, _InputIter __last)
return __distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
}
-template <class _ForwardIter>
+template <class _InputIter>
inline _LIBCPP_INLINE_VISIBILITY
-_ForwardIter
-next(_ForwardIter __x,
- typename iterator_traits<_ForwardIter>::difference_type __n = 1,
- typename enable_if<__is_forward_iterator<_ForwardIter>::value>::type* = 0)
+_InputIter
+next(_InputIter __x,
+ typename iterator_traits<_InputIter>::difference_type __n = 1,
+ typename enable_if<__is_input_iterator<_InputIter>::value>::type* = 0)
{
_VSTD::advance(__x, __n);
return __x;
diff --git a/include/list b/include/list
index 14201a80e348..28d505582c0d 100644
--- a/include/list
+++ b/include/list
@@ -191,19 +191,10 @@ template <class _Tp, class _VoidPtr> struct __list_node;
template <class _Tp, class _VoidPtr>
struct __list_node_base
{
- typedef typename pointer_traits<_VoidPtr>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__list_node<_Tp, _VoidPtr> > pointer;
-#else
- rebind<__list_node<_Tp, _VoidPtr> >::other pointer;
-#endif
-
- typedef typename pointer_traits<_VoidPtr>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__list_node_base> __base_pointer;
-#else
- rebind<__list_node_base>::other __base_pointer;
-#endif
+ typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type
+ pointer;
+ typedef typename __rebind_pointer<_VoidPtr, __list_node_base>::type
+ __base_pointer;
pointer __prev_;
pointer __next_;
@@ -232,12 +223,8 @@ template <class _Tp, class _VoidPtr> class _LIBCPP_TYPE_VIS_ONLY __list_const_it
template <class _Tp, class _VoidPtr>
class _LIBCPP_TYPE_VIS_ONLY __list_iterator
{
- typedef typename pointer_traits<_VoidPtr>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__list_node<_Tp, _VoidPtr> > __node_pointer;
-#else
- rebind<__list_node<_Tp, _VoidPtr> >::other __node_pointer;
-#endif
+ typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type
+ __node_pointer;
__node_pointer __ptr_;
@@ -262,13 +249,7 @@ public:
typedef bidirectional_iterator_tag iterator_category;
typedef _Tp value_type;
typedef value_type& reference;
- typedef typename pointer_traits<_VoidPtr>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<value_type>
-#else
- rebind<value_type>::other
-#endif
- pointer;
+ typedef typename __rebind_pointer<_VoidPtr, value_type>::type pointer;
typedef typename pointer_traits<pointer>::difference_type difference_type;
_LIBCPP_INLINE_VISIBILITY
@@ -365,12 +346,8 @@ public:
template <class _Tp, class _VoidPtr>
class _LIBCPP_TYPE_VIS_ONLY __list_const_iterator
{
- typedef typename pointer_traits<_VoidPtr>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__list_node<_Tp, _VoidPtr> > __node_pointer;
-#else
- rebind<__list_node<_Tp, _VoidPtr> >::other __node_pointer;
-#endif
+ typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type
+ __node_pointer;
__node_pointer __ptr_;
@@ -392,13 +369,7 @@ public:
typedef bidirectional_iterator_tag iterator_category;
typedef _Tp value_type;
typedef const value_type& reference;
- typedef typename pointer_traits<_VoidPtr>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<const value_type>
-#else
- rebind<const value_type>::other
-#endif
- pointer;
+ typedef typename __rebind_pointer<_VoidPtr, const value_type>::type pointer;
typedef typename pointer_traits<pointer>::difference_type difference_type;
_LIBCPP_INLINE_VISIBILITY
diff --git a/include/locale b/include/locale
index e683ba33ae9d..84cb5a5ef6cd 100644
--- a/include/locale
+++ b/include/locale
@@ -1888,6 +1888,9 @@ protected:
virtual const string_type& __r() const;
virtual const string_type& __x() const;
virtual const string_type& __X() const;
+
+ _LIBCPP_ALWAYS_INLINE
+ ~__time_get_c_storage() {}
};
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
@@ -3773,11 +3776,14 @@ private:
wstring_convert(const wstring_convert& __wc);
wstring_convert& operator=(const wstring_convert& __wc);
public:
+ _LIBCPP_ALWAYS_INLINE
_LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(_Codecvt* __pcvt = new _Codecvt);
+ _LIBCPP_ALWAYS_INLINE
wstring_convert(_Codecvt* __pcvt, state_type __state);
_LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err,
const wide_string& __wide_err = wide_string());
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_ALWAYS_INLINE
wstring_convert(wstring_convert&& __wc);
#endif
~wstring_convert();
@@ -3811,7 +3817,7 @@ public:
};
template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
-inline _LIBCPP_ALWAYS_INLINE
+inline
wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
wstring_convert(_Codecvt* __pcvt)
: __cvtptr_(__pcvt), __cvtstate_(), __cvtcount_(0)
@@ -3819,7 +3825,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
}
template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
-inline _LIBCPP_ALWAYS_INLINE
+inline
wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
wstring_convert(_Codecvt* __pcvt, state_type __state)
: __cvtptr_(__pcvt), __cvtstate_(__state), __cvtcount_(0)
@@ -3838,7 +3844,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
-inline _LIBCPP_ALWAYS_INLINE
+inline
wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
wstring_convert(wstring_convert&& __wc)
: __byte_err_string_(_VSTD::move(__wc.__byte_err_string_)),
@@ -4313,18 +4319,9 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::seekoff(off_type __off, ios_base::seekdir
int __width = __cv_->encoding();
if (__cv_ == 0 || __bufptr_ == 0 || (__width <= 0 && __off != 0) || sync())
return pos_type(off_type(-1));
- // __width > 0 || __off == 0
- switch (__way)
- {
- case ios_base::beg:
- break;
- case ios_base::cur:
- break;
- case ios_base::end:
- break;
- default:
+ // __width > 0 || __off == 0, now check __way
+ if (__way != ios_base::beg && __way != ios_base::cur && __way != ios_base::end)
return pos_type(off_type(-1));
- }
pos_type __r = __bufptr_->pubseekoff(__width * __off, __way, __om);
__r.state(__st_);
return __r;
diff --git a/include/map b/include/map
index eb6b8ed05308..adfb4cdb5e9e 100644
--- a/include/map
+++ b/include/map
@@ -840,6 +840,9 @@ public:
typedef value_type& reference;
typedef const value_type& const_reference;
+ static_assert((is_same<typename allocator_type::value_type, value_type>::value),
+ "Allocator::value_type must be same type as value_type");
+
class _LIBCPP_TYPE_VIS_ONLY value_compare
: public binary_function<value_type, value_type, bool>
{
@@ -1523,7 +1526,7 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node_with_key(const key_type&
__h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
__h.get_deleter().__second_constructed = true;
- return _VSTD::move(__h); // explicitly moved for C++03
+ return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
}
template <class _Key, class _Tp, class _Compare, class _Allocator>
@@ -1696,6 +1699,9 @@ public:
typedef value_type& reference;
typedef const value_type& const_reference;
+ static_assert((is_same<typename allocator_type::value_type, value_type>::value),
+ "Allocator::value_type must be same type as value_type");
+
class _LIBCPP_TYPE_VIS_ONLY value_compare
: public binary_function<value_type, value_type, bool>
{
diff --git a/include/math.h b/include/math.h
new file mode 100644
index 000000000000..20205544d51d
--- /dev/null
+++ b/include/math.h
@@ -0,0 +1,1419 @@
+// -*- C++ -*-
+//===---------------------------- math.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_MATH_H
+#define _LIBCPP_MATH_H
+
+/*
+ math.h synopsis
+
+Macros:
+
+ HUGE_VAL
+ HUGE_VALF // C99
+ HUGE_VALL // C99
+ INFINITY // C99
+ NAN // C99
+ FP_INFINITE // C99
+ FP_NAN // C99
+ FP_NORMAL // C99
+ FP_SUBNORMAL // C99
+ FP_ZERO // C99
+ FP_FAST_FMA // C99
+ FP_FAST_FMAF // C99
+ FP_FAST_FMAL // C99
+ FP_ILOGB0 // C99
+ FP_ILOGBNAN // C99
+ MATH_ERRNO // C99
+ MATH_ERREXCEPT // C99
+ math_errhandling // C99
+
+Types:
+
+ float_t // C99
+ double_t // C99
+
+// C90
+
+floating_point abs(floating_point x);
+
+floating_point acos (arithmetic x);
+float acosf(float x);
+long double acosl(long double x);
+
+floating_point asin (arithmetic x);
+float asinf(float x);
+long double asinl(long double x);
+
+floating_point atan (arithmetic x);
+float atanf(float x);
+long double atanl(long double x);
+
+floating_point atan2 (arithmetic y, arithmetic x);
+float atan2f(float y, float x);
+long double atan2l(long double y, long double x);
+
+floating_point ceil (arithmetic x);
+float ceilf(float x);
+long double ceill(long double x);
+
+floating_point cos (arithmetic x);
+float cosf(float x);
+long double cosl(long double x);
+
+floating_point cosh (arithmetic x);
+float coshf(float x);
+long double coshl(long double x);
+
+floating_point exp (arithmetic x);
+float expf(float x);
+long double expl(long double x);
+
+floating_point fabs (arithmetic x);
+float fabsf(float x);
+long double fabsl(long double x);
+
+floating_point floor (arithmetic x);
+float floorf(float x);
+long double floorl(long double x);
+
+floating_point fmod (arithmetic x, arithmetic y);
+float fmodf(float x, float y);
+long double fmodl(long double x, long double y);
+
+floating_point frexp (arithmetic value, int* exp);
+float frexpf(float value, int* exp);
+long double frexpl(long double value, int* exp);
+
+floating_point ldexp (arithmetic value, int exp);
+float ldexpf(float value, int exp);
+long double ldexpl(long double value, int exp);
+
+floating_point log (arithmetic x);
+float logf(float x);
+long double logl(long double x);
+
+floating_point log10 (arithmetic x);
+float log10f(float x);
+long double log10l(long double x);
+
+floating_point modf (floating_point value, floating_point* iptr);
+float modff(float value, float* iptr);
+long double modfl(long double value, long double* iptr);
+
+floating_point pow (arithmetic x, arithmetic y);
+float powf(float x, float y);
+long double powl(long double x, long double y);
+
+floating_point sin (arithmetic x);
+float sinf(float x);
+long double sinl(long double x);
+
+floating_point sinh (arithmetic x);
+float sinhf(float x);
+long double sinhl(long double x);
+
+floating_point sqrt (arithmetic x);
+float sqrtf(float x);
+long double sqrtl(long double x);
+
+floating_point tan (arithmetic x);
+float tanf(float x);
+long double tanl(long double x);
+
+floating_point tanh (arithmetic x);
+float tanhf(float x);
+long double tanhl(long double x);
+
+// C99
+
+bool signbit(arithmetic x);
+
+int fpclassify(arithmetic x);
+
+bool isfinite(arithmetic x);
+bool isinf(arithmetic x);
+bool isnan(arithmetic x);
+bool isnormal(arithmetic x);
+
+bool isgreater(arithmetic x, arithmetic y);
+bool isgreaterequal(arithmetic x, arithmetic y);
+bool isless(arithmetic x, arithmetic y);
+bool islessequal(arithmetic x, arithmetic y);
+bool islessgreater(arithmetic x, arithmetic y);
+bool isunordered(arithmetic x, arithmetic y);
+
+floating_point acosh (arithmetic x);
+float acoshf(float x);
+long double acoshl(long double x);
+
+floating_point asinh (arithmetic x);
+float asinhf(float x);
+long double asinhl(long double x);
+
+floating_point atanh (arithmetic x);
+float atanhf(float x);
+long double atanhl(long double x);
+
+floating_point cbrt (arithmetic x);
+float cbrtf(float x);
+long double cbrtl(long double x);
+
+floating_point copysign (arithmetic x, arithmetic y);
+float copysignf(float x, float y);
+long double copysignl(long double x, long double y);
+
+floating_point erf (arithmetic x);
+float erff(float x);
+long double erfl(long double x);
+
+floating_point erfc (arithmetic x);
+float erfcf(float x);
+long double erfcl(long double x);
+
+floating_point exp2 (arithmetic x);
+float exp2f(float x);
+long double exp2l(long double x);
+
+floating_point expm1 (arithmetic x);
+float expm1f(float x);
+long double expm1l(long double x);
+
+floating_point fdim (arithmetic x, arithmetic y);
+float fdimf(float x, float y);
+long double fdiml(long double x, long double y);
+
+floating_point fma (arithmetic x, arithmetic y, arithmetic z);
+float fmaf(float x, float y, float z);
+long double fmal(long double x, long double y, long double z);
+
+floating_point fmax (arithmetic x, arithmetic y);
+float fmaxf(float x, float y);
+long double fmaxl(long double x, long double y);
+
+floating_point fmin (arithmetic x, arithmetic y);
+float fminf(float x, float y);
+long double fminl(long double x, long double y);
+
+floating_point hypot (arithmetic x, arithmetic y);
+float hypotf(float x, float y);
+long double hypotl(long double x, long double y);
+
+int ilogb (arithmetic x);
+int ilogbf(float x);
+int ilogbl(long double x);
+
+floating_point lgamma (arithmetic x);
+float lgammaf(float x);
+long double lgammal(long double x);
+
+long long llrint (arithmetic x);
+long long llrintf(float x);
+long long llrintl(long double x);
+
+long long llround (arithmetic x);
+long long llroundf(float x);
+long long llroundl(long double x);
+
+floating_point log1p (arithmetic x);
+float log1pf(float x);
+long double log1pl(long double x);
+
+floating_point log2 (arithmetic x);
+float log2f(float x);
+long double log2l(long double x);
+
+floating_point logb (arithmetic x);
+float logbf(float x);
+long double logbl(long double x);
+
+long lrint (arithmetic x);
+long lrintf(float x);
+long lrintl(long double x);
+
+long lround (arithmetic x);
+long lroundf(float x);
+long lroundl(long double x);
+
+double nan (const char* str);
+float nanf(const char* str);
+long double nanl(const char* str);
+
+floating_point nearbyint (arithmetic x);
+float nearbyintf(float x);
+long double nearbyintl(long double x);
+
+floating_point nextafter (arithmetic x, arithmetic y);
+float nextafterf(float x, float y);
+long double nextafterl(long double x, long double y);
+
+floating_point nexttoward (arithmetic x, long double y);
+float nexttowardf(float x, long double y);
+long double nexttowardl(long double x, long double y);
+
+floating_point remainder (arithmetic x, arithmetic y);
+float remainderf(float x, float y);
+long double remainderl(long double x, long double y);
+
+floating_point remquo (arithmetic x, arithmetic y, int* pquo);
+float remquof(float x, float y, int* pquo);
+long double remquol(long double x, long double y, int* pquo);
+
+floating_point rint (arithmetic x);
+float rintf(float x);
+long double rintl(long double x);
+
+floating_point round (arithmetic x);
+float roundf(float x);
+long double roundl(long double x);
+
+floating_point scalbln (arithmetic x, long ex);
+float scalblnf(float x, long ex);
+long double scalblnl(long double x, long ex);
+
+floating_point scalbn (arithmetic x, int ex);
+float scalbnf(float x, int ex);
+long double scalbnl(long double x, int ex);
+
+floating_point tgamma (arithmetic x);
+float tgammaf(float x);
+long double tgammal(long double x);
+
+floating_point trunc (arithmetic x);
+float truncf(float x);
+long double truncl(long double x);
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <math.h>
+
+#ifdef __cplusplus
+
+// We support including .h headers inside 'extern "C"' contexts, so switch
+// back to C++ linkage before including these C++ headers.
+extern "C++" {
+
+#include <type_traits>
+
+#ifdef _LIBCPP_MSVCRT
+#include "support/win32/math_win32.h"
+#endif
+
+// signbit
+
+#ifdef signbit
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+bool
+__libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT
+{
+ return signbit(__lcpp_x);
+}
+
+#undef signbit
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+signbit(_A1 __lcpp_x) _NOEXCEPT
+{
+ return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x);
+}
+
+#endif // signbit
+
+// fpclassify
+
+#ifdef fpclassify
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+int
+__libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT
+{
+ return fpclassify(__lcpp_x);
+}
+
+#undef fpclassify
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_arithmetic<_A1>::value, int>::type
+fpclassify(_A1 __lcpp_x) _NOEXCEPT
+{
+ return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x);
+}
+
+#endif // fpclassify
+
+// isfinite
+
+#ifdef isfinite
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+bool
+__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
+{
+ return isfinite(__lcpp_x);
+}
+
+#undef isfinite
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+isfinite(_A1 __lcpp_x) _NOEXCEPT
+{
+ return __libcpp_isfinite((typename std::__promote<_A1>::type)__lcpp_x);
+}
+
+#endif // isfinite
+
+// isinf
+
+#ifdef isinf
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+bool
+__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
+{
+ return isinf(__lcpp_x);
+}
+
+#undef isinf
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+isinf(_A1 __lcpp_x) _NOEXCEPT
+{
+ return __libcpp_isinf((typename std::__promote<_A1>::type)__lcpp_x);
+}
+
+#endif // isinf
+
+// isnan
+
+#ifdef isnan
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+bool
+__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
+{
+ return isnan(__lcpp_x);
+}
+
+#undef isnan
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+isnan(_A1 __lcpp_x) _NOEXCEPT
+{
+ return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x);
+}
+
+#endif // isnan
+
+// isnormal
+
+#ifdef isnormal
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+bool
+__libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT
+{
+ return isnormal(__lcpp_x);
+}
+
+#undef isnormal
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+isnormal(_A1 __lcpp_x) _NOEXCEPT
+{
+ return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x);
+}
+
+#endif // isnormal
+
+// isgreater
+
+#ifdef isgreater
+
+template <class _A1, class _A2>
+_LIBCPP_ALWAYS_INLINE
+bool
+__libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ return isgreater(__lcpp_x, __lcpp_y);
+}
+
+#undef isgreater
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ bool
+>::type
+isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type type;
+ return __libcpp_isgreater((type)__lcpp_x, (type)__lcpp_y);
+}
+
+#endif // isgreater
+
+// isgreaterequal
+
+#ifdef isgreaterequal
+
+template <class _A1, class _A2>
+_LIBCPP_ALWAYS_INLINE
+bool
+__libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ return isgreaterequal(__lcpp_x, __lcpp_y);
+}
+
+#undef isgreaterequal
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ bool
+>::type
+isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type type;
+ return __libcpp_isgreaterequal((type)__lcpp_x, (type)__lcpp_y);
+}
+
+#endif // isgreaterequal
+
+// isless
+
+#ifdef isless
+
+template <class _A1, class _A2>
+_LIBCPP_ALWAYS_INLINE
+bool
+__libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ return isless(__lcpp_x, __lcpp_y);
+}
+
+#undef isless
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ bool
+>::type
+isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type type;
+ return __libcpp_isless((type)__lcpp_x, (type)__lcpp_y);
+}
+
+#endif // isless
+
+// islessequal
+
+#ifdef islessequal
+
+template <class _A1, class _A2>
+_LIBCPP_ALWAYS_INLINE
+bool
+__libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ return islessequal(__lcpp_x, __lcpp_y);
+}
+
+#undef islessequal
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ bool
+>::type
+islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type type;
+ return __libcpp_islessequal((type)__lcpp_x, (type)__lcpp_y);
+}
+
+#endif // islessequal
+
+// islessgreater
+
+#ifdef islessgreater
+
+template <class _A1, class _A2>
+_LIBCPP_ALWAYS_INLINE
+bool
+__libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ return islessgreater(__lcpp_x, __lcpp_y);
+}
+
+#undef islessgreater
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ bool
+>::type
+islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type type;
+ return __libcpp_islessgreater((type)__lcpp_x, (type)__lcpp_y);
+}
+
+#endif // islessgreater
+
+// isunordered
+
+#ifdef isunordered
+
+template <class _A1, class _A2>
+_LIBCPP_ALWAYS_INLINE
+bool
+__libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ return isunordered(__lcpp_x, __lcpp_y);
+}
+
+#undef isunordered
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ bool
+>::type
+isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type type;
+ return __libcpp_isunordered((type)__lcpp_x, (type)__lcpp_y);
+}
+
+#endif // isunordered
+
+#ifndef __sun__
+
+// abs
+
+#if !defined(_AIX)
+inline _LIBCPP_INLINE_VISIBILITY
+float
+abs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);}
+
+inline _LIBCPP_INLINE_VISIBILITY
+double
+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)
+
+// acos
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+acos(_A1 __lcpp_x) _NOEXCEPT {return acos((double)__lcpp_x);}
+
+// asin
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+asin(_A1 __lcpp_x) _NOEXCEPT {return asin((double)__lcpp_x);}
+
+// atan
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+atan(_A1 __lcpp_x) _NOEXCEPT {return atan((double)__lcpp_x);}
+
+// atan2
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::__lazy_enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ std::__promote<_A1, _A2>
+>::type
+atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type __result_type;
+ static_assert((!(std::is_same<_A1, __result_type>::value &&
+ std::is_same<_A2, __result_type>::value)), "");
+ return atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x);
+}
+
+// ceil
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+ceil(_A1 __lcpp_x) _NOEXCEPT {return ceil((double)__lcpp_x);}
+
+// cos
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+cos(_A1 __lcpp_x) _NOEXCEPT {return cos((double)__lcpp_x);}
+
+// cosh
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+cosh(_A1 __lcpp_x) _NOEXCEPT {return cosh((double)__lcpp_x);}
+
+// exp
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+exp(_A1 __lcpp_x) _NOEXCEPT {return exp((double)__lcpp_x);}
+
+// fabs
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+fabs(_A1 __lcpp_x) _NOEXCEPT {return fabs((double)__lcpp_x);}
+
+// floor
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+floor(_A1 __lcpp_x) _NOEXCEPT {return floor((double)__lcpp_x);}
+
+// fmod
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::__lazy_enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ std::__promote<_A1, _A2>
+>::type
+fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type __result_type;
+ static_assert((!(std::is_same<_A1, __result_type>::value &&
+ std::is_same<_A2, __result_type>::value)), "");
+ return fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+}
+
+// frexp
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+frexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexp((double)__lcpp_x, __lcpp_e);}
+
+// ldexp
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+ldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexp((double)__lcpp_x, __lcpp_e);}
+
+// log
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+log(_A1 __lcpp_x) _NOEXCEPT {return log((double)__lcpp_x);}
+
+// log10
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+log10(_A1 __lcpp_x) _NOEXCEPT {return log10((double)__lcpp_x);}
+
+// modf
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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))
+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
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::__lazy_enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ std::__promote<_A1, _A2>
+>::type
+pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type __result_type;
+ static_assert((!(std::is_same<_A1, __result_type>::value &&
+ std::is_same<_A2, __result_type>::value)), "");
+ return pow((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+}
+
+// sin
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+sin(_A1 __lcpp_x) _NOEXCEPT {return sin((double)__lcpp_x);}
+
+// sinh
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+sinh(_A1 __lcpp_x) _NOEXCEPT {return sinh((double)__lcpp_x);}
+
+// sqrt
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+tan(_A1 __lcpp_x) _NOEXCEPT {return tan((double)__lcpp_x);}
+
+// tanh
+
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+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
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+tanh(_A1 __lcpp_x) _NOEXCEPT {return tanh((double)__lcpp_x);}
+
+// acosh
+
+#ifndef _LIBCPP_MSVCRT
+inline _LIBCPP_INLINE_VISIBILITY float acosh(float __lcpp_x) _NOEXCEPT {return acoshf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return acoshl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+acosh(_A1 __lcpp_x) _NOEXCEPT {return acosh((double)__lcpp_x);}
+#endif
+
+// asinh
+
+#ifndef _LIBCPP_MSVCRT
+inline _LIBCPP_INLINE_VISIBILITY float asinh(float __lcpp_x) _NOEXCEPT {return asinhf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return asinhl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+asinh(_A1 __lcpp_x) _NOEXCEPT {return asinh((double)__lcpp_x);}
+#endif
+
+// atanh
+
+#ifndef _LIBCPP_MSVCRT
+inline _LIBCPP_INLINE_VISIBILITY float atanh(float __lcpp_x) _NOEXCEPT {return atanhf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return atanhl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+atanh(_A1 __lcpp_x) _NOEXCEPT {return atanh((double)__lcpp_x);}
+#endif
+
+// cbrt
+
+#ifndef _LIBCPP_MSVCRT
+inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __lcpp_x) _NOEXCEPT {return cbrtf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return cbrtl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+cbrt(_A1 __lcpp_x) _NOEXCEPT {return cbrt((double)__lcpp_x);}
+#endif
+
+// copysign
+
+#if !defined(_VC_CRT_MAJOR_VERSION) || (_VC_CRT_MAJOR_VERSION < 12)
+inline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x,
+ float __lcpp_y) _NOEXCEPT {
+ return copysignf(__lcpp_x, __lcpp_y);
+}
+inline _LIBCPP_INLINE_VISIBILITY long double
+copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {
+ return copysignl(__lcpp_x, __lcpp_y);
+}
+#endif
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::__lazy_enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ std::__promote<_A1, _A2>
+>::type
+copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type __result_type;
+ static_assert((!(std::is_same<_A1, __result_type>::value &&
+ std::is_same<_A2, __result_type>::value)), "");
+ return copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+}
+
+#ifndef _LIBCPP_MSVCRT
+
+// erf
+
+inline _LIBCPP_INLINE_VISIBILITY float erf(float __lcpp_x) _NOEXCEPT {return erff(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return erfl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+erf(_A1 __lcpp_x) _NOEXCEPT {return erf((double)__lcpp_x);}
+
+// erfc
+
+inline _LIBCPP_INLINE_VISIBILITY float erfc(float __lcpp_x) _NOEXCEPT {return erfcf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return erfcl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+erfc(_A1 __lcpp_x) _NOEXCEPT {return erfc((double)__lcpp_x);}
+
+// exp2
+
+inline _LIBCPP_INLINE_VISIBILITY float exp2(float __lcpp_x) _NOEXCEPT {return exp2f(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return exp2l(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+exp2(_A1 __lcpp_x) _NOEXCEPT {return exp2((double)__lcpp_x);}
+
+// expm1
+
+inline _LIBCPP_INLINE_VISIBILITY float expm1(float __lcpp_x) _NOEXCEPT {return expm1f(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return expm1l(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+expm1(_A1 __lcpp_x) _NOEXCEPT {return expm1((double)__lcpp_x);}
+
+// fdim
+
+inline _LIBCPP_INLINE_VISIBILITY float fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fdimf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fdiml(__lcpp_x, __lcpp_y);}
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::__lazy_enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ std::__promote<_A1, _A2>
+>::type
+fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type __result_type;
+ static_assert((!(std::is_same<_A1, __result_type>::value &&
+ std::is_same<_A2, __result_type>::value)), "");
+ return fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+}
+
+// fma
+
+inline _LIBCPP_INLINE_VISIBILITY float fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT {return fmaf(__lcpp_x, __lcpp_y, __lcpp_z);}
+inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long double __lcpp_y, long double __lcpp_z) _NOEXCEPT {return fmal(__lcpp_x, __lcpp_y, __lcpp_z);}
+
+template <class _A1, class _A2, class _A3>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::__lazy_enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value &&
+ std::is_arithmetic<_A3>::value,
+ std::__promote<_A1, _A2, _A3>
+>::type
+fma(_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)), "");
+ return fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
+}
+
+// fmax
+
+inline _LIBCPP_INLINE_VISIBILITY float fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmaxf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmaxl(__lcpp_x, __lcpp_y);}
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::__lazy_enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ std::__promote<_A1, _A2>
+>::type
+fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type __result_type;
+ static_assert((!(std::is_same<_A1, __result_type>::value &&
+ std::is_same<_A2, __result_type>::value)), "");
+ return fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+}
+
+// fmin
+
+inline _LIBCPP_INLINE_VISIBILITY float fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fminf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fminl(__lcpp_x, __lcpp_y);}
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::__lazy_enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ std::__promote<_A1, _A2>
+>::type
+fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type __result_type;
+ static_assert((!(std::is_same<_A1, __result_type>::value &&
+ std::is_same<_A2, __result_type>::value)), "");
+ return fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+}
+
+// hypot
+
+inline _LIBCPP_INLINE_VISIBILITY float hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return hypotf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return hypotl(__lcpp_x, __lcpp_y);}
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::__lazy_enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ std::__promote<_A1, _A2>
+>::type
+hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type __result_type;
+ static_assert((!(std::is_same<_A1, __result_type>::value &&
+ std::is_same<_A2, __result_type>::value)), "");
+ return hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+}
+
+// ilogb
+
+inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT {return ilogbf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ilogbl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, int>::type
+ilogb(_A1 __lcpp_x) _NOEXCEPT {return ilogb((double)__lcpp_x);}
+
+// lgamma
+
+inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __lcpp_x) _NOEXCEPT {return lgammaf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return lgammal(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+lgamma(_A1 __lcpp_x) _NOEXCEPT {return lgamma((double)__lcpp_x);}
+
+// llrint
+
+inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT {return llrintf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT {return llrintl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, long long>::type
+llrint(_A1 __lcpp_x) _NOEXCEPT {return llrint((double)__lcpp_x);}
+
+// llround
+
+inline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT {return llroundf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT {return llroundl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, long long>::type
+llround(_A1 __lcpp_x) _NOEXCEPT {return llround((double)__lcpp_x);}
+
+// log1p
+
+inline _LIBCPP_INLINE_VISIBILITY float log1p(float __lcpp_x) _NOEXCEPT {return log1pf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return log1pl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+log1p(_A1 __lcpp_x) _NOEXCEPT {return log1p((double)__lcpp_x);}
+
+// log2
+
+inline _LIBCPP_INLINE_VISIBILITY float log2(float __lcpp_x) _NOEXCEPT {return log2f(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return log2l(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+log2(_A1 __lcpp_x) _NOEXCEPT {return log2((double)__lcpp_x);}
+
+// logb
+
+inline _LIBCPP_INLINE_VISIBILITY float logb(float __lcpp_x) _NOEXCEPT {return logbf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return logbl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+logb(_A1 __lcpp_x) _NOEXCEPT {return logb((double)__lcpp_x);}
+
+// lrint
+
+inline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT {return lrintf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT {return lrintl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, long>::type
+lrint(_A1 __lcpp_x) _NOEXCEPT {return lrint((double)__lcpp_x);}
+
+// lround
+
+inline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT {return lroundf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT {return lroundl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, long>::type
+lround(_A1 __lcpp_x) _NOEXCEPT {return lround((double)__lcpp_x);}
+
+// nan
+
+// nearbyint
+
+inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __lcpp_x) _NOEXCEPT {return nearbyintf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return nearbyintl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+nearbyint(_A1 __lcpp_x) _NOEXCEPT {return nearbyint((double)__lcpp_x);}
+
+// nextafter
+
+inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return nextafterf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nextafterl(__lcpp_x, __lcpp_y);}
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::__lazy_enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ std::__promote<_A1, _A2>
+>::type
+nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type __result_type;
+ static_assert((!(std::is_same<_A1, __result_type>::value &&
+ std::is_same<_A2, __result_type>::value)), "");
+ return nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+}
+
+// nexttoward
+
+inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardl(__lcpp_x, __lcpp_y);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+nexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttoward((double)__lcpp_x, __lcpp_y);}
+
+// remainder
+
+inline _LIBCPP_INLINE_VISIBILITY float remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return remainderf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return remainderl(__lcpp_x, __lcpp_y);}
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::__lazy_enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ std::__promote<_A1, _A2>
+>::type
+remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type __result_type;
+ static_assert((!(std::is_same<_A1, __result_type>::value &&
+ std::is_same<_A2, __result_type>::value)), "");
+ return remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+}
+
+// remquo
+
+inline _LIBCPP_INLINE_VISIBILITY float remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquof(__lcpp_x, __lcpp_y, __lcpp_z);}
+inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long double __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquol(__lcpp_x, __lcpp_y, __lcpp_z);}
+
+template <class _A1, class _A2>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::__lazy_enable_if
+<
+ std::is_arithmetic<_A1>::value &&
+ std::is_arithmetic<_A2>::value,
+ std::__promote<_A1, _A2>
+>::type
+remquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT
+{
+ typedef typename std::__promote<_A1, _A2>::type __result_type;
+ static_assert((!(std::is_same<_A1, __result_type>::value &&
+ std::is_same<_A2, __result_type>::value)), "");
+ return remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z);
+}
+
+// rint
+
+inline _LIBCPP_INLINE_VISIBILITY float rint(float __lcpp_x) _NOEXCEPT {return rintf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT {return rintl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+rint(_A1 __lcpp_x) _NOEXCEPT {return rint((double)__lcpp_x);}
+
+// round
+
+inline _LIBCPP_INLINE_VISIBILITY float round(float __lcpp_x) _NOEXCEPT {return roundf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT {return roundl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+round(_A1 __lcpp_x) _NOEXCEPT {return round((double)__lcpp_x);}
+
+// scalbln
+
+inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnl(__lcpp_x, __lcpp_y);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+scalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalbln((double)__lcpp_x, __lcpp_y);}
+
+// scalbn
+
+inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnl(__lcpp_x, __lcpp_y);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+scalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbn((double)__lcpp_x, __lcpp_y);}
+
+// tgamma
+
+inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __lcpp_x) _NOEXCEPT {return tgammaf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return tgammal(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, double>::type
+tgamma(_A1 __lcpp_x) _NOEXCEPT {return tgamma((double)__lcpp_x);}
+
+// trunc
+
+inline _LIBCPP_INLINE_VISIBILITY float trunc(float __lcpp_x) _NOEXCEPT {return truncf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT {return truncl(__lcpp_x);}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+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++"
+
+#endif // __cplusplus
+
+#endif // _LIBCPP_MATH_H
diff --git a/include/memory b/include/memory
index 22311aaace92..65369d2632c4 100644
--- a/include/memory
+++ b/include/memory
@@ -612,7 +612,7 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
#include <cassert>
#endif
-#if __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
+#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
# include <atomic>
#endif
@@ -932,6 +932,15 @@ public:
{return _VSTD::addressof(__r);}
};
+template <class _From, class _To>
+struct __rebind_pointer {
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+ typedef typename pointer_traits<_From>::template rebind<_To> type;
+#else
+ typedef typename pointer_traits<_From>::template rebind<_To>::other type;
+#endif
+};
+
// allocator_traits
namespace __has_pointer_type_imp
@@ -1669,7 +1678,7 @@ private:
{return __a.max_size();}
_LIBCPP_INLINE_VISIBILITY
static size_type __max_size(false_type, const allocator_type&)
- {return numeric_limits<size_type>::max();}
+ {return numeric_limits<size_type>::max() / sizeof(value_type);}
_LIBCPP_INLINE_VISIBILITY
static allocator_type
@@ -1900,6 +1909,10 @@ public:
_LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator*() {return *this;}
_LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(const _Tp& __element)
{::new(&*__x_) _Tp(__element); return *this;}
+#if _LIBCPP_STD_VER >= 14
+ _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(_Tp&& __element)
+ {::new(&*__x_) _Tp(_VSTD::move(__element)); return *this;}
+#endif
_LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator++() {++__x_; return *this;}
_LIBCPP_INLINE_VISIBILITY raw_storage_iterator operator++(int)
{raw_storage_iterator __t(*this); ++__x_; return __t;}
@@ -2659,10 +2672,17 @@ public:
: __ptr_(__u->release(), _VSTD::forward<deleter_type>(__u->get_deleter())) {}
template <class _Up, class _Ep>
- _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr<_Up, _Ep> __u)
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<
+ !is_array<_Up>::value &&
+ is_convertible<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value &&
+ is_assignable<deleter_type&, _Ep&>::value,
+ unique_ptr&
+ >::type
+ operator=(unique_ptr<_Up, _Ep> __u)
{
reset(__u.release());
- __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
+ __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
return *this;
}
@@ -3420,7 +3440,7 @@ struct __scalar_hash<_Tp, 2>
{
size_t __a;
size_t __b;
- };
+ } __s;
} __u;
__u.__t = __v;
return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
@@ -3442,7 +3462,7 @@ struct __scalar_hash<_Tp, 3>
size_t __a;
size_t __b;
size_t __c;
- };
+ } __s;
} __u;
__u.__t = __v;
return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
@@ -3465,7 +3485,7 @@ struct __scalar_hash<_Tp, 4>
size_t __b;
size_t __c;
size_t __d;
- };
+ } __s;
} __u;
__u.__t = __v;
return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
@@ -3854,7 +3874,9 @@ private:
struct __nat {int __for_bool_;};
public:
+ _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR shared_ptr() _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT;
template<class _Yp>
explicit shared_ptr(_Yp* __p,
@@ -3867,15 +3889,18 @@ public:
typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat());
template <class _Dp> shared_ptr(nullptr_t __p, _Dp __d);
template <class _Dp, class _Alloc> shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a);
- template<class _Yp> shared_ptr(const shared_ptr<_Yp>& __r, element_type* __p) _NOEXCEPT;
+ template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(const shared_ptr<_Yp>& __r, element_type* __p) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
shared_ptr(const shared_ptr& __r) _NOEXCEPT;
template<class _Yp>
+ _LIBCPP_INLINE_VISIBILITY
shared_ptr(const shared_ptr<_Yp>& __r,
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type = __nat())
_NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
shared_ptr(shared_ptr&& __r) _NOEXCEPT;
- template<class _Yp> shared_ptr(shared_ptr<_Yp>&& __r,
+ template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(shared_ptr<_Yp>&& __r,
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type = __nat())
_NOEXCEPT;
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -3932,6 +3957,7 @@ public:
~shared_ptr();
+ _LIBCPP_INLINE_VISIBILITY
shared_ptr& operator=(const shared_ptr& __r) _NOEXCEPT;
template<class _Yp>
typename enable_if
@@ -3939,8 +3965,10 @@ public:
is_convertible<_Yp*, element_type*>::value,
shared_ptr&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT;
template<class _Yp>
typename enable_if
@@ -3948,6 +3976,7 @@ public:
is_convertible<_Yp*, element_type*>::value,
shared_ptr<_Tp>&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator=(shared_ptr<_Yp>&& __r);
template<class _Yp>
typename enable_if
@@ -3956,6 +3985,7 @@ public:
is_convertible<_Yp*, element_type*>::value,
shared_ptr
>::type&
+ _LIBCPP_INLINE_VISIBILITY
operator=(auto_ptr<_Yp>&& __r);
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _Yp>
@@ -3965,6 +3995,7 @@ public:
is_convertible<_Yp*, element_type*>::value,
shared_ptr&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator=(auto_ptr<_Yp> __r);
#endif
template <class _Yp, class _Dp>
@@ -3975,12 +4006,16 @@ public:
shared_ptr&
>::type
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
operator=(unique_ptr<_Yp, _Dp>&& __r);
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
operator=(unique_ptr<_Yp, _Dp> __r);
#endif
+ _LIBCPP_INLINE_VISIBILITY
void swap(shared_ptr& __r) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
void reset() _NOEXCEPT;
template<class _Yp>
typename enable_if
@@ -3988,6 +4023,7 @@ public:
is_convertible<_Yp*, element_type*>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
reset(_Yp* __p);
template<class _Yp, class _Dp>
typename enable_if
@@ -3995,6 +4031,7 @@ public:
is_convertible<_Yp*, element_type*>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
reset(_Yp* __p, _Dp __d);
template<class _Yp, class _Dp, class _Alloc>
typename enable_if
@@ -4002,6 +4039,7 @@ public:
is_convertible<_Yp*, element_type*>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
reset(_Yp* __p, _Dp __d, _Alloc __a);
_LIBCPP_INLINE_VISIBILITY
@@ -4103,7 +4141,7 @@ private:
};
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
shared_ptr<_Tp>::shared_ptr() _NOEXCEPT
: __ptr_(0),
@@ -4112,7 +4150,7 @@ shared_ptr<_Tp>::shared_ptr() _NOEXCEPT
}
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
shared_ptr<_Tp>::shared_ptr(nullptr_t) _NOEXCEPT
: __ptr_(0),
@@ -4235,7 +4273,7 @@ shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r, element_type *__p) _NOEXCEPT
: __ptr_(__p),
__cntrl_(__r.__cntrl_)
@@ -4245,7 +4283,7 @@ shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r, element_type *__p) _NOEX
}
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
shared_ptr<_Tp>::shared_ptr(const shared_ptr& __r) _NOEXCEPT
: __ptr_(__r.__ptr_),
__cntrl_(__r.__cntrl_)
@@ -4256,7 +4294,7 @@ shared_ptr<_Tp>::shared_ptr(const shared_ptr& __r) _NOEXCEPT
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r,
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type)
_NOEXCEPT
@@ -4270,7 +4308,7 @@ shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r,
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
shared_ptr<_Tp>::shared_ptr(shared_ptr&& __r) _NOEXCEPT
: __ptr_(__r.__ptr_),
__cntrl_(__r.__cntrl_)
@@ -4281,7 +4319,7 @@ shared_ptr<_Tp>::shared_ptr(shared_ptr&& __r) _NOEXCEPT
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r,
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type)
_NOEXCEPT
@@ -4568,7 +4606,7 @@ shared_ptr<_Tp>::~shared_ptr()
}
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
shared_ptr<_Tp>&
shared_ptr<_Tp>::operator=(const shared_ptr& __r) _NOEXCEPT
{
@@ -4578,7 +4616,7 @@ shared_ptr<_Tp>::operator=(const shared_ptr& __r) _NOEXCEPT
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
is_convertible<_Yp*, _Tp*>::value,
@@ -4593,7 +4631,7 @@ shared_ptr<_Tp>::operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
shared_ptr<_Tp>&
shared_ptr<_Tp>::operator=(shared_ptr&& __r) _NOEXCEPT
{
@@ -4603,7 +4641,7 @@ shared_ptr<_Tp>::operator=(shared_ptr&& __r) _NOEXCEPT
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
is_convertible<_Yp*, _Tp*>::value,
@@ -4617,7 +4655,7 @@ shared_ptr<_Tp>::operator=(shared_ptr<_Yp>&& __r)
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
!is_array<_Yp>::value &&
@@ -4632,7 +4670,7 @@ shared_ptr<_Tp>::operator=(auto_ptr<_Yp>&& __r)
template<class _Tp>
template <class _Yp, class _Dp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
!is_array<_Yp>::value &&
@@ -4680,7 +4718,7 @@ shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp> __r)
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
shared_ptr<_Tp>::swap(shared_ptr& __r) _NOEXCEPT
{
@@ -4689,7 +4727,7 @@ shared_ptr<_Tp>::swap(shared_ptr& __r) _NOEXCEPT
}
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
shared_ptr<_Tp>::reset() _NOEXCEPT
{
@@ -4698,7 +4736,7 @@ shared_ptr<_Tp>::reset() _NOEXCEPT
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
is_convertible<_Yp*, _Tp*>::value,
@@ -4711,7 +4749,7 @@ shared_ptr<_Tp>::reset(_Yp* __p)
template<class _Tp>
template<class _Yp, class _Dp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
is_convertible<_Yp*, _Tp*>::value,
@@ -4724,7 +4762,7 @@ shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d)
template<class _Tp>
template<class _Yp, class _Dp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
is_convertible<_Yp*, _Tp*>::value,
@@ -5041,23 +5079,27 @@ private:
__shared_weak_count* __cntrl_;
public:
+ _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR weak_ptr() _NOEXCEPT;
- template<class _Yp> weak_ptr(shared_ptr<_Yp> const& __r,
+ template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(shared_ptr<_Yp> const& __r,
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
_NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
weak_ptr(weak_ptr const& __r) _NOEXCEPT;
- template<class _Yp> weak_ptr(weak_ptr<_Yp> const& __r,
+ template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp> const& __r,
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
_NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
weak_ptr(weak_ptr&& __r) _NOEXCEPT;
- template<class _Yp> weak_ptr(weak_ptr<_Yp>&& __r,
+ template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r,
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
_NOEXCEPT;
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~weak_ptr();
+ _LIBCPP_INLINE_VISIBILITY
weak_ptr& operator=(weak_ptr const& __r) _NOEXCEPT;
template<class _Yp>
typename enable_if
@@ -5065,10 +5107,12 @@ public:
is_convertible<_Yp*, element_type*>::value,
weak_ptr&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT;
template<class _Yp>
typename enable_if
@@ -5076,6 +5120,7 @@ public:
is_convertible<_Yp*, element_type*>::value,
weak_ptr&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT;
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -5086,9 +5131,12 @@ public:
is_convertible<_Yp*, element_type*>::value,
weak_ptr&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
void swap(weak_ptr& __r) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
void reset() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
@@ -5112,7 +5160,7 @@ public:
};
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
weak_ptr<_Tp>::weak_ptr() _NOEXCEPT
: __ptr_(0),
@@ -5121,7 +5169,7 @@ weak_ptr<_Tp>::weak_ptr() _NOEXCEPT
}
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
weak_ptr<_Tp>::weak_ptr(weak_ptr const& __r) _NOEXCEPT
: __ptr_(__r.__ptr_),
__cntrl_(__r.__cntrl_)
@@ -5132,7 +5180,7 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr const& __r) _NOEXCEPT
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
weak_ptr<_Tp>::weak_ptr(shared_ptr<_Yp> const& __r,
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type)
_NOEXCEPT
@@ -5145,7 +5193,7 @@ weak_ptr<_Tp>::weak_ptr(shared_ptr<_Yp> const& __r,
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r,
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type)
_NOEXCEPT
@@ -5159,7 +5207,7 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r,
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) _NOEXCEPT
: __ptr_(__r.__ptr_),
__cntrl_(__r.__cntrl_)
@@ -5170,7 +5218,7 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) _NOEXCEPT
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp>&& __r,
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type)
_NOEXCEPT
@@ -5191,7 +5239,7 @@ weak_ptr<_Tp>::~weak_ptr()
}
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
weak_ptr<_Tp>&
weak_ptr<_Tp>::operator=(weak_ptr const& __r) _NOEXCEPT
{
@@ -5201,7 +5249,7 @@ weak_ptr<_Tp>::operator=(weak_ptr const& __r) _NOEXCEPT
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
is_convertible<_Yp*, _Tp*>::value,
@@ -5216,7 +5264,7 @@ weak_ptr<_Tp>::operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
weak_ptr<_Tp>&
weak_ptr<_Tp>::operator=(weak_ptr&& __r) _NOEXCEPT
{
@@ -5226,7 +5274,7 @@ weak_ptr<_Tp>::operator=(weak_ptr&& __r) _NOEXCEPT
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
is_convertible<_Yp*, _Tp*>::value,
@@ -5242,7 +5290,7 @@ weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT
template<class _Tp>
template<class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
is_convertible<_Yp*, _Tp*>::value,
@@ -5255,7 +5303,7 @@ weak_ptr<_Tp>::operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT
}
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
weak_ptr<_Tp>::swap(weak_ptr& __r) _NOEXCEPT
{
@@ -5272,7 +5320,7 @@ swap(weak_ptr<_Tp>& __x, weak_ptr<_Tp>& __y) _NOEXCEPT
}
template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
weak_ptr<_Tp>::reset() _NOEXCEPT
{
@@ -5305,7 +5353,11 @@ weak_ptr<_Tp>::lock() const _NOEXCEPT
return __r;
}
+#if _LIBCPP_STD_VER > 14
+template <class _Tp = void> struct owner_less;
+#else
template <class _Tp> struct owner_less;
+#endif
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY owner_less<shared_ptr<_Tp> >
@@ -5339,6 +5391,30 @@ struct _LIBCPP_TYPE_VIS_ONLY owner_less<weak_ptr<_Tp> >
{return __x.owner_before(__y);}
};
+#if _LIBCPP_STD_VER > 14
+template <>
+struct _LIBCPP_TYPE_VIS_ONLY owner_less<void>
+{
+ template <class _Tp, class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const
+ {return __x.owner_before(__y);}
+ template <class _Tp, class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()( shared_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const
+ {return __x.owner_before(__y);}
+ template <class _Tp, class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const
+ {return __x.owner_before(__y);}
+ template <class _Tp, class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const
+ {return __x.owner_before(__y);}
+ typedef void is_transparent;
+};
+#endif
+
template<class _Tp>
class _LIBCPP_TYPE_VIS_ONLY enable_shared_from_this
{
@@ -5381,7 +5457,9 @@ inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
-#if __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
+// TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
+// enabled with clang.
+#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
class _LIBCPP_TYPE_VIS __sp_mut
{
@@ -5507,7 +5585,7 @@ atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v
return atomic_compare_exchange_weak(__p, __v, __w);
}
-#endif // __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
+#endif // defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
//enum class
struct _LIBCPP_TYPE_VIS pointer_safety
@@ -5574,6 +5652,15 @@ template <typename _Alloc>
_LIBCPP_INLINE_VISIBILITY
void __swap_allocator(_Alloc &, _Alloc &, false_type) _NOEXCEPT {}
+template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
+struct __noexcept_move_assign_container : public integral_constant<bool,
+ _Traits::propagate_on_container_move_assignment::value
+#if _LIBCPP_STD_VER > 14
+ || _Traits::is_always_equal::value
+#else
+ && is_nothrow_move_assignable<_Alloc>::value
+#endif
+ > {};
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/module.modulemap b/include/module.modulemap
index 3c0700eca443..3fb7428411df 100644
--- a/include/module.modulemap
+++ b/include/module.modulemap
@@ -455,9 +455,13 @@ module std [system] {
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 __config { header "__config" export * }
module __debug { header "__debug" export * }
module __functional_base { header "__functional_base" export * }
module __hash_table { header "__hash_table" export * }
diff --git a/include/mutex b/include/mutex
index 373d75b09789..a0875a568ec6 100644
--- a/include/mutex
+++ b/include/mutex
@@ -179,7 +179,9 @@ template<class Callable, class ...Args>
#ifndef _LIBCPP_HAS_NO_VARIADICS
#include <tuple>
#endif
+#ifndef _LIBCPP_HAS_NO_THREADS
#include <sched.h>
+#endif
#include <__undef_min_max>
diff --git a/include/ostream b/include/ostream
index f55fd40856ec..01157b2377db 100644
--- a/include/ostream
+++ b/include/ostream
@@ -275,7 +275,7 @@ basic_ostream<_CharT, _Traits>::sentry::~sentry()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>::basic_ostream(basic_streambuf<char_type, traits_type>* __sb)
{
this->init(__sb);
@@ -284,14 +284,14 @@ basic_ostream<_CharT, _Traits>::basic_ostream(basic_streambuf<char_type, traits_
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>::basic_ostream(basic_ostream&& __rhs)
{
this->move(__rhs);
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator=(basic_ostream&& __rhs)
{
@@ -307,7 +307,7 @@ basic_ostream<_CharT, _Traits>::~basic_ostream()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_ostream<_CharT, _Traits>::swap(basic_ostream& __rhs)
{
@@ -315,7 +315,7 @@ basic_ostream<_CharT, _Traits>::swap(basic_ostream& __rhs)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(basic_ostream& (*__pf)(basic_ostream&))
{
@@ -323,7 +323,7 @@ basic_ostream<_CharT, _Traits>::operator<<(basic_ostream& (*__pf)(basic_ostream&
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(basic_ios<char_type, traits_type>&
(*__pf)(basic_ios<char_type,traits_type>&))
@@ -333,7 +333,7 @@ basic_ostream<_CharT, _Traits>::operator<<(basic_ios<char_type, traits_type>&
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(ios_base& (*__pf)(ios_base&))
{
@@ -989,7 +989,7 @@ basic_ostream<_CharT, _Traits>::flush()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename basic_ostream<_CharT, _Traits>::pos_type
basic_ostream<_CharT, _Traits>::tellp()
{
@@ -999,7 +999,7 @@ basic_ostream<_CharT, _Traits>::tellp()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
{
@@ -1013,7 +1013,7 @@ basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir)
{
@@ -1027,7 +1027,7 @@ basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>&
endl(basic_ostream<_CharT, _Traits>& __os)
{
@@ -1037,7 +1037,7 @@ endl(basic_ostream<_CharT, _Traits>& __os)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>&
ends(basic_ostream<_CharT, _Traits>& __os)
{
@@ -1046,7 +1046,7 @@ ends(basic_ostream<_CharT, _Traits>& __os)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>&
flush(basic_ostream<_CharT, _Traits>& __os)
{
@@ -1057,7 +1057,7 @@ flush(basic_ostream<_CharT, _Traits>& __os)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Stream, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
!is_lvalue_reference<_Stream>::value &&
@@ -1081,7 +1081,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec)
{
@@ -1089,7 +1089,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec)
}
template<class _CharT, class _Traits, class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p)
{
diff --git a/include/random b/include/random
index 64382a3d9aa6..794bf7b3fd15 100644
--- a/include/random
+++ b/include/random
@@ -3119,6 +3119,7 @@ public:
independent_bits_engine<_Eng, _Wp, _UI>& __x);
private:
+ _LIBCPP_INLINE_VISIBILITY
result_type __eval(false_type);
result_type __eval(true_type);
@@ -3144,7 +3145,7 @@ private:
};
template<class _Engine, size_t __w, class _UIntType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_UIntType
independent_bits_engine<_Engine, __w, _UIntType>::__eval(false_type)
{
@@ -3735,7 +3736,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG> _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
@@ -3765,7 +3766,7 @@ public:
template<class _RealType>
template<class _URNG>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename uniform_real_distribution<_RealType>::result_type
uniform_real_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
{
@@ -3851,7 +3852,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG> _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
@@ -3878,7 +3879,7 @@ public:
};
template<class _URNG>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bernoulli_distribution::result_type
bernoulli_distribution::operator()(_URNG& __g, const param_type& __p)
{
@@ -5522,7 +5523,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
result_type operator()(_URNG& __g)
{return (*this)(__g, __p_);}
- template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+ template<class _URNG> _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g, const param_type& __p);
// property functions
_LIBCPP_INLINE_VISIBILITY
@@ -5552,7 +5553,7 @@ public:
template <class _RealType>
template<class _URNG>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_RealType
cauchy_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
{
@@ -6044,9 +6045,6 @@ basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is,
discrete_distribution<_IT>& __x)
{
- typedef discrete_distribution<_IT> _Eng;
- typedef typename _Eng::result_type result_type;
- typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
__is.flags(ios_base::dec | ios_base::skipws);
size_t __n;
@@ -6358,7 +6356,6 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
{
typedef piecewise_constant_distribution<_RT> _Eng;
typedef typename _Eng::result_type result_type;
- typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
__is.flags(ios_base::dec | ios_base::skipws);
size_t __n;
@@ -6698,7 +6695,6 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
{
typedef piecewise_linear_distribution<_RT> _Eng;
typedef typename _Eng::result_type result_type;
- typedef typename _Eng::param_type param_type;
__save_flags<_CharT, _Traits> __lx(__is);
__is.flags(ios_base::dec | ios_base::skipws);
size_t __n;
diff --git a/include/ratio b/include/ratio
index f623a062f2ce..8f708ce478d3 100644
--- a/include/ratio
+++ b/include/ratio
@@ -62,6 +62,19 @@ typedef ratio< 1000000000000000000, 1> exa;
typedef ratio< 1000000000000000000000, 1> zetta; // not supported
typedef ratio<1000000000000000000000000, 1> yotta; // not supported
+ // 20.11.5, ratio comparison
+ template <class R1, class R2> constexpr bool ratio_equal_v
+ = ratio_equal<R1, R2>::value; // C++17
+ template <class R1, class R2> constexpr bool ratio_not_equal_v
+ = ratio_not_equal<R1, R2>::value; // C++17
+ template <class R1, class R2> constexpr bool ratio_less_v
+ = ratio_less<R1, R2>::value; // C++17
+ template <class R1, class R2> constexpr bool ratio_less_equal_v
+ = ratio_less_equal<R1, R2>::value; // C++17
+ template <class R1, class R2> constexpr bool ratio_greater_v
+ = ratio_greater<R1, R2>::value; // C++17
+ template <class R1, class R2> constexpr bool ratio_greater_equal_v
+ = ratio_greater_equal<R1, R2>::value; // C++17
}
*/
@@ -485,6 +498,26 @@ struct __ratio_gcd
__static_lcm<_R1::den, _R2::den>::value> type;
};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_equal_v
+ = ratio_equal<_R1, _R2>::value;
+
+template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_not_equal_v
+ = ratio_not_equal<_R1, _R2>::value;
+
+template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_less_v
+ = ratio_less<_R1, _R2>::value;
+
+template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_less_equal_v
+ = ratio_less_equal<_R1, _R2>::value;
+
+template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_v
+ = ratio_greater<_R1, _R2>::value;
+
+template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_equal_v
+ = ratio_greater_equal<_R1, _R2>::value;
+#endif
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_RATIO
diff --git a/include/regex b/include/regex
index bd48fb8da04b..b9dac4765cdf 100644
--- a/include/regex
+++ b/include/regex
@@ -762,6 +762,7 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
#include <memory>
#include <vector>
#include <deque>
+#include <cassert>
#include <__undef_min_max>
@@ -955,6 +956,17 @@ public:
regex_constants::error_type code() const {return __code_;}
};
+template <regex_constants::error_type _Ev>
+_LIBCPP_ALWAYS_INLINE
+void __throw_regex_error()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw regex_error(_Ev);
+#else
+ assert(!"regex_error");
+#endif
+}
+
template <class _CharT>
struct _LIBCPP_TYPE_VIS_ONLY regex_traits
{
@@ -1036,6 +1048,7 @@ private:
_LIBCPP_INLINE_VISIBILITY
int __regex_traits_value(char __ch, int __radix) const
{return __regex_traits_value(static_cast<unsigned char>(__ch), __radix);}
+ _LIBCPP_INLINE_VISIBILITY
int __regex_traits_value(wchar_t __ch, int __radix) const;
};
@@ -1258,7 +1271,7 @@ regex_traits<_CharT>::__regex_traits_value(unsigned char __ch, int __radix)
}
template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
int
regex_traits<_CharT>::__regex_traits_value(wchar_t __ch, int __radix) const
{
@@ -1721,6 +1734,8 @@ template <class _CharT>
void
__back_ref<_CharT>::__exec(__state& __s) const
{
+ if (__mexp_ > __s.__sub_matches_.size())
+ __throw_regex_error<regex_constants::error_backref>();
sub_match<const _CharT*>& __sm = __s.__sub_matches_[__mexp_-1];
if (__sm.matched)
{
@@ -2256,10 +2271,8 @@ public:
}
else
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__b.size() != 1 || __e.size() != 1)
- throw regex_error(regex_constants::error_collate);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_collate>();
if (__icase_)
{
__b[0] = __traits_.translate_nocase(__b[0]);
@@ -2952,7 +2965,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
__lookahead(const basic_regex<_CharT, _Traits>& __exp, bool __invert, __node<_CharT>* __s, unsigned __mexp)
- : base(__s), __exp_(__exp), __invert_(__invert), __mexp_(__mexp) {}
+ : base(__s), __exp_(__exp), __mexp_(__mexp), __invert_(__invert) {}
virtual void __exec(__state&) const;
};
@@ -3012,10 +3025,8 @@ basic_regex<_CharT, _Traits>::__parse(_ForwardIterator __first,
case egrep:
__first = __parse_egrep(__first, __last);
break;
-#ifndef _LIBCPP_NO_EXCEPTIONS
default:
- throw regex_error(regex_constants::__re_err_grammar);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::__re_err_grammar>();
}
return __first;
}
@@ -3046,10 +3057,8 @@ basic_regex<_CharT, _Traits>::__parse_basic_reg_exp(_ForwardIterator __first,
}
}
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first != __last)
- throw regex_error(regex_constants::__re_err_empty);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::__re_err_empty>();
}
return __first;
}
@@ -3062,19 +3071,15 @@ basic_regex<_CharT, _Traits>::__parse_extended_reg_exp(_ForwardIterator __first,
{
__owns_one_state<_CharT>* __sa = __end_;
_ForwardIterator __temp = __parse_ERE_branch(__first, __last);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __first)
- throw regex_error(regex_constants::__re_err_empty);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::__re_err_empty>();
__first = __temp;
while (__first != __last && *__first == '|')
{
__owns_one_state<_CharT>* __sb = __end_;
__temp = __parse_ERE_branch(++__first, __last);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __first)
- throw regex_error(regex_constants::__re_err_empty);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::__re_err_empty>();
__push_alternation(__sa, __sb);
__first = __temp;
}
@@ -3088,10 +3093,8 @@ basic_regex<_CharT, _Traits>::__parse_ERE_branch(_ForwardIterator __first,
_ForwardIterator __last)
{
_ForwardIterator __temp = __parse_ERE_expression(__first, __last);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __first)
- throw regex_error(regex_constants::__re_err_empty);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::__re_err_empty>();
do
{
__first = __temp;
@@ -3126,10 +3129,8 @@ basic_regex<_CharT, _Traits>::__parse_ERE_expression(_ForwardIterator __first,
unsigned __temp_count = __marked_count_;
++__open_count_;
__temp = __parse_extended_reg_exp(++__temp, __last);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __last || *__temp != ')')
- throw regex_error(regex_constants::error_paren);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_paren>();
__push_end_marked_subexpression(__temp_count);
--__open_count_;
++__temp;
@@ -3194,10 +3195,8 @@ basic_regex<_CharT, _Traits>::__parse_nondupl_RE(_ForwardIterator __first,
unsigned __temp_count = __marked_count_;
__first = __parse_RE_expression(__temp, __last);
__temp = __parse_Back_close_paren(__first, __last);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __first)
- throw regex_error(regex_constants::error_paren);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_paren>();
__push_end_marked_subexpression(__temp_count);
__first = __temp;
}
@@ -3511,22 +3510,16 @@ basic_regex<_CharT, _Traits>::__parse_RE_dupl_symbol(_ForwardIterator __first,
int __min = 0;
__first = __temp;
__temp = __parse_DUP_COUNT(__first, __last, __min);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __first)
- throw regex_error(regex_constants::error_badbrace);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_badbrace>();
__first = __temp;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_brace);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brace>();
if (*__first != ',')
{
__temp = __parse_Back_close_brace(__first, __last);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __first)
- throw regex_error(regex_constants::error_brace);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brace>();
__push_loop(__min, __min, __s, __mexp_begin, __mexp_end,
true);
__first = __temp;
@@ -3537,18 +3530,14 @@ basic_regex<_CharT, _Traits>::__parse_RE_dupl_symbol(_ForwardIterator __first,
int __max = -1;
__first = __parse_DUP_COUNT(__first, __last, __max);
__temp = __parse_Back_close_brace(__first, __last);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __first)
- throw regex_error(regex_constants::error_brace);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brace>();
if (__max == -1)
__push_greedy_inf_repeat(__min, __s, __mexp_begin, __mexp_end);
else
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__max < __min)
- throw regex_error(regex_constants::error_badbrace);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_badbrace>();
__push_loop(__min, __max, __s, __mexp_begin, __mexp_end,
true);
}
@@ -3608,15 +3597,11 @@ basic_regex<_CharT, _Traits>::__parse_ERE_dupl_symbol(_ForwardIterator __first,
{
int __min;
_ForwardIterator __temp = __parse_DUP_COUNT(++__first, __last, __min);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __first)
- throw regex_error(regex_constants::error_badbrace);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_badbrace>();
__first = __temp;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_brace);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brace>();
switch (*__first)
{
case '}':
@@ -3631,10 +3616,8 @@ basic_regex<_CharT, _Traits>::__parse_ERE_dupl_symbol(_ForwardIterator __first,
break;
case ',':
++__first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_badbrace);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_badbrace>();
if (*__first == '}')
{
++__first;
@@ -3650,20 +3633,14 @@ basic_regex<_CharT, _Traits>::__parse_ERE_dupl_symbol(_ForwardIterator __first,
{
int __max = -1;
__temp = __parse_DUP_COUNT(__first, __last, __max);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __first)
- throw regex_error(regex_constants::error_brace);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brace>();
__first = __temp;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last || *__first != '}')
- throw regex_error(regex_constants::error_brace);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brace>();
++__first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__max < __min)
- throw regex_error(regex_constants::error_badbrace);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_badbrace>();
if (__grammar == ECMAScript && __first != __last && *__first == '?')
{
++__first;
@@ -3673,10 +3650,8 @@ basic_regex<_CharT, _Traits>::__parse_ERE_dupl_symbol(_ForwardIterator __first,
__push_loop(__min, __max, __s, __mexp_begin, __mexp_end);
}
break;
-#ifndef _LIBCPP_NO_EXCEPTIONS
default:
- throw regex_error(regex_constants::error_badbrace);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_badbrace>();
}
}
break;
@@ -3694,10 +3669,8 @@ basic_regex<_CharT, _Traits>::__parse_bracket_expression(_ForwardIterator __firs
if (__first != __last && *__first == '[')
{
++__first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_brack);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brack>();
bool __negate = false;
if (*__first == '^')
{
@@ -3706,29 +3679,23 @@ basic_regex<_CharT, _Traits>::__parse_bracket_expression(_ForwardIterator __firs
}
__bracket_expression<_CharT, _Traits>* __ml = __start_matching_list(__negate);
// __ml owned by *this
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_brack);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brack>();
if ((__flags_ & 0x1F0) != ECMAScript && *__first == ']')
{
__ml->__add_char(']');
++__first;
}
__first = __parse_follow_list(__first, __last, __ml);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_brack);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brack>();
if (*__first == '-')
{
__ml->__add_char('-');
++__first;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last || *__first != ']')
- throw regex_error(regex_constants::error_brack);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brack>();
++__first;
}
return __first;
@@ -3848,10 +3815,8 @@ basic_regex<_CharT, _Traits>::__parse_class_escape(_ForwardIterator __first,
basic_string<_CharT>& __str,
__bracket_expression<_CharT, _Traits>* __ml)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
switch (*__first)
{
case 0:
@@ -3892,10 +3857,8 @@ basic_regex<_CharT, _Traits>::__parse_awk_escape(_ForwardIterator __first,
_ForwardIterator __last,
basic_string<_CharT>* __str)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
switch (*__first)
{
case '\\':
@@ -3963,10 +3926,8 @@ basic_regex<_CharT, _Traits>::__parse_awk_escape(_ForwardIterator __first,
else
__push_char(_CharT(__val));
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
else
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
return __first;
}
@@ -3982,18 +3943,14 @@ basic_regex<_CharT, _Traits>::__parse_equivalence_class(_ForwardIterator __first
value_type _Equal_close[2] = {'=', ']'};
_ForwardIterator __temp = _VSTD::search(__first, __last, _Equal_close,
_Equal_close+2);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __last)
- throw regex_error(regex_constants::error_brack);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brack>();
// [__first, __temp) contains all text in [= ... =]
typedef typename _Traits::string_type string_type;
string_type __collate_name =
__traits_.lookup_collatename(__first, __temp);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__collate_name.empty())
- throw regex_error(regex_constants::error_collate);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_collate>();
string_type __equiv_name =
__traits_.transform_primary(__collate_name.begin(),
__collate_name.end());
@@ -4009,10 +3966,8 @@ basic_regex<_CharT, _Traits>::__parse_equivalence_class(_ForwardIterator __first
case 2:
__ml->__add_digraph(__collate_name[0], __collate_name[1]);
break;
-#ifndef _LIBCPP_NO_EXCEPTIONS
default:
- throw regex_error(regex_constants::error_collate);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_collate>();
}
}
__first = _VSTD::next(__temp, 2);
@@ -4031,18 +3986,14 @@ basic_regex<_CharT, _Traits>::__parse_character_class(_ForwardIterator __first,
value_type _Colon_close[2] = {':', ']'};
_ForwardIterator __temp = _VSTD::search(__first, __last, _Colon_close,
_Colon_close+2);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __last)
- throw regex_error(regex_constants::error_brack);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brack>();
// [__first, __temp) contains all text in [: ... :]
typedef typename _Traits::char_class_type char_class_type;
char_class_type __class_type =
__traits_.lookup_classname(__first, __temp, __flags_ & icase);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__class_type == 0)
- throw regex_error(regex_constants::error_brack);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brack>();
__ml->__add_class(__class_type);
__first = _VSTD::next(__temp, 2);
return __first;
@@ -4060,22 +4011,17 @@ basic_regex<_CharT, _Traits>::__parse_collating_symbol(_ForwardIterator __first,
value_type _Dot_close[2] = {'.', ']'};
_ForwardIterator __temp = _VSTD::search(__first, __last, _Dot_close,
_Dot_close+2);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __last)
- throw regex_error(regex_constants::error_brack);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_brack>();
// [__first, __temp) contains all text in [. ... .]
- typedef typename _Traits::string_type string_type;
__col_sym = __traits_.lookup_collatename(__first, __temp);
switch (__col_sym.size())
{
case 1:
case 2:
break;
-#ifndef _LIBCPP_NO_EXCEPTIONS
default:
- throw regex_error(regex_constants::error_collate);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_collate>();
}
__first = _VSTD::next(__temp, 2);
return __first;
@@ -4219,10 +4165,8 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
unsigned __mexp = __exp.__marked_count_;
__push_lookahead(_VSTD::move(__exp), false, __marked_count_);
__marked_count_ += __mexp;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __last || *__temp != ')')
- throw regex_error(regex_constants::error_paren);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_paren>();
__first = ++__temp;
}
break;
@@ -4234,10 +4178,8 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
unsigned __mexp = __exp.__marked_count_;
__push_lookahead(_VSTD::move(__exp), true, __marked_count_);
__marked_count_ += __mexp;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__temp == __last || *__temp != ')')
- throw regex_error(regex_constants::error_paren);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_paren>();
__first = ++__temp;
}
break;
@@ -4274,19 +4216,15 @@ basic_regex<_CharT, _Traits>::__parse_atom(_ForwardIterator __first,
case '(':
{
++__first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_paren);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_paren>();
_ForwardIterator __temp = _VSTD::next(__first);
if (__temp != __last && *__first == '?' && *__temp == ':')
{
++__open_count_;
__first = __parse_ecma_exp(++__temp, __last);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last || *__first != ')')
- throw regex_error(regex_constants::error_paren);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_paren>();
--__open_count_;
++__first;
}
@@ -4296,16 +4234,20 @@ basic_regex<_CharT, _Traits>::__parse_atom(_ForwardIterator __first,
unsigned __temp_count = __marked_count_;
++__open_count_;
__first = __parse_ecma_exp(__first, __last);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last || *__first != ')')
- throw regex_error(regex_constants::error_paren);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_paren>();
__push_end_marked_subexpression(__temp_count);
--__open_count_;
++__first;
}
}
break;
+ case '*':
+ case '+':
+ case '?':
+ case '{':
+ __throw_regex_error<regex_constants::error_badrepeat>();
+ break;
default:
__first = __parse_pattern_character(__first, __last);
break;
@@ -4360,10 +4302,8 @@ basic_regex<_CharT, _Traits>::__parse_decimal_escape(_ForwardIterator __first,
unsigned __v = *__first - '0';
for (++__first; '0' <= *__first && *__first <= '9'; ++__first)
__v = 10 * __v + *__first - '0';
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__v > mark_count())
- throw regex_error(regex_constants::error_backref);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_backref>();
__push_back_ref(__v);
}
}
@@ -4479,62 +4419,42 @@ basic_regex<_CharT, _Traits>::__parse_character_escape(_ForwardIterator __first,
__push_char(_CharT(*__t % 32));
__first = ++__t;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
else
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
else
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
break;
case 'u':
++__first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
__hd = __traits_.value(*__first, 16);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__hd == -1)
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
__sum = 16 * __sum + static_cast<unsigned>(__hd);
++__first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
__hd = __traits_.value(*__first, 16);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__hd == -1)
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
__sum = 16 * __sum + static_cast<unsigned>(__hd);
// drop through
case 'x':
++__first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
__hd = __traits_.value(*__first, 16);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__hd == -1)
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
__sum = 16 * __sum + static_cast<unsigned>(__hd);
++__first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__first == __last)
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
__hd = __traits_.value(*__first, 16);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__hd == -1)
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
__sum = 16 * __sum + static_cast<unsigned>(__hd);
if (__str)
*__str = _CharT(__sum);
@@ -4558,10 +4478,8 @@ basic_regex<_CharT, _Traits>::__parse_character_escape(_ForwardIterator __first,
__push_char(*__first);
++__first;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
else
- throw regex_error(regex_constants::error_escape);
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_regex_error<regex_constants::error_escape>();
break;
}
}
@@ -5422,8 +5340,8 @@ match_results<_BidirectionalIterator, _Allocator>::match_results(
__unmatched_(),
__prefix_(),
__suffix_(),
- __position_start_(),
- __ready_(false)
+ __ready_(false),
+ __position_start_()
{
}
@@ -5648,9 +5566,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
__states.pop_back();
break;
default:
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw regex_error(regex_constants::__re_err_unknown);
-#endif
+ __throw_regex_error<regex_constants::__re_err_unknown>();
break;
}
@@ -5720,9 +5636,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
__states.pop_back();
break;
default:
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw regex_error(regex_constants::__re_err_unknown);
-#endif
+ __throw_regex_error<regex_constants::__re_err_unknown>();
break;
}
} while (!__states.empty());
@@ -5808,9 +5722,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
__states.pop_back();
break;
default:
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw regex_error(regex_constants::__re_err_unknown);
-#endif
+ __throw_regex_error<regex_constants::__re_err_unknown>();
break;
}
} while (!__states.empty());
diff --git a/include/scoped_allocator b/include/scoped_allocator
index cd4987ad9bb6..9436dac9c199 100644
--- a/include/scoped_allocator
+++ b/include/scoped_allocator
@@ -58,6 +58,8 @@ public:
template <class OuterA2>
scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other) noexcept;
+ scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor&) = default;
+ scoped_allocator_adaptor& operator=(scoped_allocator_adaptor&&) = default;
~scoped_allocator_adaptor();
inner_allocator_type& inner_allocator() noexcept;
@@ -457,6 +459,8 @@ public:
scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT
: base(_VSTD::move(__other)) {}
+ // scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor&) = default;
+ // scoped_allocator_adaptor& operator=(scoped_allocator_adaptor&&) = default;
// ~scoped_allocator_adaptor() = default;
_LIBCPP_INLINE_VISIBILITY
diff --git a/include/set b/include/set
index 9d64a521da11..ac69e085241f 100644
--- a/include/set
+++ b/include/set
@@ -409,6 +409,9 @@ public:
typedef value_type& reference;
typedef const value_type& const_reference;
+ static_assert((is_same<typename allocator_type::value_type, value_type>::value),
+ "Allocator::value_type must be same type as value_type");
+
private:
typedef __tree<value_type, value_compare, allocator_type> __base;
typedef allocator_traits<allocator_type> __alloc_traits;
@@ -819,6 +822,9 @@ public:
typedef value_type& reference;
typedef const value_type& const_reference;
+ static_assert((is_same<typename allocator_type::value_type, value_type>::value),
+ "Allocator::value_type must be same type as value_type");
+
private:
typedef __tree<value_type, value_compare, allocator_type> __base;
typedef allocator_traits<allocator_type> __alloc_traits;
diff --git a/include/setjmp.h b/include/setjmp.h
new file mode 100644
index 000000000000..464b4a540897
--- /dev/null
+++ b/include/setjmp.h
@@ -0,0 +1,45 @@
+// -*- C++ -*-
+//===--------------------------- setjmp.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_SETJMP_H
+#define _LIBCPP_SETJMP_H
+
+/*
+ setjmp.h synopsis
+
+Macros:
+
+ setjmp
+
+Types:
+
+ jmp_buf
+
+void longjmp(jmp_buf env, int val);
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <setjmp.h>
+
+#ifdef __cplusplus
+
+#ifndef setjmp
+#define setjmp(env) setjmp(env)
+#endif
+
+#endif // __cplusplus
+
+#endif // _LIBCPP_SETJMP_H
diff --git a/include/sstream b/include/sstream
index 27ae78f9d45f..308c3b62f2bc 100644
--- a/include/sstream
+++ b/include/sstream
@@ -236,7 +236,7 @@ protected:
};
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode __wch)
: __hm_(0),
__mode_(__wch)
@@ -245,7 +245,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(const string_type& __s,
ios_base::openmode __wch)
: __hm_(0),
@@ -425,7 +425,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x,
basic_stringbuf<_CharT, _Traits, _Allocator>& __y)
@@ -607,7 +607,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off,
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename basic_stringbuf<_CharT, _Traits, _Allocator>::pos_type
basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp,
ios_base::openmode __wch)
@@ -654,7 +654,7 @@ public:
};
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(ios_base::openmode __wch)
: basic_istream<_CharT, _Traits>(&__sb_),
__sb_(__wch | ios_base::in)
@@ -662,7 +662,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(ios_base::
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(const string_type& __s,
ios_base::openmode __wch)
: basic_istream<_CharT, _Traits>(&__sb_),
@@ -673,7 +673,7 @@ 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
+inline
basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(basic_istringstream&& __rhs)
: basic_istream<_CharT, _Traits>(_VSTD::move(__rhs)),
__sb_(_VSTD::move(__rhs.__sb_))
@@ -693,7 +693,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
+inline
void
basic_istringstream<_CharT, _Traits, _Allocator>::swap(basic_istringstream& __rhs)
{
@@ -702,7 +702,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::swap(basic_istringstream& __rh
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,
basic_istringstream<_CharT, _Traits, _Allocator>& __y)
@@ -711,7 +711,7 @@ swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_stringbuf<_CharT, _Traits, _Allocator>*
basic_istringstream<_CharT, _Traits, _Allocator>::rdbuf() const
{
@@ -719,7 +719,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::rdbuf() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_string<_CharT, _Traits, _Allocator>
basic_istringstream<_CharT, _Traits, _Allocator>::str() const
{
@@ -727,7 +727,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::str() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
{
@@ -773,7 +773,7 @@ public:
};
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(ios_base::openmode __wch)
: basic_ostream<_CharT, _Traits>(&__sb_),
__sb_(__wch | ios_base::out)
@@ -781,7 +781,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(ios_base::
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(const string_type& __s,
ios_base::openmode __wch)
: basic_ostream<_CharT, _Traits>(&__sb_),
@@ -792,7 +792,7 @@ 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
+inline
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(basic_ostringstream&& __rhs)
: basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs)),
__sb_(_VSTD::move(__rhs.__sb_))
@@ -812,7 +812,7 @@ 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
+inline
void
basic_ostringstream<_CharT, _Traits, _Allocator>::swap(basic_ostringstream& __rhs)
{
@@ -821,7 +821,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::swap(basic_ostringstream& __rh
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,
basic_ostringstream<_CharT, _Traits, _Allocator>& __y)
@@ -830,7 +830,7 @@ swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_stringbuf<_CharT, _Traits, _Allocator>*
basic_ostringstream<_CharT, _Traits, _Allocator>::rdbuf() const
{
@@ -838,7 +838,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::rdbuf() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_string<_CharT, _Traits, _Allocator>
basic_ostringstream<_CharT, _Traits, _Allocator>::str() const
{
@@ -846,7 +846,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::str() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_ostringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
{
@@ -892,7 +892,7 @@ public:
};
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(ios_base::openmode __wch)
: basic_iostream<_CharT, _Traits>(&__sb_),
__sb_(__wch)
@@ -900,7 +900,7 @@ basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(ios_base::op
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(const string_type& __s,
ios_base::openmode __wch)
: basic_iostream<_CharT, _Traits>(&__sb_),
@@ -911,7 +911,7 @@ 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
+inline
basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(basic_stringstream&& __rhs)
: basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs)),
__sb_(_VSTD::move(__rhs.__sb_))
@@ -931,7 +931,7 @@ 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
+inline
void
basic_stringstream<_CharT, _Traits, _Allocator>::swap(basic_stringstream& __rhs)
{
@@ -940,7 +940,7 @@ basic_stringstream<_CharT, _Traits, _Allocator>::swap(basic_stringstream& __rhs)
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,
basic_stringstream<_CharT, _Traits, _Allocator>& __y)
@@ -949,7 +949,7 @@ swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_stringbuf<_CharT, _Traits, _Allocator>*
basic_stringstream<_CharT, _Traits, _Allocator>::rdbuf() const
{
@@ -957,7 +957,7 @@ basic_stringstream<_CharT, _Traits, _Allocator>::rdbuf() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_string<_CharT, _Traits, _Allocator>
basic_stringstream<_CharT, _Traits, _Allocator>::str() const
{
@@ -965,7 +965,7 @@ basic_stringstream<_CharT, _Traits, _Allocator>::str() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_stringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
{
diff --git a/include/stddef.h b/include/stddef.h
new file mode 100644
index 000000000000..8841bbea2978
--- /dev/null
+++ b/include/stddef.h
@@ -0,0 +1,62 @@
+// -*- C++ -*-
+//===--------------------------- stddef.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.
+//
+//===----------------------------------------------------------------------===//
+
+#if defined(__need_ptrdiff_t) || defined(__need_size_t) || \
+ defined(__need_wchar_t) || defined(__need_NULL) || defined(__need_wint_t)
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <stddef.h>
+
+#elif !defined(_LIBCPP_STDDEF_H)
+#define _LIBCPP_STDDEF_H
+
+/*
+ stddef.h synopsis
+
+Macros:
+
+ offsetof(type,member-designator)
+ NULL
+
+Types:
+
+ ptrdiff_t
+ size_t
+ max_align_t
+ nullptr_t
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <stddef.h>
+
+#ifdef __cplusplus
+
+extern "C++" {
+#include <__nullptr>
+using std::nullptr_t;
+}
+
+// Re-use the compiler's <stddef.h> max_align_t where possible.
+#if !defined(__CLANG_MAX_ALIGN_T_DEFINED) && !defined(_GCC_MAX_ALIGN_T)
+typedef long double max_align_t;
+#endif
+
+#endif
+
+#endif // _LIBCPP_STDDEF_H
diff --git a/include/stdio.h b/include/stdio.h
new file mode 100644
index 000000000000..56fb2d83bb28
--- /dev/null
+++ b/include/stdio.h
@@ -0,0 +1,127 @@
+// -*- C++ -*-
+//===---------------------------- stdio.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.
+//
+//===----------------------------------------------------------------------===//
+
+#if defined(__need_FILE) || defined(__need___FILE)
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <stdio.h>
+
+#elif !defined(_LIBCPP_STDIO_H)
+#define _LIBCPP_STDIO_H
+
+/*
+ stdio.h synopsis
+
+Macros:
+
+ BUFSIZ
+ EOF
+ FILENAME_MAX
+ FOPEN_MAX
+ L_tmpnam
+ NULL
+ SEEK_CUR
+ SEEK_END
+ SEEK_SET
+ TMP_MAX
+ _IOFBF
+ _IOLBF
+ _IONBF
+ stderr
+ stdin
+ stdout
+
+Types:
+
+FILE
+fpos_t
+size_t
+
+int remove(const char* filename);
+int rename(const char* old, const char* new);
+FILE* tmpfile(void);
+char* tmpnam(char* s);
+int fclose(FILE* stream);
+int fflush(FILE* stream);
+FILE* fopen(const char* restrict filename, const char* restrict mode);
+FILE* freopen(const char* restrict filename, const char * restrict mode,
+ FILE * restrict stream);
+void setbuf(FILE* restrict stream, char* restrict buf);
+int setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size);
+int fprintf(FILE* restrict stream, const char* restrict format, ...);
+int fscanf(FILE* restrict stream, const char * restrict format, ...);
+int printf(const char* restrict format, ...);
+int scanf(const char* restrict format, ...);
+int snprintf(char* restrict s, size_t n, const char* restrict format, ...); // C99
+int sprintf(char* restrict s, const char* restrict format, ...);
+int sscanf(const char* restrict s, const char* restrict format, ...);
+int vfprintf(FILE* restrict stream, const char* restrict format, va_list arg);
+int vfscanf(FILE* restrict stream, const char* restrict format, va_list arg); // C99
+int vprintf(const char* restrict format, va_list arg);
+int vscanf(const char* restrict format, va_list arg); // C99
+int vsnprintf(char* restrict s, size_t n, const char* restrict format, // C99
+ va_list arg);
+int vsprintf(char* restrict s, const char* restrict format, va_list arg);
+int vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99
+int fgetc(FILE* stream);
+char* fgets(char* restrict s, int n, FILE* restrict stream);
+int fputc(int c, FILE* stream);
+int fputs(const char* restrict s, FILE* restrict stream);
+int getc(FILE* stream);
+int getchar(void);
+char* gets(char* s); // removed in C++14
+int putc(int c, FILE* stream);
+int putchar(int c);
+int puts(const char* s);
+int ungetc(int c, FILE* stream);
+size_t fread(void* restrict ptr, size_t size, size_t nmemb,
+ FILE* restrict stream);
+size_t fwrite(const void* restrict ptr, size_t size, size_t nmemb,
+ FILE* restrict stream);
+int fgetpos(FILE* restrict stream, fpos_t* restrict pos);
+int fseek(FILE* stream, long offset, int whence);
+int fsetpos(FILE*stream, const fpos_t* pos);
+long ftell(FILE* stream);
+void rewind(FILE* stream);
+void clearerr(FILE* stream);
+int feof(FILE* stream);
+int ferror(FILE* stream);
+void perror(const char* s);
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <stdio.h>
+
+#ifdef __cplusplus
+
+// snprintf
+#if defined(_LIBCPP_MSVCRT)
+extern "C++" {
+#include "support/win32/support.h"
+}
+#endif
+
+#undef getc
+#undef putc
+#undef clearerr
+#undef feof
+#undef ferror
+
+#endif
+
+#endif // _LIBCPP_STDIO_H
diff --git a/include/stdlib.h b/include/stdlib.h
new file mode 100644
index 000000000000..12fd676a15f5
--- /dev/null
+++ b/include/stdlib.h
@@ -0,0 +1,130 @@
+// -*- C++ -*-
+//===--------------------------- stdlib.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.
+//
+//===----------------------------------------------------------------------===//
+
+#if defined(__need_malloc_and_calloc)
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <stdlib.h>
+
+#elif !defined(_LIBCPP_STDLIB_H)
+#define _LIBCPP_STDLIB_H
+
+/*
+ stdlib.h synopsis
+
+Macros:
+
+ EXIT_FAILURE
+ EXIT_SUCCESS
+ MB_CUR_MAX
+ NULL
+ RAND_MAX
+
+Types:
+
+ size_t
+ div_t
+ ldiv_t
+ lldiv_t // C99
+
+double atof (const char* nptr);
+int atoi (const char* nptr);
+long atol (const char* nptr);
+long long atoll(const char* nptr); // C99
+double strtod (const char* restrict nptr, char** restrict endptr);
+float strtof (const char* restrict nptr, char** restrict endptr); // C99
+long double strtold (const char* restrict nptr, char** restrict endptr); // C99
+long strtol (const char* restrict nptr, char** restrict endptr, int base);
+long long strtoll (const char* restrict nptr, char** restrict endptr, int base); // C99
+unsigned long strtoul (const char* restrict nptr, char** restrict endptr, int base);
+unsigned long long strtoull(const char* restrict nptr, char** restrict endptr, int base); // C99
+int rand(void);
+void srand(unsigned int seed);
+void* calloc(size_t nmemb, size_t size);
+void free(void* ptr);
+void* malloc(size_t size);
+void* realloc(void* ptr, size_t size);
+void abort(void);
+int atexit(void (*func)(void));
+void exit(int status);
+void _Exit(int status);
+char* getenv(const char* name);
+int system(const char* string);
+void* bsearch(const void* key, const void* base, size_t nmemb, size_t size,
+ int (*compar)(const void *, const void *));
+void qsort(void* base, size_t nmemb, size_t size,
+ int (*compar)(const void *, const void *));
+int abs( int j);
+long abs( long j);
+long long abs(long long j); // C++0X
+long labs( long j);
+long long llabs(long long j); // C99
+div_t div( int numer, int denom);
+ldiv_t div( long numer, long denom);
+lldiv_t div(long long numer, long long denom); // C++0X
+ldiv_t ldiv( long numer, long denom);
+lldiv_t lldiv(long long numer, long long denom); // C99
+int mblen(const char* s, size_t n);
+int mbtowc(wchar_t* restrict pwc, const char* restrict s, size_t n);
+int wctomb(char* s, wchar_t wchar);
+size_t mbstowcs(wchar_t* restrict pwcs, const char* restrict s, size_t n);
+size_t wcstombs(char* restrict s, const wchar_t* restrict pwcs, size_t n);
+int at_quick_exit(void (*func)(void)) // C++11
+void quick_exit(int status); // C++11
+void *aligned_alloc(size_t alignment, size_t size); // C11
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <stdlib.h>
+
+#ifdef __cplusplus
+
+extern "C++" {
+
+#ifdef _LIBCPP_MSVCRT
+#include "support/win32/locale_win32.h"
+#endif // _LIBCPP_MSVCRT
+
+#undef abs
+#undef div
+#undef labs
+#undef ldiv
+#ifndef _LIBCPP_HAS_NO_LONG_LONG
+#undef llabs
+#undef lldiv
+#endif
+
+// MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined
+#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX)
+inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);}
+#ifndef _LIBCPP_HAS_NO_LONG_LONG
+inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
+#endif // _LIBCPP_HAS_NO_LONG_LONG
+
+inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);}
+#ifndef _LIBCPP_HAS_NO_LONG_LONG
+inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);}
+#endif // _LIBCPP_HAS_NO_LONG_LONG
+#endif // _LIBCPP_MSVCRT / __sun__ / _AIX
+
+} // extern "C++"
+
+#endif // __cplusplus
+
+#endif // _LIBCPP_STDLIB_H
diff --git a/include/streambuf b/include/streambuf
index 603c68038796..e75e8be2271d 100644
--- a/include/streambuf
+++ b/include/streambuf
@@ -220,7 +220,7 @@ basic_streambuf<_CharT, _Traits>::~basic_streambuf()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
locale
basic_streambuf<_CharT, _Traits>::pubimbue(const locale& __loc)
{
@@ -231,7 +231,7 @@ basic_streambuf<_CharT, _Traits>::pubimbue(const locale& __loc)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
locale
basic_streambuf<_CharT, _Traits>::getloc() const
{
@@ -239,7 +239,7 @@ basic_streambuf<_CharT, _Traits>::getloc() const
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_streambuf<_CharT, _Traits>*
basic_streambuf<_CharT, _Traits>::pubsetbuf(char_type* __s, streamsize __n)
{
@@ -247,7 +247,7 @@ basic_streambuf<_CharT, _Traits>::pubsetbuf(char_type* __s, streamsize __n)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename basic_streambuf<_CharT, _Traits>::pos_type
basic_streambuf<_CharT, _Traits>::pubseekoff(off_type __off,
ios_base::seekdir __way,
@@ -257,7 +257,7 @@ basic_streambuf<_CharT, _Traits>::pubseekoff(off_type __off,
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename basic_streambuf<_CharT, _Traits>::pos_type
basic_streambuf<_CharT, _Traits>::pubseekpos(pos_type __sp,
ios_base::openmode __which)
@@ -266,7 +266,7 @@ basic_streambuf<_CharT, _Traits>::pubseekpos(pos_type __sp,
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
int
basic_streambuf<_CharT, _Traits>::pubsync()
{
@@ -274,7 +274,7 @@ basic_streambuf<_CharT, _Traits>::pubsync()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
streamsize
basic_streambuf<_CharT, _Traits>::in_avail()
{
@@ -284,7 +284,7 @@ basic_streambuf<_CharT, _Traits>::in_avail()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::snextc()
{
@@ -294,7 +294,7 @@ basic_streambuf<_CharT, _Traits>::snextc()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::sbumpc()
{
@@ -304,7 +304,7 @@ basic_streambuf<_CharT, _Traits>::sbumpc()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::sgetc()
{
@@ -314,7 +314,7 @@ basic_streambuf<_CharT, _Traits>::sgetc()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
streamsize
basic_streambuf<_CharT, _Traits>::sgetn(char_type* __s, streamsize __n)
{
@@ -322,7 +322,7 @@ basic_streambuf<_CharT, _Traits>::sgetn(char_type* __s, streamsize __n)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::sputbackc(char_type __c)
{
@@ -332,7 +332,7 @@ basic_streambuf<_CharT, _Traits>::sputbackc(char_type __c)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::sungetc()
{
@@ -342,7 +342,7 @@ basic_streambuf<_CharT, _Traits>::sungetc()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::sputc(char_type __c)
{
@@ -353,7 +353,7 @@ basic_streambuf<_CharT, _Traits>::sputc(char_type __c)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
streamsize
basic_streambuf<_CharT, _Traits>::sputn(const char_type* __s, streamsize __n)
{
@@ -411,7 +411,7 @@ basic_streambuf<_CharT, _Traits>::swap(basic_streambuf& __sb)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_streambuf<_CharT, _Traits>::gbump(int __n)
{
@@ -419,7 +419,7 @@ basic_streambuf<_CharT, _Traits>::gbump(int __n)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_streambuf<_CharT, _Traits>::setg(char_type* __gbeg, char_type* __gnext,
char_type* __gend)
@@ -430,7 +430,7 @@ basic_streambuf<_CharT, _Traits>::setg(char_type* __gbeg, char_type* __gnext,
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_streambuf<_CharT, _Traits>::pbump(int __n)
{
@@ -438,7 +438,7 @@ basic_streambuf<_CharT, _Traits>::pbump(int __n)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_streambuf<_CharT, _Traits>::setp(char_type* __pbeg, char_type* __pend)
{
diff --git a/include/string b/include/string
index 6be21955b146..ee5db1aab63b 100644
--- a/include/string
+++ b/include/string
@@ -115,8 +115,8 @@ public:
basic_string& operator=(const basic_string& str);
basic_string& operator=(basic_string&& str)
noexcept(
- allocator_type::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value);
+ allocator_type::propagate_on_container_move_assignment::value ||
+ allocator_type::is_always_equal::value ); // C++17
basic_string& operator=(const value_type* s);
basic_string& operator=(value_type c);
basic_string& operator=(initializer_list<value_type>);
@@ -517,10 +517,14 @@ struct _LIBCPP_TYPE_VIS_ONLY char_traits
{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
@@ -550,7 +554,7 @@ char_traits<_CharT>::compare(const char_type* __s1, const char_type* __s2, size_
}
template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
size_t
char_traits<_CharT>::length(const char_type* __s)
{
@@ -561,7 +565,7 @@ char_traits<_CharT>::length(const char_type* __s)
}
template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
const _CharT*
char_traits<_CharT>::find(const char_type* __s, size_t __n, const char_type& __a)
{
@@ -595,7 +599,7 @@ char_traits<_CharT>::move(char_type* __s1, const char_type* __s2, size_t __n)
}
template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_CharT*
char_traits<_CharT>::copy(char_type* __s1, const char_type* __s2, size_t __n)
{
@@ -607,7 +611,7 @@ char_traits<_CharT>::copy(char_type* __s1, const char_type* __s2, size_t __n)
}
template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_CharT*
char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)
{
@@ -726,11 +730,17 @@ struct _LIBCPP_TYPE_VIS_ONLY char_traits<char16_t>
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
@@ -742,10 +752,10 @@ struct _LIBCPP_TYPE_VIS_ONLY char_traits<char16_t>
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(0xDFFF);}
+ {return int_type(0xFFFF);}
};
-inline _LIBCPP_INLINE_VISIBILITY
+inline
int
char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
{
@@ -759,7 +769,7 @@ char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, siz
return 0;
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
size_t
char_traits<char16_t>::length(const char_type* __s)
{
@@ -769,7 +779,7 @@ char_traits<char16_t>::length(const char_type* __s)
return __len;
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
const char16_t*
char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& __a)
{
@@ -782,7 +792,7 @@ char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& _
return 0;
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
char16_t*
char_traits<char16_t>::move(char_type* __s1, const char_type* __s2, size_t __n)
{
@@ -802,7 +812,7 @@ char_traits<char16_t>::move(char_type* __s1, const char_type* __s2, size_t __n)
return __r;
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
char16_t*
char_traits<char16_t>::copy(char_type* __s1, const char_type* __s2, size_t __n)
{
@@ -813,7 +823,7 @@ char_traits<char16_t>::copy(char_type* __s1, const char_type* __s2, size_t __n)
return __r;
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
char16_t*
char_traits<char16_t>::assign(char_type* __s, size_t __n, char_type __a)
{
@@ -839,11 +849,17 @@ struct _LIBCPP_TYPE_VIS_ONLY char_traits<char32_t>
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
@@ -858,7 +874,7 @@ struct _LIBCPP_TYPE_VIS_ONLY char_traits<char32_t>
{return int_type(0xFFFFFFFF);}
};
-inline _LIBCPP_INLINE_VISIBILITY
+inline
int
char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
{
@@ -872,7 +888,7 @@ char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, siz
return 0;
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
size_t
char_traits<char32_t>::length(const char_type* __s)
{
@@ -882,7 +898,7 @@ char_traits<char32_t>::length(const char_type* __s)
return __len;
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
const char32_t*
char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& __a)
{
@@ -895,7 +911,7 @@ char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& _
return 0;
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
char32_t*
char_traits<char32_t>::move(char_type* __s1, const char_type* __s2, size_t __n)
{
@@ -915,7 +931,7 @@ char_traits<char32_t>::move(char_type* __s1, const char_type* __s2, size_t __n)
return __r;
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
char32_t*
char_traits<char32_t>::copy(char_type* __s1, const char_type* __s2, size_t __n)
{
@@ -926,7 +942,7 @@ char_traits<char32_t>::copy(char_type* __s1, const char_type* __s2, size_t __n)
return __r;
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
char32_t*
char_traits<char32_t>::assign(char_type* __s, size_t __n, char_type __a)
{
@@ -1185,7 +1201,7 @@ _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS __basic_string_common<true>)
#pragma warning( pop )
#endif // _LIBCPP_MSVC
-#ifdef _LIBCPP_ALTERNATE_STRING_LAYOUT
+#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
template <class _CharT, size_t = sizeof(_CharT)>
struct __padding
@@ -1198,7 +1214,7 @@ struct __padding<_CharT, 1>
{
};
-#endif // _LIBCPP_ALTERNATE_STRING_LAYOUT
+#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
template<class _CharT, class _Traits, class _Allocator>
class _LIBCPP_TYPE_VIS_ONLY basic_string
@@ -1234,7 +1250,7 @@ public:
private:
-#ifdef _LIBCPP_ALTERNATE_STRING_LAYOUT
+#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
struct __long
{
@@ -1294,7 +1310,7 @@ private:
value_type __data_[__min_cap];
};
-#endif // _LIBCPP_ALTERNATE_STRING_LAYOUT
+#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
union __ulx{__long __lx; __short __lxx;};
@@ -1377,8 +1393,7 @@ public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
basic_string& operator=(basic_string&& __str)
- _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value);
+ _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
#endif
_LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);}
basic_string& operator=(value_type __c);
@@ -1445,7 +1460,8 @@ public:
_LIBCPP_INLINE_VISIBILITY size_type length() const _NOEXCEPT {return size();}
_LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY size_type capacity() const _NOEXCEPT
- {return (__is_long() ? __get_long_cap() : __min_cap) - 1;}
+ {return (__is_long() ? __get_long_cap()
+ : static_cast<size_type>(__min_cap)) - 1;}
void resize(size_type __n, value_type __c);
_LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}
@@ -1509,6 +1525,7 @@ public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
basic_string& assign(basic_string&& str)
+ _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))
{*this = _VSTD::move(str); return *this;}
#endif
basic_string& assign(const basic_string& __str, size_type __pos, size_type __n=npos);
@@ -1697,7 +1714,7 @@ private:
const allocator_type& __alloc() const _NOEXCEPT
{return __r_.second();}
-#ifdef _LIBCPP_ALTERNATE_STRING_LAYOUT
+#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
_LIBCPP_INLINE_VISIBILITY
void __set_short_size(size_type __s) _NOEXCEPT
@@ -1715,7 +1732,7 @@ private:
{return __r_.first().__s.__size_;}
# endif
-#else // _LIBCPP_ALTERNATE_STRING_LAYOUT
+#else // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
_LIBCPP_INLINE_VISIBILITY
void __set_short_size(size_type __s) _NOEXCEPT
@@ -1733,7 +1750,7 @@ private:
{return __r_.first().__s.__size_ >> 1;}
# endif
-#endif // _LIBCPP_ALTERNATE_STRING_LAYOUT
+#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
_LIBCPP_INLINE_VISIBILITY
void __set_long_size(size_type __s) _NOEXCEPT
@@ -1785,11 +1802,11 @@ private:
template <size_type __a> static
_LIBCPP_INLINE_VISIBILITY
size_type __align_it(size_type __s) _NOEXCEPT
- {return __s + (__a-1) & ~(__a-1);}
+ {return (__s + (__a-1)) & ~(__a-1);}
enum {__alignment = 16};
static _LIBCPP_INLINE_VISIBILITY
size_type __recommend(size_type __s) _NOEXCEPT
- {return (__s < __min_cap ? __min_cap :
+ {return (__s < __min_cap ? static_cast<size_type>(__min_cap) :
__align_it<sizeof(value_type) < __alignment ?
__alignment/sizeof(value_type) : 1 > (__s+1)) - 1;}
@@ -1845,11 +1862,16 @@ private:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
- void __move_assign(basic_string& __str, false_type);
+ void __move_assign(basic_string& __str, false_type)
+ _NOEXCEPT_(__alloc_traits::is_always_equal::value);
_LIBCPP_INLINE_VISIBILITY
void __move_assign(basic_string& __str, true_type)
+#if _LIBCPP_STD_VER > 14
+ _NOEXCEPT;
+#else
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
#endif
+#endif
_LIBCPP_INLINE_VISIBILITY
void
@@ -1936,7 +1958,12 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string()
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a)
- : __r_(__a)
+#if _LIBCPP_STD_VER <= 14
+ _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
+#else
+ _NOEXCEPT
+#endif
+: __r_(__a)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -2425,6 +2452,7 @@ template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, false_type)
+ _NOEXCEPT_(__alloc_traits::is_always_equal::value)
{
if (__alloc() != __str.__alloc())
assign(__str);
@@ -2436,7 +2464,11 @@ template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, true_type)
+#if _LIBCPP_STD_VER > 14
+ _NOEXCEPT
+#else
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
+#endif
{
clear();
shrink_to_fit();
@@ -2449,8 +2481,7 @@ template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::operator=(basic_string&& __str)
- _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value)
+ _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))
{
__move_assign(__str, integral_constant<bool,
__alloc_traits::propagate_on_container_move_assignment::value>());
@@ -3782,7 +3813,11 @@ bool
operator==(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT
{
- return __rhs.compare(__lhs) == 0;
+ typedef basic_string<_CharT, _Traits, _Allocator> _String;
+ _LIBCPP_ASSERT(__lhs != nullptr, "operator==(char*, basic_string): received nullptr");
+ size_t __lhs_len = _Traits::length(__lhs);
+ if (__lhs_len != __rhs.size()) return false;
+ return __rhs.compare(0, _String::npos, __lhs, __lhs_len) == 0;
}
template<class _CharT, class _Traits, class _Allocator>
@@ -3791,7 +3826,11 @@ bool
operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
const _CharT* __rhs) _NOEXCEPT
{
- return __lhs.compare(__rhs) == 0;
+ typedef basic_string<_CharT, _Traits, _Allocator> _String;
+ _LIBCPP_ASSERT(__rhs != nullptr, "operator==(basic_string, char*): received nullptr");
+ size_t __rhs_len = _Traits::length(__rhs);
+ if (__rhs_len != __lhs.size()) return false;
+ return __lhs.compare(0, _String::npos, __rhs, __rhs_len) == 0;
}
// operator!=
diff --git a/include/support/musl/xlocale.h b/include/support/musl/xlocale.h
new file mode 100644
index 000000000000..3e31c99596ce
--- /dev/null
+++ b/include/support/musl/xlocale.h
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+//===------------------- support/musl/xlocale.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.
+//
+//===----------------------------------------------------------------------===//
+// This adds support for the extended locale functions that are currently
+// missing from the Musl C library.
+//
+// This only works when the specified locale is "C" or "POSIX", but that's
+// about as good as we can do without implementing full xlocale support
+// in Musl.
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_MUSL_XLOCALE_H
+#define _LIBCPP_SUPPORT_MUSL_XLOCALE_H
+
+#include <cstdlib>
+#include <cwchar>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static inline long long strtoll_l(const char *nptr, char **endptr, int base,
+ locale_t) {
+ return strtoll(nptr, endptr, base);
+}
+
+static inline unsigned long long strtoull_l(const char *nptr, char **endptr,
+ int base, locale_t) {
+ return strtoull(nptr, endptr, base);
+}
+
+static inline long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr,
+ int base, locale_t) {
+ return wcstoll(nptr, endptr, base);
+}
+
+static inline unsigned long long wcstoull_l(const wchar_t *nptr,
+ wchar_t **endptr, int base,
+ locale_t) {
+ return wcstoull(nptr, endptr, base);
+}
+
+static inline long double wcstold_l(const wchar_t *nptr, wchar_t **endptr,
+ locale_t) {
+ return wcstold(nptr, endptr);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _LIBCPP_SUPPORT_MUSL_XLOCALE_H
diff --git a/include/system_error b/include/system_error
index 66bf6d6c4249..134bb3274031 100644
--- a/include/system_error
+++ b/include/system_error
@@ -371,7 +371,7 @@ public:
error_category() _NOEXCEPT;
#else
_LIBCPP_ALWAYS_INLINE
- _LIBCPP_CONSTEXPR_AFTER_CXX11 error_category() _NOEXCEPT _LIBCPP_DEFAULT;
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 error_category() _NOEXCEPT _LIBCPP_DEFAULT
#endif
private:
error_category(const error_category&);// = delete;
diff --git a/include/thread b/include/thread
index 8a30102f427e..6857e9edb68b 100644
--- a/include/thread
+++ b/include/thread
@@ -113,11 +113,38 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
_LIBCPP_BEGIN_NAMESPACE_STD
+template <class _Tp> class __thread_specific_ptr;
+class _LIBCPP_TYPE_VIS __thread_struct;
+class _LIBCPP_HIDDEN __thread_struct_imp;
+class __assoc_sub_state;
+
+_LIBCPP_FUNC_VIS __thread_specific_ptr<__thread_struct>& __thread_local_data();
+
+class _LIBCPP_TYPE_VIS __thread_struct
+{
+ __thread_struct_imp* __p_;
+
+ __thread_struct(const __thread_struct&);
+ __thread_struct& operator=(const __thread_struct&);
+public:
+ __thread_struct();
+ ~__thread_struct();
+
+ void notify_all_at_thread_exit(condition_variable*, mutex*);
+ void __make_ready_at_thread_exit(__assoc_sub_state*);
+};
+
template <class _Tp>
class __thread_specific_ptr
{
pthread_key_t __key_;
+ // Only __thread_local_data() may construct a __thread_specific_ptr
+ // and only with _Tp == __thread_struct.
+ static_assert((is_same<_Tp, __thread_struct>::value), "");
+ __thread_specific_ptr();
+ friend _LIBCPP_FUNC_VIS __thread_specific_ptr<__thread_struct>& __thread_local_data();
+
__thread_specific_ptr(const __thread_specific_ptr&);
__thread_specific_ptr& operator=(const __thread_specific_ptr&);
@@ -125,7 +152,6 @@ class __thread_specific_ptr
public:
typedef _Tp* pointer;
- __thread_specific_ptr();
~__thread_specific_ptr();
_LIBCPP_INLINE_VISIBILITY
@@ -159,7 +185,10 @@ __thread_specific_ptr<_Tp>::__thread_specific_ptr()
template <class _Tp>
__thread_specific_ptr<_Tp>::~__thread_specific_ptr()
{
- pthread_key_delete(__key_);
+ // __thread_specific_ptr is only created with a static storage duration
+ // so this destructor is only invoked during program termination. Invoking
+ // pthread_key_delete(__key_) may prevent other threads from deleting their
+ // thread local data. For this reason we leak the key.
}
template <class _Tp>
@@ -289,6 +318,7 @@ public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
thread(thread&& __t) _NOEXCEPT : __t_(__t.__t_) {__t.__t_ = 0;}
+ _LIBCPP_INLINE_VISIBILITY
thread& operator=(thread&& __t) _NOEXCEPT;
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -307,26 +337,6 @@ public:
static unsigned hardware_concurrency() _NOEXCEPT;
};
-class __assoc_sub_state;
-
-class _LIBCPP_HIDDEN __thread_struct_imp;
-
-class _LIBCPP_TYPE_VIS __thread_struct
-{
- __thread_struct_imp* __p_;
-
- __thread_struct(const __thread_struct&);
- __thread_struct& operator=(const __thread_struct&);
-public:
- __thread_struct();
- ~__thread_struct();
-
- void notify_all_at_thread_exit(condition_variable*, mutex*);
- void __make_ready_at_thread_exit(__assoc_sub_state*);
-};
-
-_LIBCPP_FUNC_VIS __thread_specific_ptr<__thread_struct>& __thread_local_data();
-
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _Fp, class ..._Args, size_t ..._Indices>
@@ -390,7 +400,7 @@ thread::thread(_Fp __f)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-inline _LIBCPP_INLINE_VISIBILITY
+inline
thread&
thread::operator=(thread&& __t) _NOEXCEPT
{
diff --git a/include/tuple b/include/tuple
index 3a22aa5ff5ac..cb1e27d93cf2 100644
--- a/include/tuple
+++ b/include/tuple
@@ -80,28 +80,33 @@ template <class... Tuples> tuple<CTypes...> tuple_cat(Tuples&&... tpls); // cons
// 20.4.1.4, tuple helper classes:
template <class T> class tuple_size; // undefined
template <class... T> class tuple_size<tuple<T...>>;
-template <intsize_t I, class T> class tuple_element; // undefined
-template <intsize_t I, class... T> class tuple_element<I, tuple<T...>>;
-template <size_t _Ip, class ..._Tp>
- using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type; // C++14
+template <size_t I, class T> class tuple_element; // undefined
+template <size_t I, class... T> class tuple_element<I, tuple<T...>>;
+template <size_t I, class T>
+ using tuple_element_t = typename tuple_element <I, T>::type; // C++14
// 20.4.1.5, element access:
-template <intsize_t I, class... T>
+template <size_t I, class... T>
typename tuple_element<I, tuple<T...>>::type&
get(tuple<T...>&) noexcept; // constexpr in C++14
-template <intsize_t I, class... T>
- typename const tuple_element<I, tuple<T...>>::type &
+template <size_t I, class... T>
+ const typename tuple_element<I, tuple<T...>>::type&
get(const tuple<T...>&) noexcept; // constexpr in C++14
-template <intsize_t I, class... T>
+template <size_t I, class... T>
typename tuple_element<I, tuple<T...>>::type&&
get(tuple<T...>&&) noexcept; // constexpr in C++14
+template <size_t I, class... T>
+ const typename tuple_element<I, tuple<T...>>::type&&
+ get(const tuple<T...>&&) noexcept; // constexpr in C++14
template <class T1, class... T>
constexpr T1& get(tuple<T...>&) noexcept; // C++14
template <class T1, class... T>
- constexpr T1 const& get(const tuple<T...>&) noexcept; // C++14
+ constexpr const T1& get(const tuple<T...>&) noexcept; // C++14
template <class T1, class... T>
constexpr T1&& get(tuple<T...>&&) noexcept; // C++14
+template <class T1, class... T>
+ constexpr const T1&& get(const tuple<T...>&&) noexcept; // C++14
// 20.4.1.6, relational operators:
template<class... T, class... U> bool operator==(const tuple<T...>&, const tuple<U...>&); // constexpr in C++14
@@ -507,6 +512,8 @@ class _LIBCPP_TYPE_VIS_ONLY tuple
const typename tuple_element<_Jp, tuple<_Up...> >::type& get(const tuple<_Up...>&) _NOEXCEPT;
template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Jp, tuple<_Up...> >::type&& get(tuple<_Up...>&&) _NOEXCEPT;
+ template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
+ const typename tuple_element<_Jp, tuple<_Up...> >::type&& get(const tuple<_Up...>&&) _NOEXCEPT;
public:
template <bool _Dummy = true, class = typename enable_if<
@@ -766,6 +773,16 @@ get(tuple<_Tp...>&& __t) _NOEXCEPT
static_cast<__tuple_leaf<_Ip, type>&&>(__t.base_).get());
}
+template <size_t _Ip, class ..._Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+const typename tuple_element<_Ip, tuple<_Tp...> >::type&&
+get(const tuple<_Tp...>&& __t) _NOEXCEPT
+{
+ typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type;
+ return static_cast<const type&&>(
+ static_cast<const __tuple_leaf<_Ip, type>&&>(__t.base_).get());
+}
+
#if _LIBCPP_STD_VER > 11
// get by type
template <typename _T1, size_t _Idx, typename... _Args>
@@ -822,6 +839,13 @@ constexpr _T1&& get(tuple<_Args...>&& __tup) noexcept
return _VSTD::get<__find_exactly_one_t<_T1, _Args...>::value>(_VSTD::move(__tup));
}
+template <class _T1, class... _Args>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1 const&& get(tuple<_Args...> const&& __tup) noexcept
+{
+ return _VSTD::get<__find_exactly_one_t<_T1, _Args...>::value>(_VSTD::move(__tup));
+}
+
#endif
// tie
diff --git a/include/type_traits b/include/type_traits
index a0c1bc565c04..b7adfebceeb9 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -203,8 +203,160 @@ namespace std
using result_of_t = typename result_of<F(ArgTypes...)>::type; // C++14
template <class...>
- using void_t = void;
-} // C++17
+ using void_t = void; // C++17
+
+ // See C++14 20.10.4.1, primary type categories
+ template <class T> constexpr bool is_void_v
+ = is_void<T>::value; // C++17
+ template <class T> constexpr bool is_null_pointer_v
+ = is_null_pointer<T>::value; // C++17
+ template <class T> constexpr bool is_integral_v
+ = is_integral<T>::value; // C++17
+ template <class T> constexpr bool is_floating_point_v
+ = is_floating_point<T>::value; // C++17
+ template <class T> constexpr bool is_array_v
+ = is_array<T>::value; // C++17
+ template <class T> constexpr bool is_pointer_v
+ = is_pointer<T>::value; // C++17
+ template <class T> constexpr bool is_lvalue_reference_v
+ = is_lvalue_reference<T>::value; // C++17
+ template <class T> constexpr bool is_rvalue_reference_v
+ = is_rvalue_reference<T>::value; // C++17
+ template <class T> constexpr bool is_member_object_pointer_v
+ = is_member_object_pointer<T>::value; // C++17
+ template <class T> constexpr bool is_member_function_pointer_v
+ = is_member_function_pointer<T>::value; // C++17
+ template <class T> constexpr bool is_enum_v
+ = is_enum<T>::value; // C++17
+ template <class T> constexpr bool is_union_v
+ = is_union<T>::value; // C++17
+ template <class T> constexpr bool is_class_v
+ = is_class<T>::value; // C++17
+ template <class T> constexpr bool is_function_v
+ = is_function<T>::value; // C++17
+
+ // See C++14 20.10.4.2, composite type categories
+ template <class T> constexpr bool is_reference_v
+ = is_reference<T>::value; // C++17
+ template <class T> constexpr bool is_arithmetic_v
+ = is_arithmetic<T>::value; // C++17
+ template <class T> constexpr bool is_fundamental_v
+ = is_fundamental<T>::value; // C++17
+ template <class T> constexpr bool is_object_v
+ = is_object<T>::value; // C++17
+ template <class T> constexpr bool is_scalar_v
+ = is_scalar<T>::value; // C++17
+ template <class T> constexpr bool is_compound_v
+ = is_compound<T>::value; // C++17
+ template <class T> constexpr bool is_member_pointer_v
+ = is_member_pointer<T>::value; // C++17
+
+ // See C++14 20.10.4.3, type properties
+ template <class T> constexpr bool is_const_v
+ = is_const<T>::value; // C++17
+ template <class T> constexpr bool is_volatile_v
+ = is_volatile<T>::value; // C++17
+ template <class T> constexpr bool is_trivial_v
+ = is_trivial<T>::value; // C++17
+ template <class T> constexpr bool is_trivially_copyable_v
+ = is_trivially_copyable<T>::value; // C++17
+ template <class T> constexpr bool is_standard_layout_v
+ = is_standard_layout<T>::value; // C++17
+ template <class T> constexpr bool is_pod_v
+ = is_pod<T>::value; // C++17
+ template <class T> constexpr bool is_literal_type_v
+ = is_literal_type<T>::value; // C++17
+ template <class T> constexpr bool is_empty_v
+ = is_empty<T>::value; // C++17
+ template <class T> constexpr bool is_polymorphic_v
+ = is_polymorphic<T>::value; // C++17
+ template <class T> constexpr bool is_abstract_v
+ = is_abstract<T>::value; // C++17
+ template <class T> constexpr bool is_final_v
+ = is_final<T>::value; // C++17
+ template <class T> constexpr bool is_signed_v
+ = is_signed<T>::value; // C++17
+ template <class T> constexpr bool is_unsigned_v
+ = is_unsigned<T>::value; // C++17
+ template <class T, class... Args> constexpr bool is_constructible_v
+ = is_constructible<T, Args...>::value; // C++17
+ template <class T> constexpr bool is_default_constructible_v
+ = is_default_constructible<T>::value; // C++17
+ template <class T> constexpr bool is_copy_constructible_v
+ = is_copy_constructible<T>::value; // C++17
+ template <class T> constexpr bool is_move_constructible_v
+ = is_move_constructible<T>::value; // C++17
+ template <class T, class U> constexpr bool is_assignable_v
+ = is_assignable<T, U>::value; // C++17
+ template <class T> constexpr bool is_copy_assignable_v
+ = is_copy_assignable<T>::value; // C++17
+ template <class T> constexpr bool is_move_assignable_v
+ = is_move_assignable<T>::value; // C++17
+ template <class T> constexpr bool is_destructible_v
+ = is_destructible<T>::value; // C++17
+ template <class T, class... Args> constexpr bool is_trivially_constructible_v
+ = is_trivially_constructible<T, Args...>::value; // C++17
+ template <class T> constexpr bool is_trivially_default_constructible_v
+ = is_trivially_default_constructible<T>::value; // C++17
+ template <class T> constexpr bool is_trivially_copy_constructible_v
+ = is_trivially_copy_constructible<T>::value; // C++17
+ template <class T> constexpr bool is_trivially_move_constructible_v
+ = is_trivially_move_constructible<T>::value; // C++17
+ template <class T, class U> constexpr bool is_trivially_assignable_v
+ = is_trivially_assignable<T, U>::value; // C++17
+ template <class T> constexpr bool is_trivially_copy_assignable_v
+ = is_trivially_copy_assignable<T>::value; // C++17
+ template <class T> constexpr bool is_trivially_move_assignable_v
+ = is_trivially_move_assignable<T>::value; // C++17
+ template <class T> constexpr bool is_trivially_destructible_v
+ = is_trivially_destructible<T>::value; // C++17
+ template <class T, class... Args> constexpr bool is_nothrow_constructible_v
+ = is_nothrow_constructible<T, Args...>::value; // C++17
+ template <class T> constexpr bool is_nothrow_default_constructible_v
+ = is_nothrow_default_constructible<T>::value; // C++17
+ template <class T> constexpr bool is_nothrow_copy_constructible_v
+ = is_nothrow_copy_constructible<T>::value; // C++17
+ template <class T> constexpr bool is_nothrow_move_constructible_v
+ = is_nothrow_move_constructible<T>::value; // C++17
+ template <class T, class U> constexpr bool is_nothrow_assignable_v
+ = is_nothrow_assignable<T, U>::value; // C++17
+ template <class T> constexpr bool is_nothrow_copy_assignable_v
+ = is_nothrow_copy_assignable<T>::value; // C++17
+ template <class T> constexpr bool is_nothrow_move_assignable_v
+ = is_nothrow_move_assignable<T>::value; // C++17
+ template <class T> constexpr bool is_nothrow_destructible_v
+ = is_nothrow_destructible<T>::value; // C++17
+ template <class T> constexpr bool has_virtual_destructor_v
+ = has_virtual_destructor<T>::value; // C++17
+
+ // See C++14 20.10.5, type property queries
+ template <class T> constexpr size_t alignment_of_v
+ = alignment_of<T>::value; // C++17
+ template <class T> constexpr size_t rank_v
+ = rank<T>::value; // C++17
+ template <class T, unsigned I = 0> constexpr size_t extent_v
+ = extent<T, I>::value; // C++17
+
+ // See C++14 20.10.6, type relations
+ template <class T, class U> constexpr bool is_same_v
+ = is_same<T, U>::value; // C++17
+ template <class Base, class Derived> constexpr bool is_base_of_v
+ = is_base_of<Base, Derived>::value; // C++17
+ template <class From, class To> constexpr bool is_convertible_v
+ = is_convertible<From, To>::value; // C++17
+
+ // [meta.logical], logical operator traits:
+ template<class... B> struct conjunction; // C++17
+ template<class... B>
+ constexpr bool conjunction_v = conjunction<B...>::value; // C++17
+ template<class... B> struct disjunction; // C++17
+ template<class... B>
+ constexpr bool disjunction_v = disjunction<B...>::value; // C++17
+ template<class B> struct negation; // C++17
+ template<class B>
+ constexpr bool negation_v = negation<B>::value; // C++17
+
+}
*/
#include <__config>
@@ -244,6 +396,55 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY enable_if<true, _Tp> {typedef
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
#endif
+// addressof
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+_Tp*
+addressof(_Tp& __x) _NOEXCEPT
+{
+ return (_Tp*)&reinterpret_cast<const volatile char&>(__x);
+}
+
+#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
+// Objective-C++ Automatic Reference Counting uses qualified pointers
+// that require special addressof() signatures. When
+// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
+// itself is providing these definitions. Otherwise, we provide them.
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+__strong _Tp*
+addressof(__strong _Tp& __x) _NOEXCEPT
+{
+ return &__x;
+}
+
+#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+__weak _Tp*
+addressof(__weak _Tp& __x) _NOEXCEPT
+{
+ return &__x;
+}
+#endif
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+__autoreleasing _Tp*
+addressof(__autoreleasing _Tp& __x) _NOEXCEPT
+{
+ return &__x;
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+__unsafe_unretained _Tp*
+addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
+{
+ return &__x;
+}
+#endif
struct __two {char __lx[2];};
@@ -269,24 +470,111 @@ _LIBCPP_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value;
#if _LIBCPP_STD_VER > 14
template <bool __b>
using bool_constant = integral_constant<bool, __b>;
-#define _LIBCPP_BOOL_CONSTANT(__b) bool_constant<(__b)>
+#define _LIBCPP_BOOL_CONSTANT(__b) bool_constant<(__b)>
#else
-#define _LIBCPP_BOOL_CONSTANT(__b) integral_constant<bool,(__b)>
+#define _LIBCPP_BOOL_CONSTANT(__b) integral_constant<bool,(__b)>
#endif
typedef _LIBCPP_BOOL_CONSTANT(true) true_type;
typedef _LIBCPP_BOOL_CONSTANT(false) false_type;
+#if !defined(_LIBCPP_HAS_NO_VARIADICS)
+
+// __lazy_and
+
+template <bool _Last, class ..._Preds>
+struct __lazy_and_impl;
+
+template <class ..._Preds>
+struct __lazy_and_impl<false, _Preds...> : false_type {};
+
+template <>
+struct __lazy_and_impl<true> : true_type {};
+
+template <class _Pred>
+struct __lazy_and_impl<true, _Pred> : integral_constant<bool, _Pred::type::value> {};
+
+template <class _Hp, class ..._Tp>
+struct __lazy_and_impl<true, _Hp, _Tp...> : __lazy_and_impl<_Hp::type::value, _Tp...> {};
+
+template <class _P1, class ..._Pr>
+struct __lazy_and : __lazy_and_impl<_P1::type::value, _Pr...> {};
+
+// __lazy_or
+
+template <bool _List, class ..._Preds>
+struct __lazy_or_impl;
+
+template <class ..._Preds>
+struct __lazy_or_impl<true, _Preds...> : true_type {};
+
+template <>
+struct __lazy_or_impl<false> : false_type {};
+
+template <class _Hp, class ..._Tp>
+struct __lazy_or_impl<false, _Hp, _Tp...>
+ : __lazy_or_impl<_Hp::type::value, _Tp...> {};
+
+template <class _P1, class ..._Pr>
+struct __lazy_or : __lazy_or_impl<_P1::type::value, _Pr...> {};
+
+// __lazy_not
+
+template <class _Pred>
+struct __lazy_not : integral_constant<bool, !_Pred::type::value> {};
+
+// __and_
+template<class...> struct __and_;
+template<> struct __and_<> : true_type {};
+
+template<class _B0> struct __and_<_B0> : _B0 {};
+
+template<class _B0, class _B1>
+struct __and_<_B0, _B1> : conditional<_B0::value, _B1, _B0>::type {};
+
+template<class _B0, class _B1, class _B2, class... _Bn>
+struct __and_<_B0, _B1, _B2, _Bn...>
+ : conditional<_B0::value, __and_<_B1, _B2, _Bn...>, _B0>::type {};
+
+// __or_
+template<class...> struct __or_;
+template<> struct __or_<> : false_type {};
+
+template<class _B0> struct __or_<_B0> : _B0 {};
+
+template<class _B0, class _B1>
+struct __or_<_B0, _B1> : conditional<_B0::value, _B0, _B1>::type {};
+
+template<class _B0, class _B1, class _B2, class... _Bn>
+struct __or_<_B0, _B1, _B2, _Bn...>
+ : conditional<_B0::value, _B0, __or_<_B1, _B2, _Bn...> >::type {};
+
+// __not_
+template<class _Tp>
+struct __not_ : conditional<_Tp::value, false_type, true_type>::type {};
+
+#endif // !defined(_LIBCPP_HAS_NO_VARIADICS)
+
// is_const
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_const : public false_type {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_const<_Tp const> : public true_type {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_const_v
+ = is_const<_Tp>::value;
+#endif
+
// is_volatile
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_volatile : public false_type {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_volatile<_Tp volatile> : public true_type {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_volatile_v
+ = is_volatile<_Tp>::value;
+#endif
+
// remove_const
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_const {typedef _Tp type;};
@@ -319,6 +607,11 @@ template <> struct __libcpp_is_void<void> : public true_type {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_void
: public __libcpp_is_void<typename remove_cv<_Tp>::type> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_void_v
+ = is_void<_Tp>::value;
+#endif
+
// __is_nullptr_t
template <class _Tp> struct __is_nullptr_t_impl : public false_type {};
@@ -330,6 +623,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY __is_nullptr_t
#if _LIBCPP_STD_VER > 11
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_null_pointer
: public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
+
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_null_pointer_v
+ = is_null_pointer<_Tp>::value;
+#endif
#endif
// is_integral
@@ -360,6 +658,11 @@ template <> struct __libcpp_is_integral<__uint128_t> : public tr
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_integral
: public __libcpp_is_integral<typename remove_cv<_Tp>::type> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_integral_v
+ = is_integral<_Tp>::value;
+#endif
+
// is_floating_point
template <class _Tp> struct __libcpp_is_floating_point : public false_type {};
@@ -370,6 +673,11 @@ template <> struct __libcpp_is_floating_point<long double> : public tru
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_floating_point
: public __libcpp_is_floating_point<typename remove_cv<_Tp>::type> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_floating_point_v
+ = is_floating_point<_Tp>::value;
+#endif
+
// is_array
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_array
@@ -379,6 +687,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_array<_Tp[]>
template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY is_array<_Tp[_Np]>
: public true_type {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_array_v
+ = is_array<_Tp>::value;
+#endif
+
// is_pointer
template <class _Tp> struct __libcpp_is_pointer : public false_type {};
@@ -387,6 +700,11 @@ template <class _Tp> struct __libcpp_is_pointer<_Tp*> : public true_type {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pointer
: public __libcpp_is_pointer<typename remove_cv<_Tp>::type> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_pointer_v
+ = is_pointer<_Tp>::value;
+#endif
+
// is_reference
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_lvalue_reference : public false_type {};
@@ -403,6 +721,16 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference<_Tp&> : public t
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference<_Tp&&> : public true_type {};
#endif
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_reference_v
+ = is_reference<_Tp>::value;
+
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_lvalue_reference_v
+ = is_lvalue_reference<_Tp>::value;
+
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_rvalue_reference_v
+ = is_rvalue_reference<_Tp>::value;
+#endif
// is_union
#if __has_feature(is_union) || (_GNUC_VER >= 403)
@@ -418,6 +746,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_union
#endif
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_union_v
+ = is_union<_Tp>::value;
+#endif
+
// is_class
#if __has_feature(is_class) || (_GNUC_VER >= 403)
@@ -438,11 +771,21 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_class
#endif
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_class_v
+ = is_class<_Tp>::value;
+#endif
+
// is_same
template <class _Tp, class _Up> struct _LIBCPP_TYPE_VIS_ONLY is_same : public false_type {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_same<_Tp, _Tp> : public true_type {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp, class _Up> _LIBCPP_CONSTEXPR bool is_same_v
+ = is_same<_Tp, _Up>::value;
+#endif
+
// is_function
namespace __libcpp_is_function_imp
@@ -468,13 +811,18 @@ template <class _Tp> struct __libcpp_is_function<_Tp, true> : public false_type
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_function
: public __libcpp_is_function<_Tp> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_function_v
+ = is_function<_Tp>::value;
+#endif
+
// is_member_function_pointer
// template <class _Tp> struct __libcpp_is_member_function_pointer : public false_type {};
// template <class _Tp, class _Up> struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {};
//
-template <class _MP, bool _IsMemberFuctionPtr, bool _IsMemberObjectPtr>
+template <class _MP, bool _IsMemberFunctionPtr, bool _IsMemberObjectPtr>
struct __member_pointer_traits_imp
{ // forward declaration; specializations later
};
@@ -490,6 +838,11 @@ struct __libcpp_is_member_function_pointer<_Ret _Class::*>
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_function_pointer
: public __libcpp_is_member_function_pointer<typename remove_cv<_Tp>::type>::type {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_member_function_pointer_v
+ = is_member_function_pointer<_Tp>::value;
+#endif
+
// is_member_pointer
template <class _Tp> struct __libcpp_is_member_pointer : public false_type {};
@@ -498,12 +851,22 @@ template <class _Tp, class _Up> struct __libcpp_is_member_pointer<_Tp _Up::*> :
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_pointer
: public __libcpp_is_member_pointer<typename remove_cv<_Tp>::type> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_member_pointer_v
+ = is_member_pointer<_Tp>::value;
+#endif
+
// is_member_object_pointer
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_object_pointer
: public integral_constant<bool, is_member_pointer<_Tp>::value &&
!is_member_function_pointer<_Tp>::value> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_member_object_pointer_v
+ = is_member_object_pointer<_Tp>::value;
+#endif
+
// is_enum
#if __has_feature(is_enum) || (_GNUC_VER >= 403)
@@ -527,12 +890,22 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_enum
#endif
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_enum_v
+ = is_enum<_Tp>::value;
+#endif
+
// is_arithmetic
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_arithmetic
: public integral_constant<bool, is_integral<_Tp>::value ||
is_floating_point<_Tp>::value> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_arithmetic_v
+ = is_arithmetic<_Tp>::value;
+#endif
+
// is_fundamental
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_fundamental
@@ -540,6 +913,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_fundamental
__is_nullptr_t<_Tp>::value ||
is_arithmetic<_Tp>::value> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_fundamental_v
+ = is_fundamental<_Tp>::value;
+#endif
+
// is_scalar
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_scalar
@@ -551,6 +929,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_scalar
template <> struct _LIBCPP_TYPE_VIS_ONLY is_scalar<nullptr_t> : public true_type {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_scalar_v
+ = is_scalar<_Tp>::value;
+#endif
+
// is_object
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_object
@@ -559,11 +942,21 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_object
is_union<_Tp>::value ||
is_class<_Tp>::value > {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_object_v
+ = is_object<_Tp>::value;
+#endif
+
// is_compound
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_compound
: public integral_constant<bool, !is_fundamental<_Tp>::value> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_compound_v
+ = is_compound<_Tp>::value;
+#endif
+
// add_const
template <class _Tp, bool = is_reference<_Tp>::value ||
@@ -701,6 +1094,11 @@ template <class _Tp> struct __libcpp_is_signed<_Tp, false> : public false_type {
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_signed : public __libcpp_is_signed<_Tp> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_signed_v
+ = is_signed<_Tp>::value;
+#endif
+
// is_unsigned
template <class _Tp, bool = is_integral<_Tp>::value>
@@ -716,6 +1114,11 @@ template <class _Tp> struct __libcpp_is_unsigned<_Tp, false> : public false_type
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_unsigned : public __libcpp_is_unsigned<_Tp> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_unsigned_v
+ = is_unsigned<_Tp>::value;
+#endif
+
// rank
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY rank
@@ -725,6 +1128,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY rank<_Tp[]>
template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY rank<_Tp[_Np]>
: public integral_constant<size_t, rank<_Tp>::value + 1> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR size_t rank_v
+ = rank<_Tp>::value;
+#endif
+
// extent
template <class _Tp, unsigned _Ip = 0> struct _LIBCPP_TYPE_VIS_ONLY extent
@@ -738,6 +1146,11 @@ template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY extent<_Tp[_Np], 0
template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_TYPE_VIS_ONLY extent<_Tp[_Np], _Ip>
: public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp, unsigned _Ip = 0> _LIBCPP_CONSTEXPR size_t extent_v
+ = extent<_Tp, _Ip>::value;
+#endif
+
// remove_extent
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_extent
@@ -804,6 +1217,11 @@ template <class _Tp> struct __libcpp_abstract<_Tp, false> : public false_type {}
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_abstract : public __libcpp_abstract<_Tp> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_abstract_v
+ = is_abstract<_Tp>::value;
+#endif
+
// is_final
#if defined(_LIBCPP_HAS_IS_FINAL)
@@ -819,6 +1237,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY
is_final : public integral_constant<bool, __is_final(_Tp)> {};
#endif
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_final_v
+ = is_final<_Tp>::value;
+#endif
+
// is_base_of
#ifdef _LIBCPP_HAS_IS_BASE_OF
@@ -854,6 +1277,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_base_of
#endif // _LIBCPP_HAS_IS_BASE_OF
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Bp, class _Dp> _LIBCPP_CONSTEXPR bool is_base_of_v
+ = is_base_of<_Bp, _Dp>::value;
+#endif
+
// is_convertible
#if __has_feature(is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
@@ -981,6 +1409,11 @@ template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS_ONLY is_convertible
#endif // __has_feature(is_convertible_to)
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _From, class _To> _LIBCPP_CONSTEXPR bool is_convertible_v
+ = is_convertible<_From, _To>::value;
+#endif
+
// is_empty
#if __has_feature(is_empty) || (_GNUC_VER >= 407)
@@ -1012,6 +1445,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_empty : public __libcpp_emp
#endif // __has_feature(is_empty)
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_empty_v
+ = is_empty<_Tp>::value;
+#endif
+
// is_polymorphic
#if __has_feature(is_polymorphic) || defined(_LIBCPP_MSVC)
@@ -1032,6 +1470,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_polymorphic
#endif // __has_feature(is_polymorphic)
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_polymorphic_v
+ = is_polymorphic<_Tp>::value;
+#endif
+
// has_virtual_destructor
#if __has_feature(has_virtual_destructor) || (_GNUC_VER >= 403)
@@ -1046,11 +1489,21 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
#endif
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool has_virtual_destructor_v
+ = has_virtual_destructor<_Tp>::value;
+#endif
+
// alignment_of
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY alignment_of
: public integral_constant<size_t, __alignof__(_Tp)> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR size_t alignment_of_v
+ = alignment_of<_Tp>::value;
+#endif
+
// aligned_storage
template <class _Hp, class _Tp>
@@ -1143,7 +1596,7 @@ struct _LIBCPP_TYPE_VIS_ONLY aligned_storage
union type
{
_Aligner __align;
- unsigned char __data[_Len];
+ unsigned char __data[(_Len + _Align - 1)/_Align * _Align];
};
};
@@ -1158,7 +1611,7 @@ struct _LIBCPP_TYPE_VIS_ONLY aligned_storage<_Len, n>\
{\
struct _ALIGNAS(n) type\
{\
- unsigned char __lx[_Len];\
+ unsigned char __lx[(_Len + n - 1)/n * n];\
};\
}
@@ -1290,18 +1743,6 @@ public:
template <class _A1, class _A2 = void, class _A3 = void>
class __promote : public __promote_imp<_A1, _A2, _A3> {};
-#ifdef _LIBCPP_STORE_AS_OPTIMIZATION
-
-// __transform
-
-template <class _Tp, size_t = sizeof(_Tp), bool = is_scalar<_Tp>::value> struct __transform {typedef _Tp type;};
-template <class _Tp> struct __transform<_Tp, 1, true> {typedef unsigned char type;};
-template <class _Tp> struct __transform<_Tp, 2, true> {typedef unsigned short type;};
-template <class _Tp> struct __transform<_Tp, 4, true> {typedef unsigned int type;};
-template <class _Tp> struct __transform<_Tp, 8, true> {typedef unsigned long long type;};
-
-#endif // _LIBCPP_STORE_AS_OPTIMIZATION
-
// make_signed / make_unsigned
typedef
@@ -1482,21 +1923,19 @@ public:
template <class _Tp, class _Up>
struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up, void>
{
-private:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- static _Tp&& __t();
- static _Up&& __u();
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- static _Tp __t();
- static _Up __u();
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-public:
- typedef typename remove_reference<decltype(true ? __t() : __u())>::type type;
+ typedef typename decay<decltype(
+ true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>()
+ )>::type type;
};
#else // _LIBCPP_HAS_NO_VARIADICS
-template <class ..._Tp> struct common_type;
+// bullet 1 - sizeof...(Tp) == 0
+
+template <class ..._Tp>
+struct _LIBCPP_TYPE_VIS_ONLY common_type {};
+
+// bullet 2 - sizeof...(Tp) == 1
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp>
@@ -1504,23 +1943,46 @@ struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp>
typedef typename decay<_Tp>::type type;
};
+// bullet 3 - sizeof...(Tp) == 2
+
+template <class _Tp, class _Up, class = void>
+struct __common_type2 {};
+
template <class _Tp, class _Up>
-struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up>
+struct __common_type2<_Tp, _Up,
+ typename __void_t<decltype(
+ true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>()
+ )>::type>
{
-private:
- static _Tp&& __t();
- static _Up&& __u();
- static bool __f();
-public:
- typedef typename decay<decltype(__f() ? __t() : __u())>::type type;
+ typedef typename decay<decltype(
+ true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>()
+ )>::type type;
};
+template <class _Tp, class _Up>
+struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up>
+ : __common_type2<_Tp, _Up> {};
+
+// bullet 4 - sizeof...(Tp) > 2
+
+template <class ...Tp> struct __common_types;
+
+template <class, class = void>
+struct __common_type_impl {};
+
template <class _Tp, class _Up, class ..._Vp>
-struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up, _Vp...>
+struct __common_type_impl<__common_types<_Tp, _Up, _Vp...>,
+ typename __void_t<typename common_type<_Tp, _Up>::type>::type>
{
- typedef typename common_type<typename common_type<_Tp, _Up>::type, _Vp...>::type type;
+ typedef typename common_type<
+ typename common_type<_Tp, _Up>::type, _Vp...
+ >::type type;
};
+template <class _Tp, class _Up, class ..._Vp>
+struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up, _Vp...>
+ : __common_type_impl<__common_types<_Tp, _Up, _Vp...> > {};
+
#if _LIBCPP_STD_VER > 11
template <class ..._Tp> using common_type_t = typename common_type<_Tp...>::type;
#endif
@@ -1564,12 +2026,22 @@ template <class _Tp, class _Arg>
struct is_assignable
: public __is_assignable_imp<_Tp, _Arg> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp, class _Arg> _LIBCPP_CONSTEXPR bool is_assignable_v
+ = is_assignable<_Tp, _Arg>::value;
+#endif
+
// is_copy_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_copy_assignable
: public is_assignable<typename add_lvalue_reference<_Tp>::type,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_copy_assignable_v
+ = is_copy_assignable<_Tp>::value;
+#endif
+
// is_move_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_move_assignable
@@ -1580,6 +2052,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_move_assignable
: public is_copy_assignable<_Tp> {};
#endif
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_move_assignable_v
+ = is_move_assignable<_Tp>::value;
+#endif
+
// is_destructible
// if it's a reference, return true
@@ -1638,6 +2115,11 @@ template <>
struct is_destructible<void>
: public _VSTD::false_type {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_destructible_v
+ = is_destructible<_Tp>::value;
+#endif
+
// move
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -2672,6 +3154,11 @@ struct __is_constructible2_imp<false, _Ap[], _A0, _A1>
#endif // _LIBCPP_HAS_NO_VARIADICS
#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
+ = is_constructible<_Tp, _Args...>::value;
+#endif
+
// is_default_constructible
template <class _Tp>
@@ -2679,6 +3166,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_default_constructible
: public is_constructible<_Tp>
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_default_constructible_v
+ = is_default_constructible<_Tp>::value;
+#endif
+
// is_copy_constructible
template <class _Tp>
@@ -2686,6 +3178,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_copy_constructible
: public is_constructible<_Tp,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_copy_constructible_v
+ = is_copy_constructible<_Tp>::value;
+#endif
+
// is_move_constructible
template <class _Tp>
@@ -2697,6 +3194,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_move_constructible
#endif
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_move_constructible_v
+ = is_move_constructible<_Tp>::value;
+#endif
+
// is_trivially_constructible
#ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -2824,18 +3326,33 @@ struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp&,
#endif // _LIBCPP_HAS_NO_VARIADICS
+#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_trivially_constructible_v
+ = is_trivially_constructible<_Tp, _Args...>::value;
+#endif
+
// is_trivially_default_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_default_constructible
: public is_trivially_constructible<_Tp>
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_default_constructible_v
+ = is_trivially_default_constructible<_Tp>::value;
+#endif
+
// is_trivially_copy_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copy_constructible
: public is_trivially_constructible<_Tp, typename add_lvalue_reference<const _Tp>::type>
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copy_constructible_v
+ = is_trivially_copy_constructible<_Tp>::value;
+#endif
+
// is_trivially_move_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_constructible
@@ -2846,6 +3363,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_constructibl
#endif
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_move_constructible_v
+ = is_trivially_move_constructible<_Tp>::value;
+#endif
+
// is_trivially_assignable
#if __has_feature(is_trivially_assignable) || _GNUC_VER >= 501
@@ -2884,12 +3406,22 @@ struct is_trivially_assignable<_Tp&, _Tp&&>
#endif // !__has_feature(is_trivially_assignable)
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp, class _Arg> _LIBCPP_CONSTEXPR bool is_trivially_assignable_v
+ = is_trivially_assignable<_Tp, _Arg>::value;
+#endif
+
// is_trivially_copy_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copy_assignable
: public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copy_assignable_v
+ = is_trivially_copy_assignable<_Tp>::value;
+#endif
+
// is_trivially_move_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_assignable
@@ -2901,6 +3433,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_assignable
#endif
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_move_assignable_v
+ = is_trivially_move_assignable<_Tp>::value;
+#endif
+
// is_trivially_destructible
#if __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403)
@@ -2917,6 +3454,14 @@ template <class _Tp> struct __libcpp_trivial_destructor
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible
: public __libcpp_trivial_destructor<typename remove_all_extents<_Tp>::type> {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible<_Tp[]>
+ : public false_type {};
+
+#endif
+
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_destructible_v
+ = is_trivially_destructible<_Tp>::value;
#endif
// is_nothrow_constructible
@@ -3079,18 +3624,33 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&,
#endif // _LIBCPP_HAS_NO_VARIADICS
#endif // __has_feature(is_nothrow_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_nothrow_constructible_v
+ = is_nothrow_constructible<_Tp, _Args...>::value;
+#endif
+
// is_nothrow_default_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_default_constructible
: public is_nothrow_constructible<_Tp>
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_default_constructible_v
+ = is_nothrow_default_constructible<_Tp>::value;
+#endif
+
// is_nothrow_copy_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_constructible
: public is_nothrow_constructible<_Tp,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_copy_constructible_v
+ = is_nothrow_copy_constructible<_Tp>::value;
+#endif
+
// is_nothrow_move_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_constructible
@@ -3101,6 +3661,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_constructible
#endif
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_move_constructible_v
+ = is_nothrow_move_constructible<_Tp>::value;
+#endif
+
// is_nothrow_assignable
#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
@@ -3169,12 +3734,22 @@ struct is_nothrow_assignable<_Tp&, _Tp&&>
#endif // __has_feature(cxx_noexcept)
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp, class _Arg> _LIBCPP_CONSTEXPR bool is_nothrow_assignable_v
+ = is_nothrow_assignable<_Tp, _Arg>::value;
+#endif
+
// is_nothrow_copy_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_assignable
: public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_copy_assignable_v
+ = is_nothrow_copy_assignable<_Tp>::value;
+#endif
+
// is_nothrow_move_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_assignable
@@ -3186,6 +3761,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_assignable
#endif
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_move_assignable_v
+ = is_nothrow_move_assignable<_Tp>::value;
+#endif
+
// is_nothrow_destructible
#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
@@ -3241,6 +3821,15 @@ template <class _Tp> struct __libcpp_nothrow_destructor
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible
: public __libcpp_nothrow_destructor<typename remove_all_extents<_Tp>::type> {};
+template <class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible<_Tp[]>
+ : public false_type {};
+
+#endif
+
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_destructible_v
+ = is_nothrow_destructible<_Tp>::value;
#endif
// is_pod
@@ -3260,6 +3849,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pod
#endif
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_pod_v
+ = is_pod<_Tp>::value;
+#endif
+
// is_literal_type;
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_literal_type
@@ -3271,6 +3865,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_literal_type
#endif
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_literal_type_v
+ = is_literal_type<_Tp>::value;
+#endif
+
// is_standard_layout;
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_standard_layout
@@ -3281,6 +3880,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_standard_layout
#endif
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_standard_layout_v
+ = is_standard_layout<_Tp>::value;
+#endif
+
// is_trivially_copyable;
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copyable
@@ -3293,6 +3897,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copyable
#endif
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copyable_v
+ = is_trivially_copyable<_Tp>::value;
+#endif
+
// is_trivial;
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivial
@@ -3304,6 +3913,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivial
#endif
{};
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivial_v
+ = is_trivial<_Tp>::value;
+#endif
+
#ifndef _LIBCPP_HAS_NO_VARIADICS
// Check for complete types
@@ -3692,34 +4306,34 @@ struct __sfinae_underlying_type
template <class _Tp>
struct __sfinae_underlying_type<_Tp, false> {};
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
int __convert_to_integral(int __val) { return __val; }
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
unsigned __convert_to_integral(unsigned __val) { return __val; }
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
long __convert_to_integral(long __val) { return __val; }
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
unsigned long __convert_to_integral(unsigned long __val) { return __val; }
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
long long __convert_to_integral(long long __val) { return __val; }
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
unsigned long long __convert_to_integral(unsigned long long __val) {return __val; }
#ifndef _LIBCPP_HAS_NO_INT128
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
__int128_t __convert_to_integral(__int128_t __val) { return __val; }
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
__uint128_t __convert_to_integral(__uint128_t __val) { return __val; }
#endif
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
typename __sfinae_underlying_type<_Tp>::__promoted_type
__convert_to_integral(_Tp __val) { return __val; }
@@ -3759,7 +4373,21 @@ struct __has_operator_addressof
#if _LIBCPP_STD_VER > 14
template <class...> using void_t = void;
-#endif
+
+# ifndef _LIBCPP_HAS_NO_VARIADICS
+template <class... _Args>
+struct conjunction : __and_<_Args...> {};
+template<class... _Args> constexpr bool conjunction_v = conjunction<_Args...>::value;
+
+template <class... _Args>
+struct disjunction : __or_<_Args...> {};
+template<class... _Args> constexpr bool disjunction_v = disjunction<_Args...>::value;
+
+template <class _Tp>
+struct negation : __not_<_Tp> {};
+template<class _Tp> constexpr bool negation_v = negation<_Tp>::value;
+# endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // _LIBCPP_STD_VER > 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/unordered_map b/include/unordered_map
index cf70ab62f69e..3c774d4094e0 100644
--- a/include/unordered_map
+++ b/include/unordered_map
@@ -1511,7 +1511,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const
__h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
__h.get_deleter().__second_constructed = true;
- return _VSTD::move(__h); // explicitly moved for C++03
+ return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
diff --git a/include/utility b/include/utility
index 54cfc8bc1592..c9f5785b3d4e 100644
--- a/include/utility
+++ b/include/utility
@@ -52,6 +52,9 @@ template <class T>
>::type
move_if_noexcept(T& x) noexcept; // constexpr in C++14
+template <class T> constexpr add_const<T>_t& as_const(T& t) noexcept; // C++17
+template <class T> void as_const(const T&&) = delete; // C++17
+
template <class T> typename add_rvalue_reference<T>::type declval() noexcept;
template <class T1, class T2>
@@ -110,22 +113,41 @@ template<size_t I, class T1, class T2>
get(pair<T1, T2>&) noexcept; // constexpr in C++14
template<size_t I, class T1, class T2>
- const typename const tuple_element<I, pair<T1, T2> >::type&
+ const typename tuple_element<I, pair<T1, T2> >::type&
get(const pair<T1, T2>&) noexcept; // constexpr in C++14
template<size_t I, class T1, class T2>
typename tuple_element<I, pair<T1, T2> >::type&&
get(pair<T1, T2>&&) noexcept; // constexpr in C++14
+template<size_t I, class T1, class T2>
+ const typename tuple_element<I, pair<T1, T2> >::type&&
+ get(const pair<T1, T2>&&) noexcept; // constexpr in C++14
+
template<class T1, class T2>
constexpr T1& get(pair<T1, T2>&) noexcept; // C++14
-template<size_t I, class T1, class T2>
- constexpr T1 const& get(pair<T1, T2> const &) noexcept; // C++14
+template<class T1, class T2>
+ constexpr const T1& get(const pair<T1, T2>&) noexcept; // C++14
-template<size_t I, class T1, class T2>
+template<class T1, class T2>
constexpr T1&& get(pair<T1, T2>&&) noexcept; // C++14
+template<class T1, class T2>
+ constexpr const T1&& get(const pair<T1, T2>&&) noexcept; // C++14
+
+template<class T1, class T2>
+ constexpr T1& get(pair<T2, T1>&) noexcept; // C++14
+
+template<class T1, class T2>
+ constexpr const T1& get(const pair<T2, T1>&) noexcept; // C++14
+
+template<class T1, class T2>
+ constexpr T1&& get(pair<T2, T1>&&) noexcept; // C++14
+
+template<class T1, class T2>
+ constexpr const T1&& get(const pair<T2, T1>&&) noexcept; // C++14
+
// C++14
template<class T, T... I>
@@ -242,6 +264,11 @@ move_if_noexcept(_Tp& __x) _NOEXCEPT
return _VSTD::move(__x);
}
+#if _LIBCPP_STD_VER > 14
+template <class _Tp> constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; }
+template <class _Tp> void as_const(const _Tp&&) = delete;
+#endif
+
struct _LIBCPP_TYPE_VIS_ONLY piecewise_construct_t { };
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_UTILITY)
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
@@ -261,6 +288,12 @@ struct _LIBCPP_TYPE_VIS_ONLY pair
// pair(const pair&) = default;
// pair(pair&&) = default;
+#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>
+#endif
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR pair() : first(), second() {}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -388,8 +421,9 @@ struct _LIBCPP_TYPE_VIS_ONLY pair
swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
__is_nothrow_swappable<second_type>::value)
{
- _VSTD::iter_swap(&first, &__p.first);
- _VSTD::iter_swap(&second, &__p.second);
+ using _VSTD::swap;
+ swap(first, __p.first);
+ swap(second, __p.second);
}
private:
@@ -551,6 +585,12 @@ struct __get_pair<0>
_T1&&
get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T1>(__p.first);}
+ template <class _T1, class _T2>
+ static
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ const _T1&&
+ get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);}
+
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
};
@@ -577,6 +617,12 @@ struct __get_pair<1>
_T2&&
get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T2>(__p.second);}
+ template <class _T1, class _T2>
+ static
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ const _T2&&
+ get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);}
+
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
};
@@ -606,6 +652,14 @@ get(pair<_T1, _T2>&& __p) _NOEXCEPT
return __get_pair<_Ip>::get(_VSTD::move(__p));
}
+template <size_t _Ip, class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
+get(const pair<_T1, _T2>&& __p) _NOEXCEPT
+{
+ return __get_pair<_Ip>::get(_VSTD::move(__p));
+}
+
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#if _LIBCPP_STD_VER > 11
@@ -632,6 +686,13 @@ constexpr _T1 && get(pair<_T1, _T2>&& __p) _NOEXCEPT
template <class _T1, class _T2>
inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1 const && get(pair<_T1, _T2> const&& __p) _NOEXCEPT
+{
+ return __get_pair<0>::get(_VSTD::move(__p));
+}
+
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY
constexpr _T1 & get(pair<_T2, _T1>& __p) _NOEXCEPT
{
return __get_pair<1>::get(__p);
@@ -651,6 +712,13 @@ constexpr _T1 && get(pair<_T2, _T1>&& __p) _NOEXCEPT
return __get_pair<1>::get(_VSTD::move(__p));
}
+template <class _T1, class _T2>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1 const && get(pair<_T2, _T1> const&& __p) _NOEXCEPT
+{
+ return __get_pair<1>::get(_VSTD::move(__p));
+}
+
#endif
#if _LIBCPP_STD_VER > 11
@@ -671,6 +739,16 @@ struct _LIBCPP_TYPE_VIS_ONLY integer_sequence
template<size_t... _Ip>
using index_sequence = integer_sequence<size_t, _Ip...>;
+#if __has_builtin(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
+
+template <class _Tp, _Tp _Ep>
+struct __make_integer_sequence
+{
+ typedef __make_integer_seq<integer_sequence, _Tp, _Ep> type;
+};
+
+#else
+
namespace __detail {
template<typename _Tp, size_t ..._Extra> struct __repeat;
@@ -724,10 +802,14 @@ struct __make_integer_sequence
{
static_assert(is_integral<_Tp>::value,
"std::make_integer_sequence can only be instantiated with an integral type" );
- static_assert(0 <= _Ep, "std::make_integer_sequence input shall not be negative");
- typedef __make_integer_sequence_unchecked<_Tp, _Ep> type;
+ static_assert(0 <= _Ep, "std::make_integer_sequence must have a non-negative sequence length");
+ // Workaround GCC bug by preventing bad installations when 0 <= _Ep
+ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68929
+ typedef __make_integer_sequence_unchecked<_Tp, 0 <= _Ep ? _Ep : 0> type;
};
+#endif
+
template<class _Tp, _Tp _Np>
using make_integer_sequence = typename __make_integer_sequence<_Tp, _Np>::type;
diff --git a/include/valarray b/include/valarray
index bdaa58836f39..bde644e8719b 100644
--- a/include/valarray
+++ b/include/valarray
@@ -802,11 +802,14 @@ public:
// construct/destroy:
_LIBCPP_INLINE_VISIBILITY
valarray() : __begin_(0), __end_(0) {}
- explicit valarray(size_t __n);
+ _LIBCPP_INLINE_VISIBILITY
+ inline explicit valarray(size_t __n);
+ _LIBCPP_INLINE_VISIBILITY
valarray(const value_type& __x, size_t __n);
valarray(const value_type* __p, size_t __n);
valarray(const valarray& __v);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
valarray(valarray&& __v) _NOEXCEPT;
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
@@ -816,22 +819,31 @@ 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
~valarray();
// assignment:
valarray& operator=(const valarray& __v);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator=(valarray&& __v) _NOEXCEPT;
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator=(initializer_list<value_type>);
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator=(const value_type& __x);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator=(const slice_array<value_type>& __sa);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator=(const gslice_array<value_type>& __ga);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator=(const mask_array<value_type>& __ma);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator=(const indirect_array<value_type>& __ia);
template <class _ValExpr>
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator=(const __val_expr<_ValExpr>& __v);
// element access:
@@ -842,24 +854,38 @@ public:
value_type& operator[](size_t __i) {return __begin_[__i];}
// subset operations:
+ _LIBCPP_INLINE_VISIBILITY
__val_expr<__slice_expr<const valarray&> > operator[](slice __s) const;
+ _LIBCPP_INLINE_VISIBILITY
slice_array<value_type> operator[](slice __s);
+ _LIBCPP_INLINE_VISIBILITY
__val_expr<__indirect_expr<const valarray&> > operator[](const gslice& __gs) const;
+ _LIBCPP_INLINE_VISIBILITY
gslice_array<value_type> operator[](const gslice& __gs);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
__val_expr<__indirect_expr<const valarray&> > operator[](gslice&& __gs) const;
+ _LIBCPP_INLINE_VISIBILITY
gslice_array<value_type> operator[](gslice&& __gs);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
__val_expr<__mask_expr<const valarray&> > operator[](const valarray<bool>& __vb) const;
+ _LIBCPP_INLINE_VISIBILITY
mask_array<value_type> operator[](const valarray<bool>& __vb);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
__val_expr<__mask_expr<const valarray&> > operator[](valarray<bool>&& __vb) const;
+ _LIBCPP_INLINE_VISIBILITY
mask_array<value_type> operator[](valarray<bool>&& __vb);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
__val_expr<__indirect_expr<const valarray&> > operator[](const valarray<size_t>& __vs) const;
+ _LIBCPP_INLINE_VISIBILITY
indirect_array<value_type> operator[](const valarray<size_t>& __vs);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
__val_expr<__indirect_expr<const valarray&> > operator[](valarray<size_t>&& __vs) const;
+ _LIBCPP_INLINE_VISIBILITY
indirect_array<value_type> operator[](valarray<size_t>&& __vs);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -870,15 +896,25 @@ public:
valarray<bool> operator!() const;
// computed assignment:
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator*= (const value_type& __x);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator/= (const value_type& __x);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator%= (const value_type& __x);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator+= (const value_type& __x);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator-= (const value_type& __x);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator^= (const value_type& __x);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator&= (const value_type& __x);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator|= (const value_type& __x);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator<<=(const value_type& __x);
+ _LIBCPP_INLINE_VISIBILITY
valarray& operator>>=(const value_type& __x);
template <class _Expr>
@@ -887,6 +923,7 @@ public:
__is_val_expr<_Expr>::value,
valarray&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator*= (const _Expr& __v);
template <class _Expr>
@@ -895,6 +932,7 @@ public:
__is_val_expr<_Expr>::value,
valarray&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator/= (const _Expr& __v);
template <class _Expr>
@@ -903,6 +941,7 @@ public:
__is_val_expr<_Expr>::value,
valarray&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator%= (const _Expr& __v);
template <class _Expr>
@@ -911,6 +950,7 @@ public:
__is_val_expr<_Expr>::value,
valarray&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator+= (const _Expr& __v);
template <class _Expr>
@@ -919,6 +959,7 @@ public:
__is_val_expr<_Expr>::value,
valarray&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator-= (const _Expr& __v);
template <class _Expr>
@@ -927,6 +968,7 @@ public:
__is_val_expr<_Expr>::value,
valarray&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator^= (const _Expr& __v);
template <class _Expr>
@@ -935,6 +977,7 @@ public:
__is_val_expr<_Expr>::value,
valarray&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator|= (const _Expr& __v);
template <class _Expr>
@@ -943,6 +986,7 @@ public:
__is_val_expr<_Expr>::value,
valarray&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator&= (const _Expr& __v);
template <class _Expr>
@@ -951,6 +995,7 @@ public:
__is_val_expr<_Expr>::value,
valarray&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator<<= (const _Expr& __v);
template <class _Expr>
@@ -959,16 +1004,21 @@ public:
__is_val_expr<_Expr>::value,
valarray&
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator>>= (const _Expr& __v);
// member functions:
+ _LIBCPP_INLINE_VISIBILITY
void swap(valarray& __v) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return static_cast<size_t>(__end_ - __begin_);}
+ _LIBCPP_INLINE_VISIBILITY
value_type sum() const;
+ _LIBCPP_INLINE_VISIBILITY
value_type min() const;
+ _LIBCPP_INLINE_VISIBILITY
value_type max() const;
valarray shift (int __i) const;
@@ -1114,6 +1164,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator=(const _Expr& __v) const;
template <class _Expr>
@@ -1122,6 +1173,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator*=(const _Expr& __v) const;
template <class _Expr>
@@ -1130,6 +1182,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator/=(const _Expr& __v) const;
template <class _Expr>
@@ -1138,6 +1191,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator%=(const _Expr& __v) const;
template <class _Expr>
@@ -1146,6 +1200,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator+=(const _Expr& __v) const;
template <class _Expr>
@@ -1154,6 +1209,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator-=(const _Expr& __v) const;
template <class _Expr>
@@ -1162,6 +1218,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator^=(const _Expr& __v) const;
template <class _Expr>
@@ -1170,6 +1227,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator&=(const _Expr& __v) const;
template <class _Expr>
@@ -1178,6 +1236,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator|=(const _Expr& __v) const;
template <class _Expr>
@@ -1186,6 +1245,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator<<=(const _Expr& __v) const;
template <class _Expr>
@@ -1194,10 +1254,13 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator>>=(const _Expr& __v) const;
+ _LIBCPP_INLINE_VISIBILITY
const slice_array& operator=(const slice_array& __sa) const;
+ _LIBCPP_INLINE_VISIBILITY
void operator=(const value_type& __x) const;
private:
@@ -1213,7 +1276,7 @@ private:
};
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
const slice_array<_Tp>&
slice_array<_Tp>::operator=(const slice_array& __sa) const
{
@@ -1226,7 +1289,7 @@ slice_array<_Tp>::operator=(const slice_array& __sa) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1241,7 +1304,7 @@ slice_array<_Tp>::operator=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1256,7 +1319,7 @@ slice_array<_Tp>::operator*=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1271,7 +1334,7 @@ slice_array<_Tp>::operator/=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1286,7 +1349,7 @@ slice_array<_Tp>::operator%=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1301,7 +1364,7 @@ slice_array<_Tp>::operator+=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1316,7 +1379,7 @@ slice_array<_Tp>::operator-=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1331,7 +1394,7 @@ slice_array<_Tp>::operator^=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1346,7 +1409,7 @@ slice_array<_Tp>::operator&=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1361,7 +1424,7 @@ slice_array<_Tp>::operator|=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1376,7 +1439,7 @@ slice_array<_Tp>::operator<<=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1390,7 +1453,7 @@ slice_array<_Tp>::operator>>=(const _Expr& __v) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
slice_array<_Tp>::operator=(const value_type& __x) const
{
@@ -1484,6 +1547,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator=(const _Expr& __v) const;
template <class _Expr>
@@ -1492,6 +1556,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator*=(const _Expr& __v) const;
template <class _Expr>
@@ -1500,6 +1565,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator/=(const _Expr& __v) const;
template <class _Expr>
@@ -1508,6 +1574,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator%=(const _Expr& __v) const;
template <class _Expr>
@@ -1516,6 +1583,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator+=(const _Expr& __v) const;
template <class _Expr>
@@ -1524,6 +1592,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator-=(const _Expr& __v) const;
template <class _Expr>
@@ -1532,6 +1601,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator^=(const _Expr& __v) const;
template <class _Expr>
@@ -1540,6 +1610,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator&=(const _Expr& __v) const;
template <class _Expr>
@@ -1548,6 +1619,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator|=(const _Expr& __v) const;
template <class _Expr>
@@ -1556,6 +1628,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator<<=(const _Expr& __v) const;
template <class _Expr>
@@ -1564,10 +1637,13 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator>>=(const _Expr& __v) const;
+ _LIBCPP_INLINE_VISIBILITY
const gslice_array& operator=(const gslice_array& __ga) const;
+ _LIBCPP_INLINE_VISIBILITY
void operator=(const value_type& __x) const;
// gslice_array(const gslice_array&) = default;
@@ -1576,20 +1652,16 @@ public:
// gslice_array& operator=(gslice_array&&) = default;
private:
- _LIBCPP_INLINE_VISIBILITY
gslice_array(const gslice& __gs, const valarray<value_type>& __v)
: __vp_(const_cast<value_type*>(__v.__begin_)),
__1d_(__gs.__1d_)
{}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
- _LIBCPP_INLINE_VISIBILITY
gslice_array(gslice&& __gs, const valarray<value_type>& __v)
: __vp_(const_cast<value_type*>(__v.__begin_)),
__1d_(move(__gs.__1d_))
{}
-
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class> friend class valarray;
@@ -1597,7 +1669,7 @@ private:
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1613,7 +1685,7 @@ gslice_array<_Tp>::operator=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1629,7 +1701,7 @@ gslice_array<_Tp>::operator*=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1645,7 +1717,7 @@ gslice_array<_Tp>::operator/=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1661,7 +1733,7 @@ gslice_array<_Tp>::operator%=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1677,7 +1749,7 @@ gslice_array<_Tp>::operator+=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1693,7 +1765,7 @@ gslice_array<_Tp>::operator-=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1709,7 +1781,7 @@ gslice_array<_Tp>::operator^=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1725,7 +1797,7 @@ gslice_array<_Tp>::operator&=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1741,7 +1813,7 @@ gslice_array<_Tp>::operator|=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1757,7 +1829,7 @@ gslice_array<_Tp>::operator<<=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1772,7 +1844,7 @@ gslice_array<_Tp>::operator>>=(const _Expr& __v) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
const gslice_array<_Tp>&
gslice_array<_Tp>::operator=(const gslice_array& __ga) const
{
@@ -1785,7 +1857,7 @@ gslice_array<_Tp>::operator=(const gslice_array& __ga) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
gslice_array<_Tp>::operator=(const value_type& __x) const
{
@@ -1813,6 +1885,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator=(const _Expr& __v) const;
template <class _Expr>
@@ -1821,6 +1894,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator*=(const _Expr& __v) const;
template <class _Expr>
@@ -1829,6 +1903,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator/=(const _Expr& __v) const;
template <class _Expr>
@@ -1837,6 +1912,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator%=(const _Expr& __v) const;
template <class _Expr>
@@ -1845,6 +1921,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator+=(const _Expr& __v) const;
template <class _Expr>
@@ -1853,6 +1930,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator-=(const _Expr& __v) const;
template <class _Expr>
@@ -1861,6 +1939,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator^=(const _Expr& __v) const;
template <class _Expr>
@@ -1869,6 +1948,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator&=(const _Expr& __v) const;
template <class _Expr>
@@ -1877,6 +1957,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator|=(const _Expr& __v) const;
template <class _Expr>
@@ -1885,6 +1966,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator<<=(const _Expr& __v) const;
template <class _Expr>
@@ -1893,10 +1975,13 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator>>=(const _Expr& __v) const;
+ _LIBCPP_INLINE_VISIBILITY
const mask_array& operator=(const mask_array& __ma) const;
+ _LIBCPP_INLINE_VISIBILITY
void operator=(const value_type& __x) const;
// mask_array(const mask_array&) = default;
@@ -1921,7 +2006,7 @@ private:
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1936,7 +2021,7 @@ mask_array<_Tp>::operator=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1951,7 +2036,7 @@ mask_array<_Tp>::operator*=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1966,7 +2051,7 @@ mask_array<_Tp>::operator/=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1981,7 +2066,7 @@ mask_array<_Tp>::operator%=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -1996,7 +2081,7 @@ mask_array<_Tp>::operator+=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2011,7 +2096,7 @@ mask_array<_Tp>::operator-=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2026,7 +2111,7 @@ mask_array<_Tp>::operator^=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2041,7 +2126,7 @@ mask_array<_Tp>::operator&=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2056,7 +2141,7 @@ mask_array<_Tp>::operator|=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2071,7 +2156,7 @@ mask_array<_Tp>::operator<<=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2085,7 +2170,7 @@ mask_array<_Tp>::operator>>=(const _Expr& __v) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
const mask_array<_Tp>&
mask_array<_Tp>::operator=(const mask_array& __ma) const
{
@@ -2096,7 +2181,7 @@ mask_array<_Tp>::operator=(const mask_array& __ma) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
mask_array<_Tp>::operator=(const value_type& __x) const
{
@@ -2158,6 +2243,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator=(const _Expr& __v) const;
template <class _Expr>
@@ -2166,6 +2252,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator*=(const _Expr& __v) const;
template <class _Expr>
@@ -2174,6 +2261,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator/=(const _Expr& __v) const;
template <class _Expr>
@@ -2182,6 +2270,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator%=(const _Expr& __v) const;
template <class _Expr>
@@ -2190,6 +2279,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator+=(const _Expr& __v) const;
template <class _Expr>
@@ -2198,6 +2288,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator-=(const _Expr& __v) const;
template <class _Expr>
@@ -2206,6 +2297,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator^=(const _Expr& __v) const;
template <class _Expr>
@@ -2214,6 +2306,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator&=(const _Expr& __v) const;
template <class _Expr>
@@ -2222,6 +2315,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator|=(const _Expr& __v) const;
template <class _Expr>
@@ -2230,6 +2324,7 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator<<=(const _Expr& __v) const;
template <class _Expr>
@@ -2238,10 +2333,13 @@ public:
__is_val_expr<_Expr>::value,
void
>::type
+ _LIBCPP_INLINE_VISIBILITY
operator>>=(const _Expr& __v) const;
+ _LIBCPP_INLINE_VISIBILITY
const indirect_array& operator=(const indirect_array& __ia) const;
+ _LIBCPP_INLINE_VISIBILITY
void operator=(const value_type& __x) const;
// indirect_array(const indirect_array&) = default;
@@ -2271,7 +2369,7 @@ private:
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2286,7 +2384,7 @@ indirect_array<_Tp>::operator=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2301,7 +2399,7 @@ indirect_array<_Tp>::operator*=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2316,7 +2414,7 @@ indirect_array<_Tp>::operator/=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2331,7 +2429,7 @@ indirect_array<_Tp>::operator%=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2346,7 +2444,7 @@ indirect_array<_Tp>::operator+=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2361,7 +2459,7 @@ indirect_array<_Tp>::operator-=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2376,7 +2474,7 @@ indirect_array<_Tp>::operator^=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2391,7 +2489,7 @@ indirect_array<_Tp>::operator&=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2406,7 +2504,7 @@ indirect_array<_Tp>::operator|=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2421,7 +2519,7 @@ indirect_array<_Tp>::operator<<=(const _Expr& __v) const
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -2435,7 +2533,7 @@ indirect_array<_Tp>::operator>>=(const _Expr& __v) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
const indirect_array<_Tp>&
indirect_array<_Tp>::operator=(const indirect_array& __ia) const
{
@@ -2448,7 +2546,7 @@ indirect_array<_Tp>::operator=(const indirect_array& __ia) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
indirect_array<_Tp>::operator=(const value_type& __x) const
{
@@ -2650,7 +2748,7 @@ __val_expr<_ValExpr>::operator valarray<__val_expr::result_type>() const
// valarray
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>::valarray(size_t __n)
: __begin_(0),
__end_(0)
@@ -2659,7 +2757,7 @@ valarray<_Tp>::valarray(size_t __n)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>::valarray(const value_type& __x, size_t __n)
: __begin_(0),
__end_(0)
@@ -2720,7 +2818,7 @@ valarray<_Tp>::valarray(const valarray& __v)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>::valarray(valarray&& __v) _NOEXCEPT
: __begin_(__v.__begin_),
__end_(__v.__end_)
@@ -2874,7 +2972,7 @@ valarray<_Tp>::valarray(const indirect_array<value_type>& __ia)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>::~valarray()
{
resize(0);
@@ -2896,7 +2994,7 @@ valarray<_Tp>::operator=(const valarray& __v)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator=(valarray&& __v) _NOEXCEPT
{
@@ -2913,7 +3011,7 @@ valarray<_Tp>::operator=(valarray&& __v) _NOEXCEPT
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator=(initializer_list<value_type> __il)
{
@@ -2926,7 +3024,7 @@ valarray<_Tp>::operator=(initializer_list<value_type> __il)
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator=(const value_type& __x)
{
@@ -2935,7 +3033,7 @@ valarray<_Tp>::operator=(const value_type& __x)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator=(const slice_array<value_type>& __sa)
{
@@ -2947,7 +3045,7 @@ valarray<_Tp>::operator=(const slice_array<value_type>& __sa)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator=(const gslice_array<value_type>& __ga)
{
@@ -2961,7 +3059,7 @@ valarray<_Tp>::operator=(const gslice_array<value_type>& __ga)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator=(const mask_array<value_type>& __ma)
{
@@ -2975,7 +3073,7 @@ valarray<_Tp>::operator=(const mask_array<value_type>& __ma)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator=(const indirect_array<value_type>& __ia)
{
@@ -2990,7 +3088,7 @@ valarray<_Tp>::operator=(const indirect_array<value_type>& __ia)
template <class _Tp>
template <class _ValExpr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator=(const __val_expr<_ValExpr>& __v)
{
@@ -3004,7 +3102,7 @@ valarray<_Tp>::operator=(const __val_expr<_ValExpr>& __v)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__val_expr<__slice_expr<const valarray<_Tp>&> >
valarray<_Tp>::operator[](slice __s) const
{
@@ -3012,7 +3110,7 @@ valarray<_Tp>::operator[](slice __s) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
slice_array<_Tp>
valarray<_Tp>::operator[](slice __s)
{
@@ -3020,7 +3118,7 @@ valarray<_Tp>::operator[](slice __s)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__val_expr<__indirect_expr<const valarray<_Tp>&> >
valarray<_Tp>::operator[](const gslice& __gs) const
{
@@ -3028,7 +3126,7 @@ valarray<_Tp>::operator[](const gslice& __gs) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
gslice_array<_Tp>
valarray<_Tp>::operator[](const gslice& __gs)
{
@@ -3038,7 +3136,7 @@ valarray<_Tp>::operator[](const gslice& __gs)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__val_expr<__indirect_expr<const valarray<_Tp>&> >
valarray<_Tp>::operator[](gslice&& __gs) const
{
@@ -3046,7 +3144,7 @@ valarray<_Tp>::operator[](gslice&& __gs) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
gslice_array<_Tp>
valarray<_Tp>::operator[](gslice&& __gs)
{
@@ -3056,7 +3154,7 @@ valarray<_Tp>::operator[](gslice&& __gs)
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__val_expr<__mask_expr<const valarray<_Tp>&> >
valarray<_Tp>::operator[](const valarray<bool>& __vb) const
{
@@ -3064,7 +3162,7 @@ valarray<_Tp>::operator[](const valarray<bool>& __vb) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
mask_array<_Tp>
valarray<_Tp>::operator[](const valarray<bool>& __vb)
{
@@ -3074,7 +3172,7 @@ valarray<_Tp>::operator[](const valarray<bool>& __vb)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__val_expr<__mask_expr<const valarray<_Tp>&> >
valarray<_Tp>::operator[](valarray<bool>&& __vb) const
{
@@ -3082,7 +3180,7 @@ valarray<_Tp>::operator[](valarray<bool>&& __vb) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
mask_array<_Tp>
valarray<_Tp>::operator[](valarray<bool>&& __vb)
{
@@ -3092,7 +3190,7 @@ valarray<_Tp>::operator[](valarray<bool>&& __vb)
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__val_expr<__indirect_expr<const valarray<_Tp>&> >
valarray<_Tp>::operator[](const valarray<size_t>& __vs) const
{
@@ -3100,7 +3198,7 @@ valarray<_Tp>::operator[](const valarray<size_t>& __vs) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
indirect_array<_Tp>
valarray<_Tp>::operator[](const valarray<size_t>& __vs)
{
@@ -3110,7 +3208,7 @@ valarray<_Tp>::operator[](const valarray<size_t>& __vs)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__val_expr<__indirect_expr<const valarray<_Tp>&> >
valarray<_Tp>::operator[](valarray<size_t>&& __vs) const
{
@@ -3118,7 +3216,7 @@ valarray<_Tp>::operator[](valarray<size_t>&& __vs) const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
indirect_array<_Tp>
valarray<_Tp>::operator[](valarray<size_t>&& __vs)
{
@@ -3196,7 +3294,7 @@ valarray<_Tp>::operator!() const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator*=(const value_type& __x)
{
@@ -3206,7 +3304,7 @@ valarray<_Tp>::operator*=(const value_type& __x)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator/=(const value_type& __x)
{
@@ -3216,7 +3314,7 @@ valarray<_Tp>::operator/=(const value_type& __x)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator%=(const value_type& __x)
{
@@ -3226,7 +3324,7 @@ valarray<_Tp>::operator%=(const value_type& __x)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator+=(const value_type& __x)
{
@@ -3236,7 +3334,7 @@ valarray<_Tp>::operator+=(const value_type& __x)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator-=(const value_type& __x)
{
@@ -3246,7 +3344,7 @@ valarray<_Tp>::operator-=(const value_type& __x)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator^=(const value_type& __x)
{
@@ -3256,7 +3354,7 @@ valarray<_Tp>::operator^=(const value_type& __x)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator&=(const value_type& __x)
{
@@ -3266,7 +3364,7 @@ valarray<_Tp>::operator&=(const value_type& __x)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator|=(const value_type& __x)
{
@@ -3276,7 +3374,7 @@ valarray<_Tp>::operator|=(const value_type& __x)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator<<=(const value_type& __x)
{
@@ -3286,7 +3384,7 @@ valarray<_Tp>::operator<<=(const value_type& __x)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
valarray<_Tp>&
valarray<_Tp>::operator>>=(const value_type& __x)
{
@@ -3297,7 +3395,7 @@ valarray<_Tp>::operator>>=(const value_type& __x)
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -3313,7 +3411,7 @@ valarray<_Tp>::operator*=(const _Expr& __v)
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -3329,7 +3427,7 @@ valarray<_Tp>::operator/=(const _Expr& __v)
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -3345,7 +3443,7 @@ valarray<_Tp>::operator%=(const _Expr& __v)
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -3361,7 +3459,7 @@ valarray<_Tp>::operator+=(const _Expr& __v)
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -3377,7 +3475,7 @@ valarray<_Tp>::operator-=(const _Expr& __v)
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -3393,7 +3491,7 @@ valarray<_Tp>::operator^=(const _Expr& __v)
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -3409,7 +3507,7 @@ valarray<_Tp>::operator|=(const _Expr& __v)
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -3425,7 +3523,7 @@ valarray<_Tp>::operator&=(const _Expr& __v)
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -3441,7 +3539,7 @@ valarray<_Tp>::operator<<=(const _Expr& __v)
template <class _Tp>
template <class _Expr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename enable_if
<
__is_val_expr<_Expr>::value,
@@ -3456,7 +3554,7 @@ valarray<_Tp>::operator>>=(const _Expr& __v)
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
valarray<_Tp>::swap(valarray& __v) _NOEXCEPT
{
@@ -3465,7 +3563,7 @@ valarray<_Tp>::swap(valarray& __v) _NOEXCEPT
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_Tp
valarray<_Tp>::sum() const
{
@@ -3479,7 +3577,7 @@ valarray<_Tp>::sum() const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_Tp
valarray<_Tp>::min() const
{
@@ -3489,7 +3587,7 @@ valarray<_Tp>::min() const
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_Tp
valarray<_Tp>::max() const
{
diff --git a/include/vector b/include/vector
index c168c8ea60ad..dbc0dd321824 100644
--- a/include/vector
+++ b/include/vector
@@ -51,8 +51,8 @@ public:
vector& operator=(const vector& x);
vector& operator=(vector&& x)
noexcept(
- allocator_type::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value);
+ allocator_type::propagate_on_container_move_assignment::value ||
+ allocator_type::is_always_equal::value); // C++17
vector& operator=(initializer_list<value_type> il);
template <class InputIterator>
void assign(InputIterator first, InputIterator last);
@@ -175,8 +175,8 @@ public:
vector& operator=(const vector& x);
vector& operator=(vector&& x)
noexcept(
- allocator_type::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value);
+ allocator_type::propagate_on_container_move_assignment::value ||
+ allocator_type::is_always_equal::value); // C++17
vector& operator=(initializer_list<value_type> il);
template <class InputIterator>
void assign(InputIterator first, InputIterator last);
@@ -562,9 +562,7 @@ public:
vector(vector&& __x, const allocator_type& __a);
_LIBCPP_INLINE_VISIBILITY
vector& operator=(vector&& __x)
- _NOEXCEPT_(
- __alloc_traits::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value);
+ _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
@@ -687,9 +685,11 @@ public:
_LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x);
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
void emplace_back(_Args&&... __args);
#endif // _LIBCPP_HAS_NO_VARIADICS
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
void pop_back();
iterator insert(const_iterator __position, const_reference __x);
@@ -768,6 +768,7 @@ private:
void deallocate() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;
void __construct_at_end(size_type __n);
+ _LIBCPP_INLINE_VISIBILITY
void __construct_at_end(size_type __n, const_reference __x);
template <class _ForwardIterator>
typename enable_if
@@ -787,7 +788,8 @@ private:
void __move_range(pointer __from_s, pointer __from_e, pointer __to);
void __move_assign(vector& __c, true_type)
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
- void __move_assign(vector& __c, false_type);
+ void __move_assign(vector& __c, false_type)
+ _NOEXCEPT_(__alloc_traits::is_always_equal::value);
_LIBCPP_INLINE_VISIBILITY
void __destruct_at_end(pointer __new_last) _NOEXCEPT
{
@@ -991,7 +993,7 @@ vector<_Tp, _Allocator>::__construct_at_end(size_type __n)
// Postcondition: size() == old size() + __n
// Postcondition: [i] == __x for all i in [size() - __n, __n)
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
vector<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x)
{
@@ -1303,9 +1305,7 @@ template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<_Tp, _Allocator>&
vector<_Tp, _Allocator>::operator=(vector&& __x)
- _NOEXCEPT_(
- __alloc_traits::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value)
+ _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))
{
__move_assign(__x, integral_constant<bool,
__alloc_traits::propagate_on_container_move_assignment::value>());
@@ -1315,6 +1315,7 @@ vector<_Tp, _Allocator>::operator=(vector&& __x)
template <class _Tp, class _Allocator>
void
vector<_Tp, _Allocator>::__move_assign(vector& __c, false_type)
+ _NOEXCEPT_(__alloc_traits::is_always_equal::value)
{
if (__base::__alloc() != __c.__alloc())
{
@@ -1629,7 +1630,7 @@ vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args)
template <class _Tp, class _Allocator>
template <class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
vector<_Tp, _Allocator>::emplace_back(_Args&&... __args)
{
@@ -1650,7 +1651,7 @@ vector<_Tp, _Allocator>::emplace_back(_Args&&... __args)
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
vector<_Tp, _Allocator>::pop_back()
{
@@ -1897,9 +1898,11 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __firs
pointer __old_last = this->__end_;
for (; this->__end_ != this->__end_cap() && __first != __last; ++__first)
{
+ __RAII_IncreaseAnnotator __annotator(*this);
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_),
*__first);
++this->__end_;
+ __annotator.__done();
}
__split_buffer<value_type, allocator_type&> __v(__a);
if (__first != __last)
@@ -2211,9 +2214,7 @@ public:
vector(vector&& __v, const allocator_type& __a);
_LIBCPP_INLINE_VISIBILITY
vector& operator=(vector&& __v)
- _NOEXCEPT_(
- __alloc_traits::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value);
+ _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
@@ -2836,9 +2837,7 @@ template <class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<bool, _Allocator>&
vector<bool, _Allocator>::operator=(vector&& __v)
- _NOEXCEPT_(
- __alloc_traits::propagate_on_container_move_assignment::value &&
- is_nothrow_move_assignable<allocator_type>::value)
+ _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))
{
__move_assign(__v, integral_constant<bool,
__storage_traits::propagate_on_container_move_assignment::value>());
diff --git a/include/wchar.h b/include/wchar.h
new file mode 100644
index 000000000000..da34f735edf3
--- /dev/null
+++ b/include/wchar.h
@@ -0,0 +1,136 @@
+// -*- C++ -*-
+//===--------------------------- wchar.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.
+//
+//===----------------------------------------------------------------------===//
+
+#if defined(__need_wint_t) || defined(__need_mbstate_t)
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <wchar.h>
+
+#elif !defined(_LIBCPP_WCHAR_H)
+#define _LIBCPP_WCHAR_H
+
+/*
+ wchar.h synopsis
+
+Macros:
+
+ NULL
+ WCHAR_MAX
+ WCHAR_MIN
+ WEOF
+
+Types:
+
+ mbstate_t
+ size_t
+ tm
+ wint_t
+
+int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...);
+int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...);
+int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...);
+int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...);
+int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg);
+int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); // C99
+int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg);
+int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); // C99
+int vwprintf(const wchar_t* restrict format, va_list arg);
+int vwscanf(const wchar_t* restrict format, va_list arg); // C99
+int wprintf(const wchar_t* restrict format, ...);
+int wscanf(const wchar_t* restrict format, ...);
+wint_t fgetwc(FILE* stream);
+wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream);
+wint_t fputwc(wchar_t c, FILE* stream);
+int fputws(const wchar_t* restrict s, FILE* restrict stream);
+int fwide(FILE* stream, int mode);
+wint_t getwc(FILE* stream);
+wint_t getwchar();
+wint_t putwc(wchar_t c, FILE* stream);
+wint_t putwchar(wchar_t c);
+wint_t ungetwc(wint_t c, FILE* stream);
+double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr);
+float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99
+long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99
+long wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
+long long wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99
+unsigned long wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
+unsigned long long wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99
+wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2);
+wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
+wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2);
+wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
+int wcscmp(const wchar_t* s1, const wchar_t* s2);
+int wcscoll(const wchar_t* s1, const wchar_t* s2);
+int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n);
+size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
+const wchar_t* wcschr(const wchar_t* s, wchar_t c);
+ wchar_t* wcschr( wchar_t* s, wchar_t c);
+size_t wcscspn(const wchar_t* s1, const wchar_t* s2);
+size_t wcslen(const wchar_t* s);
+const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2);
+ wchar_t* wcspbrk( wchar_t* s1, const wchar_t* s2);
+const wchar_t* wcsrchr(const wchar_t* s, wchar_t c);
+ wchar_t* wcsrchr( wchar_t* s, wchar_t c);
+size_t wcsspn(const wchar_t* s1, const wchar_t* s2);
+const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2);
+ wchar_t* wcsstr( wchar_t* s1, const wchar_t* s2);
+wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr);
+const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n);
+ wchar_t* wmemchr( wchar_t* s, wchar_t c, size_t n);
+int wmemcmp(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
+wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
+wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n);
+wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n);
+size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format,
+ const tm* restrict timeptr);
+wint_t btowc(int c);
+int wctob(wint_t c);
+int mbsinit(const mbstate_t* ps);
+size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps);
+size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps);
+size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps);
+size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len,
+ mbstate_t* restrict ps);
+size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
+ mbstate_t* restrict ps);
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#ifdef __cplusplus
+#define __CORRECT_ISO_CPP_WCHAR_H_PROTO
+#endif
+
+#include_next <wchar.h>
+
+// Let <cwchar> know if we have const-correct overloads for wcschr and friends.
+#if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_)
+# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
+#elif defined(__GLIBC_PREREQ)
+# if __GLIBC_PREREQ(2, 10)
+# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
+# endif
+#endif
+
+#if defined(__cplusplus) && (defined(_LIBCPP_MSVCRT) || defined(__MINGW32__))
+extern "C++" {
+#include <support/win32/support.h> // pull in *swprintf defines
+} // extern "C++"
+#endif // __cplusplus && _LIBCPP_MSVCRT
+
+#endif // _LIBCPP_WCHAR_H
diff --git a/include/wctype.h b/include/wctype.h
new file mode 100644
index 000000000000..f9c5a47754bb
--- /dev/null
+++ b/include/wctype.h
@@ -0,0 +1,79 @@
+// -*- C++ -*-
+//===--------------------------- wctype.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_WCTYPE_H
+#define _LIBCPP_WCTYPE_H
+
+/*
+ wctype.h synopsis
+
+Macros:
+
+ WEOF
+
+Types:
+
+ wint_t
+ wctrans_t
+ wctype_t
+
+int iswalnum(wint_t wc);
+int iswalpha(wint_t wc);
+int iswblank(wint_t wc); // C99
+int iswcntrl(wint_t wc);
+int iswdigit(wint_t wc);
+int iswgraph(wint_t wc);
+int iswlower(wint_t wc);
+int iswprint(wint_t wc);
+int iswpunct(wint_t wc);
+int iswspace(wint_t wc);
+int iswupper(wint_t wc);
+int iswxdigit(wint_t wc);
+int iswctype(wint_t wc, wctype_t desc);
+wctype_t wctype(const char* property);
+wint_t towlower(wint_t wc);
+wint_t towupper(wint_t wc);
+wint_t towctrans(wint_t wc, wctrans_t desc);
+wctrans_t wctrans(const char* property);
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <wctype.h>
+
+#ifdef __cplusplus
+
+#undef iswalnum
+#undef iswalpha
+#undef iswblank
+#undef iswcntrl
+#undef iswdigit
+#undef iswgraph
+#undef iswlower
+#undef iswprint
+#undef iswpunct
+#undef iswspace
+#undef iswupper
+#undef iswxdigit
+#undef iswctype
+#undef wctype
+#undef towlower
+#undef towupper
+#undef towctrans
+#undef wctrans
+
+#endif // __cplusplus
+
+#endif // _LIBCPP_WCTYPE_H
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index d3d5f381d815..d6a35f8eba2e 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -11,7 +11,7 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
endif()
# Add all the headers to the project for IDEs.
-if (MSVC_IDE OR XCODE)
+if (LIBCXX_CONFIGURE_IDE)
file(GLOB_RECURSE LIBCXX_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/*)
if(WIN32)
file( GLOB LIBCXX_WIN32_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/support/win32/*.h)
@@ -24,54 +24,65 @@ if (MSVC_IDE OR XCODE)
endif()
endif()
-if (LIBCXX_ENABLE_SHARED)
- add_library(cxx SHARED
- ${LIBCXX_SOURCES}
- ${LIBCXX_HEADERS}
- )
-else()
- add_library(cxx STATIC
- ${LIBCXX_SOURCES}
- ${LIBCXX_HEADERS}
- )
+if(NOT LIBCXX_INSTALL_LIBRARY)
+ set(exclude_from_all EXCLUDE_FROM_ALL)
endif()
-#if LIBCXX_CXX_ABI_LIBRARY_PATH is defined we want to add it to the search path.
-if (DEFINED LIBCXX_CXX_ABI_LIBRARY_PATH)
- target_link_libraries(cxx "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")
+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()
-set(libraries "")
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
- # TODO(ericwf): Remove these GNU specific linker flags and let CMake do the
- # configuration. This will be more portable.
- list(APPEND libraries "-Wl,--whole-archive" "-Wl,-Bstatic")
- list(APPEND libraries "${LIBCXX_CXX_ABI_LIBRARY}")
- list(APPEND libraries "-Wl,-Bdynamic" "-Wl,--no-whole-archive")
-else()
- list(APPEND libraries "${LIBCXX_CXX_ABI_LIBRARY}")
-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}")
-# Generate library list.
-append_if(libraries LIBCXX_HAS_PTHREAD_LIB pthread)
-append_if(libraries LIBCXX_HAS_C_LIB c)
-append_if(libraries LIBCXX_HAS_M_LIB m)
-append_if(libraries LIBCXX_HAS_RT_LIB rt)
-append_if(libraries LIBCXX_HAS_GCC_S_LIB gcc_s)
-
-if (LIBCXX_COVERAGE_LIBRARY)
- target_link_libraries(cxx ${LIBCXX_COVERAGE_LIBRARY})
+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 LLVM_USE_SANITIZER)
+ if ("${LLVM_USE_SANITIZER}" STREQUAL "Address")
+ set(LIBFILE "libclang_rt.asan_osx_dynamic.dylib")
+ elseif("${LLVM_USE_SANITIZER}" STREQUAL "Undefined")
+ set(LIBFILE "libclang_rt.ubsan_osx_dynamic.dylib")
+ else()
+ message(WARNING "LLVM_USE_SANITIZER=${LLVM_USE_SANITIZER} is not supported on OS X")
+ endif()
+ if (LIBFILE)
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=lib OUTPUT_VARIABLE LIBDIR RESULT_VARIABLE Result)
+ if (NOT ${Result} EQUAL "0")
+ message(FATAL "Failed to find library resource directory")
+ endif()
+ string(STRIP "${LIBDIR}" LIBDIR)
+ set(LIBDIR "${LIBDIR}/darwin/")
+ if (NOT IS_DIRECTORY "${LIBDIR}")
+ message(FATAL_ERROR "Cannot find compiler-rt directory on OS X required for LLVM_USE_SANITIZER")
+ endif()
+ set(LIBCXX_SANITIZER_LIBRARY "${LIBDIR}/${LIBFILE}")
+ set(LIBCXX_SANITIZER_LIBRARY "${LIBCXX_SANITIZER_LIBRARY}" PARENT_SCOPE)
+ message(STATUS "Manually linking compiler-rt library: ${LIBCXX_SANITIZER_LIBRARY}")
+ add_library_flags("${LIBCXX_SANITIZER_LIBRARY}")
+ add_link_flags("-Wl,-rpath,${LIBDIR}")
+ endif()
endif()
-target_link_libraries(cxx ${libraries})
+# Generate 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)
+add_library_flags_if(LIBCXX_HAS_RT_LIB rt)
+add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s)
# Setup flags.
-append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_FPIC_FLAG -fPIC)
-append_if(LIBCXX_LINK_FLAGS LIBCXX_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs)
+add_flags_if_supported(-fPIC)
+add_link_flags_if_supported(-nodefaultlibs)
if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"))
@@ -80,8 +91,8 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
endif()
if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" )
- list(APPEND LIBCXX_COMPILE_FLAGS "-U__STRICT_ANSI__")
- list(APPEND LIBCXX_LINK_FLAGS
+ add_definitions(-D__STRICT_ANSI__)
+ add_link_flags(
"-compatibility_version 1"
"-current_version 1"
"-install_name /usr/lib/libc++.1.dylib"
@@ -100,10 +111,10 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
"-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib")
endif()
else()
- set (OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
+ set(OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
endif()
- list(APPEND LIBCXX_LINK_FLAGS
+ add_link_flags(
"-compatibility_version 1"
"-install_name /usr/lib/libc++.1.dylib"
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
@@ -113,19 +124,64 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
endif()
endif()
-string(REPLACE ";" " " LIBCXX_COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}")
-string(REPLACE ";" " " LIBCXX_LINK_FLAGS "${LIBCXX_LINK_FLAGS}")
+target_link_libraries(cxx ${LIBCXX_LIBRARIES})
+split_list(LIBCXX_COMPILE_FLAGS)
+split_list(LIBCXX_LINK_FLAGS)
set_target_properties(cxx
PROPERTIES
COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
OUTPUT_NAME "c++"
- VERSION "1.0"
- SOVERSION "1"
+ VERSION "${LIBCXX_ABI_VERSION}.0"
+ SOVERSION "${LIBCXX_ABI_VERSION}"
)
-install(TARGETS cxx
- LIBRARY DESTINATION lib${LIBCXX_LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LIBCXX_LIBDIR_SUFFIX}
+# Generate a linker script inplace of a libc++.so symlink. Rerun this command
+# after cxx builds.
+if (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()
+ # Generate a linker script inplace of a libc++.so symlink. Rerun this command
+ # after cxx builds.
+ add_custom_command(TARGET cxx POST_BUILD
+ COMMAND
+ ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/gen_link_script/gen_link_script.py
+ ARGS
+ "$<TARGET_LINKER_FILE:cxx>"
+ "${SCRIPT_ABI_LIBNAME}"
+ WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
)
+endif()
+
+if (LIBCXX_INSTALL_LIBRARY)
+ install(TARGETS cxx
+ LIBRARY DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
+ ARCHIVE DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
+ )
+ # 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)
+ # 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}"
+ DESTINATION lib${LIBCXX_LIBDIR_SUFFIX}
+ COMPONENT libcxx)
+ endif()
+endif()
+
+if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR
+ LIBCXX_INSTALL_HEADERS))
+ if(LIBCXX_INSTALL_LIBRARY)
+ set(deps DEPENDS cxx)
+ endif()
+ add_custom_target(install-libcxx
+ ${deps}
+ COMMAND "${CMAKE_COMMAND}"
+ -DCMAKE_INSTALL_COMPONENT=libcxx
+ -P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")
+endif()
diff --git a/lib/libc++abi2.exp b/lib/libc++abi2.exp
index bdfe99c3456e..47dcbbb88fcd 100644
--- a/lib/libc++abi2.exp
+++ b/lib/libc++abi2.exp
@@ -290,6 +290,16 @@ __ZTISt16invalid_argument
__ZTSSt16invalid_argument
__ZTVSt16invalid_argument
+__ZNKSt16bad_array_length4whatEv
+__ZNSt16bad_array_lengthC1Ev
+__ZNSt16bad_array_lengthC2Ev
+__ZNSt16bad_array_lengthD0Ev
+__ZNSt16bad_array_lengthD1Ev
+__ZNSt16bad_array_lengthD2Ev
+__ZTISt16bad_array_length
+__ZTSSt16bad_array_length
+__ZTVSt16bad_array_length
+
__ZTSDi
__ZTSDn
__ZTSDs
diff --git a/src/any.cpp b/src/any.cpp
new file mode 100644
index 000000000000..f77684578905
--- /dev/null
+++ b/src/any.cpp
@@ -0,0 +1,18 @@
+//===---------------------------- any.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 "experimental/any"
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS
+
+const char* bad_any_cast::what() const _NOEXCEPT {
+ return "bad any cast";
+}
+
+_LIBCPP_END_NAMESPACE_LFTS
diff --git a/src/exception.cpp b/src/exception.cpp
index 2c16060a7583..e172f642d483 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -12,10 +12,6 @@
#include "exception"
#include "new"
-#ifndef __has_include
-#define __has_include(inc) 0
-#endif
-
#if defined(__APPLE__) && !defined(LIBCXXRT)
#include <cxxabi.h>
@@ -29,16 +25,16 @@
#define __terminate_handler __cxxabiapple::__cxa_terminate_handler
#define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler
#endif // _LIBCPPABI_VERSION
-#elif defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI) || __has_include(<cxxabi.h>)
+#elif defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI)
#include <cxxabi.h>
using namespace __cxxabiv1;
#if defined(LIBCXXRT) || defined(_LIBCPPABI_VERSION)
#define HAVE_DEPENDENT_EH_ABI 1
#endif
-#elif !defined(__GLIBCXX__) // __has_include(<cxxabi.h>)
+#elif !defined(__GLIBCXX__) // defined(LIBCXX_BUILDING_LIBCXXABI)
static std::terminate_handler __terminate_handler;
static std::unexpected_handler __unexpected_handler;
-#endif // __has_include(<cxxabi.h>)
+#endif // defined(LIBCXX_BUILDING_LIBCXXABI)
namespace std
{
diff --git a/src/future.cpp b/src/future.cpp
index 3132b1861af2..e1758f39df3a 100644
--- a/src/future.cpp
+++ b/src/future.cpp
@@ -221,10 +221,12 @@ promise<void>::~promise()
{
if (__state_)
{
+#ifndef _LIBCPP_NO_EXCEPTIONS
if (!__state_->__has_value() && __state_->use_count() > 1)
__state_->set_exception(make_exception_ptr(
future_error(make_error_code(future_errc::broken_promise))
));
+#endif // _LIBCPP_NO_EXCEPTIONS
__state_->__release_shared();
}
}
diff --git a/src/support/atomic_support.h b/src/include/atomic_support.h
index e738a5154cd3..dbf3b9c81ea4 100644
--- a/src/support/atomic_support.h
+++ b/src/include/atomic_support.h
@@ -103,6 +103,13 @@ void __libcpp_atomic_store(_ValueType* __dest, _FromType __val,
*__dest = __val;
}
+template <class _ValueType, class _FromType>
+inline _LIBCPP_INLINE_VISIBILITY
+void __libcpp_relaxed_store(_ValueType* __dest, _FromType __val)
+{
+ *__dest = __val;
+}
+
template <class _ValueType>
inline _LIBCPP_INLINE_VISIBILITY
_ValueType __libcpp_atomic_load(_ValueType const* __val,
diff --git a/src/config_elast.h b/src/include/config_elast.h
index 9d6a76b0c004..9d6a76b0c004 100644
--- a/src/config_elast.h
+++ b/src/include/config_elast.h
diff --git a/src/ios.cpp b/src/ios.cpp
index 90972c407d79..23e3ee0ca044 100644
--- a/src/ios.cpp
+++ b/src/ios.cpp
@@ -15,7 +15,7 @@
#include "__locale"
#include "algorithm"
-#include "config_elast.h"
+#include "include/config_elast.h"
#include "istream"
#include "limits"
#include "memory"
@@ -152,7 +152,7 @@ ios_base::getloc() const
}
// xalloc
-#if __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
+#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
atomic<int> ios_base::__xindex_ = ATOMIC_VAR_INIT(0);
#else
int ios_base::__xindex_ = 0;
diff --git a/src/locale.cpp b/src/locale.cpp
index bdc73e1d5379..6b04e7881764 100644
--- a/src/locale.cpp
+++ b/src/locale.cpp
@@ -812,7 +812,8 @@ ctype<wchar_t>::do_toupper(char_type c) const
{
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
return isascii(c) ? _DefaultRuneLocale.__mapupper[c] : c;
-#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__)
+#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || \
+ defined(__NetBSD__)
return isascii(c) ? ctype<char>::__classic_upper_table()[c] : c;
#else
return (isascii(c) && iswlower_l(c, _LIBCPP_GET_C_LOCALE)) ? c-L'a'+L'A' : c;
@@ -825,7 +826,8 @@ ctype<wchar_t>::do_toupper(char_type* low, const char_type* high) const
for (; low != high; ++low)
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
*low = isascii(*low) ? _DefaultRuneLocale.__mapupper[*low] : *low;
-#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__)
+#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || \
+ defined(__NetBSD__)
*low = isascii(*low) ? ctype<char>::__classic_upper_table()[*low]
: *low;
#else
@@ -839,7 +841,8 @@ ctype<wchar_t>::do_tolower(char_type c) const
{
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
return isascii(c) ? _DefaultRuneLocale.__maplower[c] : c;
-#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__)
+#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || \
+ defined(__NetBSD__)
return isascii(c) ? ctype<char>::__classic_lower_table()[c] : c;
#else
return (isascii(c) && isupper_l(c, _LIBCPP_GET_C_LOCALE)) ? c-L'A'+'a' : c;
@@ -852,7 +855,8 @@ ctype<wchar_t>::do_tolower(char_type* low, const char_type* high) const
for (; low != high; ++low)
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
*low = isascii(*low) ? _DefaultRuneLocale.__maplower[*low] : *low;
-#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__)
+#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || \
+ defined(__NetBSD__)
*low = isascii(*low) ? ctype<char>::__classic_lower_table()[*low]
: *low;
#else
@@ -922,7 +926,7 @@ ctype<char>::do_toupper(char_type c) const
#elif defined(__NetBSD__)
return static_cast<char>(__classic_upper_table()[static_cast<unsigned char>(c)]);
#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__)
- return isascii(c) ?
+ return isascii(c) ?
static_cast<char>(__classic_upper_table()[static_cast<unsigned char>(c)]) : c;
#else
return (isascii(c) && islower_l(c, _LIBCPP_GET_C_LOCALE)) ? c-'a'+'A' : c;
@@ -955,7 +959,7 @@ ctype<char>::do_tolower(char_type c) const
static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(c)]) : c;
#elif defined(__NetBSD__)
return static_cast<char>(__classic_lower_table()[static_cast<unsigned char>(c)]);
-#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__)
+#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__)
return isascii(c) ?
static_cast<char>(__classic_lower_table()[static_cast<size_t>(c)]) : c;
#else
@@ -1012,7 +1016,7 @@ ctype<char>::do_narrow(const char_type* low, const char_type* high, char dfault,
return low;
}
-#ifdef __EMSCRIPTEN__
+#if defined(__EMSCRIPTEN__)
extern "C" const unsigned short ** __ctype_b_loc();
extern "C" const int ** __ctype_tolower_loc();
extern "C" const int ** __ctype_toupper_loc();
@@ -1169,7 +1173,7 @@ ctype<char>::__classic_upper_table() _NOEXCEPT
{
return *__ctype_toupper_loc();
}
-#endif // __GLIBC__ || __EMSCRIPTEN__ || __NETBSD__
+#endif // __GLIBC__ || __NETBSD__ || __EMSCRIPTEN__
// template <> class ctype_byname<char>
diff --git a/src/memory.cpp b/src/memory.cpp
index 66fb143c6a62..5b81f26e3dc0 100644
--- a/src/memory.cpp
+++ b/src/memory.cpp
@@ -13,7 +13,7 @@
#include "mutex"
#include "thread"
#endif
-#include "support/atomic_support.h"
+#include "include/atomic_support.h"
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -124,7 +124,7 @@ __shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
#endif // _LIBCPP_NO_RTTI
-#if __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
+#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
static const std::size_t __sp_mut_count = 16;
static pthread_mutex_t mut_back_imp[__sp_mut_count] =
@@ -177,7 +177,7 @@ __get_sp_mut(const void* p)
return muts[hash<const void*>()(p) & (__sp_mut_count-1)];
}
-#endif // __has_feature(cxx_atomic) && !_LIBCPP_HAS_NO_THREADS
+#endif // defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
void
declare_reachable(void*)
diff --git a/src/mutex.cpp b/src/mutex.cpp
index 5f8ba0a08266..127e67a2627e 100644
--- a/src/mutex.cpp
+++ b/src/mutex.cpp
@@ -12,7 +12,7 @@
#include "limits"
#include "system_error"
#include "cassert"
-#include "support/atomic_support.h"
+#include "include/atomic_support.h"
_LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_HAS_NO_THREADS
diff --git a/src/new.cpp b/src/new.cpp
index c28fcb5917cf..f4f73d86803d 100644
--- a/src/new.cpp
+++ b/src/new.cpp
@@ -13,10 +13,6 @@
#include "new"
-#ifndef __has_include
-#define __has_include(inc) 0
-#endif
-
#if defined(__APPLE__) && !defined(LIBCXXRT)
#include <cxxabi.h>
@@ -27,9 +23,9 @@
#define __new_handler __cxxabiapple::__cxa_new_handler
#endif
#else // __APPLE__
- #if defined(LIBCXXRT) || __has_include(<cxxabi.h>)
+ #if defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI)
#include <cxxabi.h>
- #endif // __has_include(<cxxabi.h>)
+ #endif // defined(LIBCXX_BUILDING_LIBCXXABI)
#if !defined(_LIBCPPABI_VERSION) && !defined(__GLIBCXX__)
static std::new_handler __new_handler;
#endif // _LIBCPPABI_VERSION
@@ -38,7 +34,7 @@
#ifndef __GLIBCXX__
// Implement all new and delete operators as weak definitions
-// in this shared library, so that they can be overriden by programs
+// 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
diff --git a/src/stdexcept.cpp b/src/stdexcept.cpp
index aff4b1850d36..0a08bfec27ec 100644
--- a/src/stdexcept.cpp
+++ b/src/stdexcept.cpp
@@ -13,12 +13,8 @@
#include "string"
#include "system_error"
-#ifndef __has_include
-#define __has_include(inc) 0
-#endif
-
/* For _LIBCPPABI_VERSION */
-#if __has_include(<cxxabi.h>) || defined(__APPLE_) || defined(LIBCXXRT)
+#if defined(LIBCXX_BUILDING_LIBCXXABI) || defined(__APPLE__) || defined(LIBCXXRT)
#include <cxxabi.h>
#endif
diff --git a/src/system_error.cpp b/src/system_error.cpp
index 18f668f071cd..3023e200aa34 100644
--- a/src/system_error.cpp
+++ b/src/system_error.cpp
@@ -12,7 +12,7 @@
#define _LIBCPP_BUILDING_SYSTEM_ERROR
#include "system_error"
-#include "config_elast.h"
+#include "include/config_elast.h"
#include "cstring"
#include "string"
diff --git a/src/typeinfo.cpp b/src/typeinfo.cpp
index b4281209170c..5c0a609b5e5c 100644
--- a/src/typeinfo.cpp
+++ b/src/typeinfo.cpp
@@ -8,13 +8,8 @@
//===----------------------------------------------------------------------===//
#include <stdlib.h>
-#ifndef __has_include
-#define __has_include(inc) 0
-#endif
-
-#ifdef __APPLE__
-#include <cxxabi.h>
-#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
+#if defined(__APPLE__) || defined(LIBCXXRT) || \
+ defined(LIBCXX_BUILDING_LIBCXXABI)
#include <cxxabi.h>
#endif
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index ca937a8dba9a..b67b3b43f83e 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -6,84 +6,43 @@ macro(pythonize_bool var)
endif()
endmacro()
-set(LIT_EXECUTABLE "" CACHE FILEPATH "Path to LLVM's llvm-lit.")
-
-if(LIBCXX_BUILT_STANDALONE)
- # Make sure we can use the console pool for recent cmake and ninja > 1.5
- if(CMAKE_VERSION VERSION_LESS 3.1.20141117)
- set(cmake_3_2_USES_TERMINAL)
- else()
- set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
- endif()
-else()
- include(FindPythonInterp)
- if(PYTHONINTERP_FOUND)
- set(LIT_EXECUTABLE
- ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/utils/lit/lit.py)
- else()
- message(WARNING "Could not find Python, cannot set LIT_EXECUTABLE.")
- endif()
+set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING
+ "Configuration variant to use for LIT.")
+
+pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS)
+pythonize_bool(LIBCXX_ENABLE_RTTI)
+pythonize_bool(LIBCXX_ENABLE_SHARED)
+pythonize_bool(LIBCXX_BUILD_32_BITS)
+pythonize_bool(LIBCXX_GENERATE_COVERAGE)
+pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
+
+# 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()
-if (LIT_EXECUTABLE)
- set(LIT_ARGS_DEFAULT "-sv --show-unsupported --show-xfail")
- if (MSVC OR XCODE)
- set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
- endif()
- set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}"
- CACHE STRING "Default options for lit")
- set(LIT_ARGS "${LLVM_LIT_ARGS}")
- separate_arguments(LIT_ARGS)
-
- set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING
- "Configuration variant to use for LIT.")
-
- pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS)
- pythonize_bool(LIBCXX_ENABLE_RTTI)
- pythonize_bool(LIBCXX_ENABLE_SHARED)
- pythonize_bool(LIBCXX_BUILD_32_BITS)
- pythonize_bool(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE)
- pythonize_bool(LIBCXX_ENABLE_STDIN)
- pythonize_bool(LIBCXX_ENABLE_STDOUT)
- pythonize_bool(LIBCXX_ENABLE_THREADS)
- pythonize_bool(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS)
- pythonize_bool(LIBCXX_ENABLE_MONOTONIC_CLOCK)
- pythonize_bool(LIBCXX_GENERATE_COVERAGE)
- pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
-
- # The tests shouldn't link to any ABI library when it has been linked into
- # libc++ statically.
- if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
- set(LIBCXX_CXX_ABI_LIBNAME "none")
- endif()
- set(LIBCXX_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
- "TargetInfo to use when setting up test environment.")
- set(LIBCXX_EXECUTOR "None" CACHE STRING
- "Executor to use when running tests.")
-
- set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")
-
- configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
- @ONLY)
-
- add_custom_target(check-libcxx
- COMMAND ${LIT_EXECUTABLE}
- ${LIT_ARGS}
- ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS cxx
- COMMENT "Running libcxx tests"
- ${cmake_3_2_USES_TERMINAL})
-
- if (LIBCXX_GENERATE_COVERAGE)
- include(CodeCoverage)
- set(output_dir "${CMAKE_CURRENT_BINARY_DIR}/coverage")
- set(capture_dirs "${LIBCXX_LIB_CMAKEFILES_DIR}/cxx.dir/;${CMAKE_CURRENT_BINARY_DIR}")
- set(extract_dirs "${LIBCXX_SOURCE_DIR}/include;${LIBCXX_SOURCE_DIR}/src")
- setup_lcov_test_target_coverage("cxx" "${output_dir}" "${capture_dirs}" "${extract_dirs}")
- endif()
-else()
- message(WARNING
- "LIT_EXECUTABLE not set, no check-libcxx target will be available!")
+set(LIBCXX_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
+ "TargetInfo to use when setting up test environment.")
+set(LIBCXX_EXECUTOR "None" CACHE STRING
+ "Executor to use when running tests.")
+
+set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")
+
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+ ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+ @ONLY)
+
+add_lit_testsuite(check-libcxx
+ "Running libcxx tests"
+ ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS cxx)
+
+if (LIBCXX_GENERATE_COVERAGE)
+ include(CodeCoverage)
+ set(output_dir "${CMAKE_CURRENT_BINARY_DIR}/coverage")
+ set(capture_dirs "${LIBCXX_LIB_CMAKEFILES_DIR}/cxx.dir/;${CMAKE_CURRENT_BINARY_DIR}")
+ set(extract_dirs "${LIBCXX_SOURCE_DIR}/include;${LIBCXX_SOURCE_DIR}/src")
+ setup_lcov_test_target_coverage("cxx" "${output_dir}" "${capture_dirs}" "${extract_dirs}")
endif()
diff --git a/test/std/atomics/libcpp-has-no-threads.fail.cpp b/test/libcxx/atomics/libcpp-has-no-threads.fail.cpp
index fe95e6a5983a..fe95e6a5983a 100644
--- a/test/std/atomics/libcpp-has-no-threads.fail.cpp
+++ b/test/libcxx/atomics/libcpp-has-no-threads.fail.cpp
diff --git a/test/std/atomics/libcpp-has-no-threads.pass.cpp b/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
index 9c0cccbda380..e587e6b4317a 100644
--- a/test/std/atomics/libcpp-has-no-threads.pass.cpp
+++ b/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
@@ -10,7 +10,7 @@
#ifdef _LIBCPP_HAS_NO_THREADS
#error This should be XFAIL'd for the purpose of detecting that the LIT feature\
- 'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined
+ 'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined
#endif
int main()
diff --git a/test/libcxx/compiler.py b/test/libcxx/compiler.py
index 7afbed461e31..4962038cbbed 100644
--- a/test/libcxx/compiler.py
+++ b/test/libcxx/compiler.py
@@ -150,3 +150,39 @@ class CXXCompiler(object):
cmd, out, err, rc = self.compile(os.devnull, out=os.devnull,
flags=flags)
return rc == 0
+
+ def addCompileFlagIfSupported(self, flag):
+ if isinstance(flag, list):
+ flags = list(flag)
+ else:
+ flags = [flag]
+ if self.hasCompileFlag(flags):
+ self.compile_flags += flags
+ return True
+ else:
+ return False
+
+ def addWarningFlagIfSupported(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
+ "-Wno-<warning>" GCC will not emit an unknown option diagnostic unless
+ another error is triggered during compilation.
+ """
+ assert isinstance(flag, str)
+ if not flag.startswith('-Wno-'):
+ return self.addCompileFlagIfSupported(flag)
+ flags = ['-Werror', flag]
+ cmd = self.compileCmd('-', os.devnull, flags)
+ # 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
diff --git a/test/libcxx/containers/sequences/deque/incomplete.pass.cpp b/test/libcxx/containers/sequences/deque/incomplete.pass.cpp
new file mode 100644
index 000000000000..dbeea5f9aefb
--- /dev/null
+++ b/test/libcxx/containers/sequences/deque/incomplete.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// deque()
+// deque::iterator()
+
+#define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
+#include <deque>
+#include <cassert>
+
+struct A {
+ std::deque<A> d;
+ std::deque<A>::iterator it;
+ std::deque<A>::reverse_iterator it2;
+};
+
+int main()
+{
+ A a;
+ assert(a.d.size() == 0);
+ a.it = a.d.begin();
+ a.it2 = a.d.rend();
+}
diff --git a/test/std/containers/sequences/vector/asan.pass.cpp b/test/libcxx/containers/sequences/vector/asan.pass.cpp
index 86c02b295624..b102fc08dafb 100644
--- a/test/std/containers/sequences/vector/asan.pass.cpp
+++ b/test/libcxx/containers/sequences/vector/asan.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5
+
// <vector>
// reference operator[](size_type n);
@@ -15,15 +17,21 @@
#include <cassert>
#include <cstdlib>
-#include "min_allocator.h"
#include "asan_testing.h"
+#include "min_allocator.h"
+#include "test_iterators.h"
+#include "test_macros.h"
#ifndef _LIBCPP_HAS_NO_ASAN
-extern "C" void __asan_set_error_exit_code(int);
+extern "C" void __sanitizer_set_death_callback(void (*callback)(void));
+
+void do_exit() {
+ exit(0);
+}
int main()
{
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::vector<T, min_allocator<T>> C;
@@ -33,15 +41,26 @@ int main()
T foo = c[c.size()]; // bad, but not caught by ASAN
}
#endif
-
- __asan_set_error_exit_code(0);
+
+ {
+ typedef input_iterator<int*> MyInputIter;
+ // Sould not trigger ASan.
+ std::vector<int> v;
+ v.reserve(1);
+ int i[] = {42};
+ v.insert(v.begin(), MyInputIter(i), MyInputIter(i + 1));
+ assert(v[0] == 42);
+ assert(is_contiguous_container_asan_correct(v));
+ }
+
+ __sanitizer_set_death_callback(do_exit);
{
typedef int T;
typedef std::vector<T> C;
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());
- assert(is_contiguous_container_asan_correct(c));
+ 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(false); // if we got here, ASAN didn't trigger
diff --git a/test/std/containers/sequences/vector/asan_throw.pass.cpp b/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp
index c100da1aade7..9af3f6be53e8 100644
--- a/test/std/containers/sequences/vector/asan_throw.pass.cpp
+++ b/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// Test asan vector annotations with a class that throws in a CTOR.
#include <vector>
diff --git a/test/libcxx/double_include.sh.cpp b/test/libcxx/double_include.sh.cpp
index 5620e5b35c2b..99767cf1bbc8 100644
--- a/test/libcxx/double_include.sh.cpp
+++ b/test/libcxx/double_include.sh.cpp
@@ -15,6 +15,12 @@
// 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
+
#include <algorithm>
#include <array>
#include <bitset>
@@ -50,6 +56,7 @@
#include <deque>
#include <exception>
#include <experimental/algorithm>
+#include <experimental/any>
#include <experimental/chrono>
#include <experimental/dynarray>
#include <experimental/optional>
diff --git a/test/libcxx/experimental/any/size_and_alignment.pass.cpp b/test/libcxx/experimental/any/size_and_alignment.pass.cpp
new file mode 100644
index 000000000000..b7db54020478
--- /dev/null
+++ b/test/libcxx/experimental/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
+
+// <experimental/any>
+
+// Check that the size and alignment of any are what we expect.
+
+#include <experimental/any>
+
+int main()
+{
+ using std::experimental::any;
+ static_assert(sizeof(any) == sizeof(void*)*4, "");
+ static_assert(alignof(any) == alignof(void*), "");
+}
diff --git a/test/libcxx/experimental/any/small_type.pass.cpp b/test/libcxx/experimental/any/small_type.pass.cpp
new file mode 100644
index 000000000000..e6595d4a4ab3
--- /dev/null
+++ b/test/libcxx/experimental/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
+
+// <experimental/any>
+
+// Check that the size and alignment of any are what we expect.
+
+#include <experimental/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::experimental::any;
+ using std::experimental::__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/libcxx/experimental/any/version.pass.cpp b/test/libcxx/experimental/any/version.pass.cpp
new file mode 100644
index 000000000000..611d65027b19
--- /dev/null
+++ b/test/libcxx/experimental/any/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.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/any>
+
+#include <experimental/any>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}
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 0effac2fc142..738c0c72592e 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,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: c++98, c++03, c++11
+
// dynarray.cons
// explicit dynarray(size_type c);
@@ -16,22 +19,21 @@
// ~dynarray();
-
-#include <__config>
-
-#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
#include <algorithm>
#include <complex>
+#include <limits>
+#include <new>
#include <string>
+
using std::experimental::dynarray;
template <class T>
-void test ( const std::initializer_list<T> &vals ) {
+void testInitList( const std::initializer_list<T> &vals ) {
typedef dynarray<T> dynA;
dynA d1 ( vals );
@@ -41,12 +43,14 @@ void test ( const std::initializer_list<T> &vals ) {
template <class T>
-void test ( const T &val ) {
+void test ( const T &val, bool DefaultValueIsIndeterminate = false) {
typedef dynarray<T> dynA;
dynA d1 ( 4 );
assert ( d1.size () == 4 );
- assert ( std::all_of ( d1.begin (), d1.end (), []( const T &item ){ return item == T(); } ));
+ if (!DefaultValueIsIndeterminate) {
+ assert ( std::all_of ( d1.begin (), d1.end (), []( const T &item ){ return item == T(); } ));
+ }
dynA d2 ( 7, val );
assert ( d2.size () == 7 );
@@ -60,27 +64,23 @@ void test ( const T &val ) {
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 );
- }
+}
-void test_bad_alloc () {
- try { dynarray<int> ( std::numeric_limits<size_t>::max() / sizeof ( int ) - 1 ); }
- catch ( std::bad_alloc & ) { return ; }
- assert ( false );
- }
int main()
{
-// test<int> ( 14 ); // ints don't get default initialized
- test<long> ( 0 );
- test<double> ( 14.0 );
+ test<int> ( 14, /* DefaultValueIsIndeterminate */ true ); // ints don't get default initialized
+ test<long> ( 0, true);
+ test<double> ( 14.0, true );
test<std::complex<double>> ( std::complex<double> ( 14, 0 ));
test<std::string> ( "fourteen" );
- test ( { 1, 1, 2, 3, 5, 8 } );
- test ( { 1., 1., 2., 3., 5., 8. } );
- test ( { std::string("1"), std::string("1"), std::string("2"), std::string("3"),
- std::string("5"), std::string("8")} );
+ testInitList( { 1, 1, 2, 3, 5, 8 } );
+ testInitList( { 1., 1., 2., 3., 5., 8. } );
+ testInitList( { std::string("1"), std::string("1"), std::string("2"), std::string("3"),
+ std::string("5"), std::string("8")} );
// Make sure we don't pick up the Allocator version here
dynarray<long> d1 ( 20, 3 );
@@ -88,8 +88,4 @@ int main()
assert ( std::all_of ( d1.begin (), d1.end (), []( long item ){ return item == 3L; } ));
test_bad_length ();
- test_bad_alloc ();
}
-#else
-int main() {}
-#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
new file mode 100644
index 000000000000..612e661ea6db
--- /dev/null
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.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.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL: libcpp-no-exceptions
+// dynarray.cons
+
+// explicit dynarray(size_type c);
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// The sanitizers replace new/delete with versions that do not throw bad_alloc.
+// UNSUPPORTED: sanitizer-new-delete, ubsan
+
+
+#include <experimental/dynarray>
+#include <limits>
+#include <new>
+#include <cassert>
+
+
+using std::experimental::dynarray;
+
+int main() {
+ try { dynarray<int>((std::numeric_limits<size_t>::max() / sizeof(int)) - 1); }
+ catch (std::bad_alloc &) { return 0; }
+ catch (...) { assert(false); }
+ assert(false);
+}
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp
index b669f25948ed..1bbd8cde92fe 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp
@@ -7,15 +7,13 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11
+
// dynarray.data
// T* data() noexcept;
// const T* data() const noexcept;
-
-#include <__config>
-
-#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
@@ -27,41 +25,44 @@
using std::experimental::dynarray;
template <class T>
-void dyn_test_const ( const dynarray<T> &dyn ) {
+void dyn_test_const(const dynarray<T> &dyn, bool CheckEquals = true) {
const T *data = dyn.data ();
assert ( data != NULL );
- assert ( std::equal ( dyn.begin(), dyn.end(), data ));
+ if (CheckEquals) {
+ assert ( std::equal ( dyn.begin(), dyn.end(), data ));
}
+}
template <class T>
-void dyn_test ( dynarray<T> &dyn ) {
+void dyn_test( dynarray<T> &dyn, bool CheckEquals = true) {
T *data = dyn.data ();
assert ( data != NULL );
- assert ( std::equal ( dyn.begin(), dyn.end(), data ));
+ if (CheckEquals) {
+ assert ( std::equal ( dyn.begin(), dyn.end(), data ));
}
+}
template <class T>
-void test ( const T &val ) {
+void test(const T &val, bool DefaultValueIsIndeterminate = false) {
typedef dynarray<T> dynA;
+
+ const bool CheckDefaultValues = !DefaultValueIsIndeterminate;
+
+ dynA d1(4);
+ dyn_test(d1, CheckDefaultValues);
+ dyn_test_const(d1, CheckDefaultValues);
- dynA d1 ( 4 );
- dyn_test ( d1 );
- dyn_test_const ( d1 );
-
- dynA d2 ( 7, val );
+ dynA d2 (7, val);
dyn_test ( d2 );
dyn_test_const ( d2 );
- }
+}
int main()
{
- test<int> ( 14 );
- test<double> ( 14.0 );
+ test<int>(14, /* DefaultValueIsIndeterminate */ true);
+ test<double>(14.0, true);
test<std::complex<double>> ( std::complex<double> ( 14, 0 ));
test<std::string> ( "fourteen" );
}
-#else
-int main() {}
-#endif
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 4d77cf732758..8c0d08538716 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
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// dynarray.overview
// const_reference at(size_type n) const;
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp
index e82aa64b98b6..2af862a5530f 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11
+
// dynarray.overview
// reference front();
@@ -14,10 +16,6 @@
// reference back();
// const_reference back() const;
-
-#include <__config>
-
-#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
@@ -29,40 +27,47 @@
using std::experimental::dynarray;
template <class T>
-void dyn_test_const ( const dynarray<T> &dyn ) {
+void dyn_test_const ( const dynarray<T> &dyn, bool CheckValues = true ) {
const T *data = dyn.data ();
- assert ( *data == dyn.front ());
- assert ( *(data + dyn.size() - 1 ) == dyn.back ());
+ assert(data == &dyn.front());
+ assert((data + dyn.size() - 1) == &dyn.back());
+ if (CheckValues) {
+ assert ( *data == dyn.front ());
+ assert ( *(data + dyn.size() - 1 ) == dyn.back ());
}
+}
template <class T>
-void dyn_test ( dynarray<T> &dyn ) {
+void dyn_test ( dynarray<T> &dyn, bool CheckValues = true ) {
T *data = dyn.data ();
- assert ( *data == dyn.front ());
- assert ( *(data + dyn.size() - 1 ) == dyn.back ());
+ assert(data == &dyn.front());
+ assert((data + dyn.size() - 1) == &dyn.back());
+ if (CheckValues) {
+ assert ( *data == dyn.front ());
+ assert ( *(data + dyn.size() - 1 ) == dyn.back ());
}
+}
template <class T>
-void test ( const T &val ) {
+void test ( const T &val, bool DefaultValueIsIndeterminate = false) {
typedef dynarray<T> dynA;
-
+
+ const bool CheckDefaultValues = ! DefaultValueIsIndeterminate;
+
dynA d1 ( 4 );
- dyn_test ( d1 );
- dyn_test_const ( d1 );
+ dyn_test ( d1, CheckDefaultValues );
+ dyn_test_const ( d1, CheckDefaultValues );
dynA d2 ( 7, val );
dyn_test ( d2 );
dyn_test_const ( d2 );
- }
+}
int main()
{
- test<int> ( 14 );
- test<double> ( 14.0 );
+ test<int> ( 14, /* DefaultValueIsIndeterminate */ true);
+ test<double> ( 14.0, true );
test<std::complex<double>> ( std::complex<double> ( 14, 0 ));
test<std::string> ( "fourteen" );
}
-#else
-int main() {}
-#endif
diff --git a/test/libcxx/test/config.py b/test/libcxx/test/config.py
index 09fbf66dbba0..fefbf01ad450 100644
--- a/test/libcxx/test/config.py
+++ b/test/libcxx/test/config.py
@@ -1,4 +1,3 @@
-import importlib
import locale
import os
import platform
@@ -12,6 +11,7 @@ import lit.util # pylint: disable=import-error,no-name-in-module
from libcxx.test.format import LibcxxTestFormat
from libcxx.compiler import CXXCompiler
+from libcxx.test.target_info import make_target_info
from libcxx.test.executor import *
from libcxx.test.tracing import *
@@ -42,13 +42,13 @@ def loadSiteConfig(lit_config, config, param_name, env_name):
ld_fn(config, site_cfg)
lit_config.load_config = ld_fn
-
class Configuration(object):
# pylint: disable=redefined-outer-name
def __init__(self, lit_config, config):
self.lit_config = lit_config
self.config = config
self.cxx = None
+ self.project_obj_root = None
self.libcxx_src_root = None
self.libcxx_obj_root = None
self.cxx_library_root = None
@@ -141,13 +141,7 @@ class Configuration(object):
self.executor = te
def configure_target_info(self):
- default = "libcxx.test.target_info.LocalTI"
- info_str = self.get_lit_conf('target_info', default)
- mod_path, _, info = info_str.rpartition('.')
- mod = importlib.import_module(mod_path)
- self.target_info = getattr(mod, info)()
- if info_str != default:
- self.lit_config.note("inferred target_info as: %r" % info_str)
+ self.target_info = make_target_info(self)
def configure_cxx(self):
# Gather various compiler parameters.
@@ -179,7 +173,14 @@ class Configuration(object):
'libcxx_src_root', os.path.dirname(self.config.test_source_root))
def configure_obj_root(self):
+ self.project_obj_root = self.get_lit_conf('project_obj_root')
self.libcxx_obj_root = self.get_lit_conf('libcxx_obj_root')
+ if not self.libcxx_obj_root and self.project_obj_root is not None:
+ possible_root = os.path.join(self.project_obj_root, 'projects', 'libcxx')
+ if os.path.isdir(possible_root):
+ self.libcxx_obj_root = possible_root
+ else:
+ self.libcxx_obj_root = self.project_obj_root
def configure_cxx_library_root(self):
self.cxx_library_root = self.get_lit_conf('cxx_library_root',
@@ -211,13 +212,12 @@ class Configuration(object):
def configure_execute_external(self):
# Choose between lit's internal shell pipeline runner and a real shell.
# If LIT_USE_INTERNAL_SHELL is in the environment, we use that as the
- # default value. Otherwise we default to internal on Windows and
- # external elsewhere, as bash on Windows is usually very slow.
+ # default value. Otherwise we ask the target_info.
use_lit_shell_default = os.environ.get('LIT_USE_INTERNAL_SHELL')
if use_lit_shell_default is not None:
use_lit_shell_default = use_lit_shell_default != '0'
else:
- use_lit_shell_default = sys.platform == 'win32'
+ use_lit_shell_default = self.target_info.use_lit_shell_default()
# Check for the command line parameter using the default value if it is
# not present.
use_lit_shell = self.get_lit_bool('use_lit_shell',
@@ -236,63 +236,10 @@ class Configuration(object):
if additional_features:
for f in additional_features.split(','):
self.config.available_features.add(f.strip())
+ self.target_info.add_locale_features(self.config.available_features)
- # Figure out which of the required locales we support
- locales = {
- 'Darwin': {
- 'en_US.UTF-8': 'en_US.UTF-8',
- 'cs_CZ.ISO8859-2': 'cs_CZ.ISO8859-2',
- 'fr_FR.UTF-8': 'fr_FR.UTF-8',
- 'fr_CA.ISO8859-1': 'fr_CA.ISO8859-1',
- 'ru_RU.UTF-8': 'ru_RU.UTF-8',
- 'zh_CN.UTF-8': 'zh_CN.UTF-8',
- },
- 'FreeBSD': {
- 'en_US.UTF-8': 'en_US.UTF-8',
- 'cs_CZ.ISO8859-2': 'cs_CZ.ISO8859-2',
- 'fr_FR.UTF-8': 'fr_FR.UTF-8',
- 'fr_CA.ISO8859-1': 'fr_CA.ISO8859-1',
- 'ru_RU.UTF-8': 'ru_RU.UTF-8',
- 'zh_CN.UTF-8': 'zh_CN.UTF-8',
- },
- 'Linux': {
- 'en_US.UTF-8': 'en_US.UTF-8',
- 'cs_CZ.ISO8859-2': 'cs_CZ.ISO-8859-2',
- 'fr_FR.UTF-8': 'fr_FR.UTF-8',
- 'fr_CA.ISO8859-1': 'fr_CA.ISO-8859-1',
- 'ru_RU.UTF-8': 'ru_RU.UTF-8',
- 'zh_CN.UTF-8': 'zh_CN.UTF-8',
- },
- 'Windows': {
- 'en_US.UTF-8': 'English_United States.1252',
- 'cs_CZ.ISO8859-2': 'Czech_Czech Republic.1250',
- 'fr_FR.UTF-8': 'French_France.1252',
- 'fr_CA.ISO8859-1': 'French_Canada.1252',
- 'ru_RU.UTF-8': 'Russian_Russia.1251',
- 'zh_CN.UTF-8': 'Chinese_China.936',
- },
- }
-
- target_system = self.target_info.system()
target_platform = self.target_info.platform()
- if target_system in locales:
- default_locale = locale.setlocale(locale.LC_ALL)
- for feature, loc in locales[target_system].items():
- try:
- locale.setlocale(locale.LC_ALL, loc)
- self.config.available_features.add(
- 'locale.{0}'.format(feature))
- except locale.Error:
- self.lit_config.warning('The locale {0} is not supported by '
- 'your platform. Some tests will be '
- 'unsupported.'.format(loc))
- locale.setlocale(locale.LC_ALL, default_locale)
- else:
- # Warn that the user doesn't get any free XFAILs for locale issues
- self.lit_config.warning("No locales entry for target_system: %s" %
- target_system)
-
# Write an "available feature" that combines the triple when
# use_system_cxx_lib is enabled. This is so that we can easily write
# XFAIL markers for tests that are known to fail with versions of
@@ -304,17 +251,6 @@ class Configuration(object):
# Insert the platform name into the available features as a lower case.
self.config.available_features.add(target_platform)
- # Some linux distributions have different locale data than others.
- # Insert the distributions name and name-version into the available
- # features to allow tests to XFAIL on them.
- if target_platform == 'linux':
- name = self.target_info.platform_name()
- ver = self.target_info.platform_ver()
- if name:
- self.config.available_features.add(name)
- if name and ver:
- self.config.available_features.add('%s-%s' % (name, ver))
-
# Simulator testing can take a really long time for some of these tests
# so add a feature check so we can REQUIRES: long_tests in them
self.long_tests = self.get_lit_bool('long_tests')
@@ -344,38 +280,33 @@ class Configuration(object):
# Try and get the std version from the command line. Fall back to
# default given in lit.site.cfg is not present. If default is not
# present then force c++11.
- std = self.get_lit_conf('std', 'c++11')
+ std = self.get_lit_conf('std')
+ if not std:
+ # Choose the newest possible language dialect if none is given.
+ possible_stds = ['c++1z', 'c++14', 'c++11', 'c++03']
+ for s in possible_stds:
+ if self.cxx.hasCompileFlag('-std=%s' % s):
+ std = s
+ self.lit_config.note(
+ 'inferred language dialect as: %s' % std)
+ break
+ if not std:
+ self.lit_config.fatal(
+ '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)
# Configure include paths
self.cxx.compile_flags += ['-nostdinc++']
self.configure_compile_flags_header_includes()
- if self.target_info.platform() == 'linux':
- self.cxx.compile_flags += ['-D__STDC_FORMAT_MACROS',
- '-D__STDC_LIMIT_MACROS',
- '-D__STDC_CONSTANT_MACROS']
+ self.target_info.add_cxx_compile_flags(self.cxx.compile_flags)
# Configure feature flags.
self.configure_compile_flags_exceptions()
self.configure_compile_flags_rtti()
- self.configure_compile_flags_no_global_filesystem_namespace()
- self.configure_compile_flags_no_stdin()
- self.configure_compile_flags_no_stdout()
+ self.configure_compile_flags_abi_version()
enable_32bit = self.get_lit_bool('enable_32bit', False)
if enable_32bit:
self.cxx.flags += ['-m32']
- # Configure threading features.
- enable_threads = self.get_lit_bool('enable_threads', True)
- enable_monotonic_clock = self.get_lit_bool('enable_monotonic_clock',
- True)
- if not enable_threads:
- self.configure_compile_flags_no_threads()
- if not enable_monotonic_clock:
- self.configure_compile_flags_no_monotonic_clock()
- elif not enable_monotonic_clock:
- self.lit_config.fatal('enable_monotonic_clock cannot be false when'
- ' enable_threads is true.')
- self.configure_compile_flags_no_thread_unsafe_c_functions()
-
# Use verbose output for better errors
self.cxx.flags += ['-v']
sysroot = self.get_lit_conf('sysroot')
@@ -391,6 +322,7 @@ class Configuration(object):
support_path = os.path.join(self.libcxx_src_root, 'test/support')
self.cxx.compile_flags += ['-I' + support_path]
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):
@@ -398,6 +330,56 @@ class Configuration(object):
% libcxx_headers)
self.cxx.compile_flags += ['-I' + libcxx_headers]
+ def configure_config_site_header(self):
+ # Check for a possible __config_site in the build directory. We
+ # use this if it exists.
+ if self.libcxx_obj_root is None:
+ return
+ config_site_header = os.path.join(self.libcxx_obj_root, '__config_site')
+ if not os.path.isfile(config_site_header):
+ return
+ contained_macros = self.parse_config_site_and_add_features(
+ config_site_header)
+ self.lit_config.note('Using __config_site header %s with macros: %r'
+ % (config_site_header, contained_macros))
+ # FIXME: This must come after the call to
+ # 'parse_config_site_and_add_features(...)' in order for it to work.
+ self.cxx.compile_flags += ['-include', config_site_header]
+
+ def parse_config_site_and_add_features(self, header):
+ """ parse_config_site_and_add_features - Deduce and add the test
+ features that that are implied by the #define's in the __config_site
+ header. Return a dictionary containing the macros found in the
+ '__config_site' header.
+ """
+ # Parse the macro contents of __config_site by dumping the macros
+ # using 'c++ -dM -E' and filtering the predefines.
+ predefines = self.cxx.dumpMacros()
+ macros = self.cxx.dumpMacros(header)
+ feature_macros_keys = set(macros.keys()) - set(predefines.keys())
+ feature_macros = {}
+ for k in feature_macros_keys:
+ feature_macros[k] = macros[k]
+ # We expect the header guard to be one of the definitions
+ assert '_LIBCPP_CONFIG_SITE' in feature_macros
+ del feature_macros['_LIBCPP_CONFIG_SITE']
+ # The __config_site header should be non-empty. Otherwise it should
+ # have never been emitted by CMake.
+ assert len(feature_macros) > 0
+ # Transform each macro name into the feature name used in the tests.
+ # Ex. _LIBCPP_HAS_NO_THREADS -> libcpp-has-no-threads
+ for m in feature_macros:
+ if m == '_LIBCPP_ABI_VERSION':
+ self.config.available_features.add('libcpp-abi-version-v%s'
+ % feature_macros[m])
+ continue
+ assert m.startswith('_LIBCPP_HAS_') or m == '_LIBCPP_ABI_UNSTABLE'
+ m = m.lower()[1:].replace('_', '-')
+ self.config.available_features.add(m)
+ return feature_macros
+
+
+
def configure_compile_flags_exceptions(self):
enable_exceptions = self.get_lit_bool('enable_exceptions', True)
if not enable_exceptions:
@@ -410,43 +392,16 @@ class Configuration(object):
self.config.available_features.add('libcpp-no-rtti')
self.cxx.compile_flags += ['-fno-rtti', '-D_LIBCPP_NO_RTTI']
- def configure_compile_flags_no_global_filesystem_namespace(self):
- enable_global_filesystem_namespace = self.get_lit_bool(
- 'enable_global_filesystem_namespace', True)
- if not enable_global_filesystem_namespace:
- self.config.available_features.add(
- 'libcpp-has-no-global-filesystem-namespace')
- self.cxx.compile_flags += [
- '-D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE']
-
- def configure_compile_flags_no_stdin(self):
- enable_stdin = self.get_lit_bool('enable_stdin', True)
- if not enable_stdin:
- self.config.available_features.add('libcpp-has-no-stdin')
- self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_STDIN']
-
- def configure_compile_flags_no_stdout(self):
- enable_stdout = self.get_lit_bool('enable_stdout', True)
- if not enable_stdout:
- self.config.available_features.add('libcpp-has-no-stdout')
- self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_STDOUT']
-
- def configure_compile_flags_no_threads(self):
- self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_THREADS']
- self.config.available_features.add('libcpp-has-no-threads')
-
- def configure_compile_flags_no_thread_unsafe_c_functions(self):
- enable_thread_unsafe_c_functions = self.get_lit_bool(
- 'enable_thread_unsafe_c_functions', True)
- if not enable_thread_unsafe_c_functions:
- self.cxx.compile_flags += [
- '-D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS']
- self.config.available_features.add(
- 'libcpp-has-no-thread-unsafe-c-functions')
-
- def configure_compile_flags_no_monotonic_clock(self):
- self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_MONOTONIC_CLOCK']
- self.config.available_features.add('libcpp-has-no-monotonic-clock')
+ def configure_compile_flags_abi_version(self):
+ abi_version = self.get_lit_conf('abi_version', '').strip()
+ abi_unstable = self.get_lit_bool('abi_unstable')
+ # Only add the ABI version when it is non-default.
+ # FIXME(EricWF): Get the ABI version from the "__config_site".
+ if abi_version and abi_version != '1':
+ self.cxx.compile_flags += ['-D_LIBCPP_ABI_VERSION=' + abi_version]
+ if abi_unstable:
+ self.config.available_features.add('libcpp-abi-unstable')
+ self.cxx.compile_flags += ['-D_LIBCPP_ABI_UNSTABLE']
def configure_link_flags(self):
no_default_flags = self.get_lit_bool('no_default_flags', False)
@@ -505,9 +460,7 @@ class Configuration(object):
elif cxx_abi == 'libsupc++':
self.cxx.link_flags += ['-lsupc++']
elif cxx_abi == 'libcxxabi':
- # Don't link libc++abi explicitly on OS X because the symbols
- # should be available in libc++ directly.
- if self.target_info.platform() != 'darwin':
+ if self.target_info.allow_cxxabi_link():
self.cxx.link_flags += ['-lc++abi']
elif cxx_abi == 'libcxxrt':
self.cxx.link_flags += ['-lcxxrt']
@@ -518,26 +471,7 @@ class Configuration(object):
'C++ ABI setting %s unsupported for tests' % cxx_abi)
def configure_extra_library_flags(self):
- enable_threads = self.get_lit_bool('enable_threads', True)
- llvm_unwinder = self.get_lit_bool('llvm_unwinder', False)
- target_platform = self.target_info.platform()
- if target_platform == 'darwin':
- self.cxx.link_flags += ['-lSystem']
- elif target_platform == 'linux':
- if not llvm_unwinder:
- self.cxx.link_flags += ['-lgcc_eh']
- self.cxx.link_flags += ['-lc', '-lm']
- if enable_threads:
- self.cxx.link_flags += ['-lpthread']
- self.cxx.link_flags += ['-lrt']
- if llvm_unwinder:
- self.cxx.link_flags += ['-lunwind', '-ldl']
- else:
- self.cxx.link_flags += ['-lgcc_s']
- elif target_platform.startswith('freebsd'):
- self.cxx.link_flags += ['-lc', '-lm', '-lpthread', '-lgcc_s', '-lcxxrt']
- else:
- self.lit_config.fatal("unrecognized system: %r" % target_platform)
+ self.target_info.add_cxx_link_flags(self.cxx.link_flags)
def configure_color_diagnostics(self):
use_color = self.get_lit_conf('color_diagnostics')
@@ -570,14 +504,28 @@ class Configuration(object):
def configure_warnings(self):
enable_warnings = self.get_lit_bool('enable_warnings', False)
if enable_warnings:
- self.cxx.compile_flags += ['-Wsystem-headers', '-Wall', '-Werror']
- if ('clang' in self.config.available_features or
- 'apple-clang' in self.config.available_features):
- self.cxx.compile_flags += ['-Wno-user-defined-literals']
+ self.cxx.compile_flags += [
+ '-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER',
+ '-Wall', '-Werror'
+ ]
+ 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.
+ self.cxx.addWarningFlagIfSupported('-Wno-unused-local-typedef')
+ self.cxx.addWarningFlagIfSupported('-Wno-unused-variable')
+ 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
+ # causes an unused local typedef whenever it is used.
+ self.cxx.addWarningFlagIfSupported('-Wno-unused-local-typedef')
def configure_sanitizer(self):
san = self.get_lit_conf('use_sanitizer', '').strip()
if san:
+ self.target_info.add_sanitizer_features(san, self.config.available_features)
# Search for llvm-symbolizer along the compiler path first
# and then along the PATH env variable.
symbolizer_search_paths = os.environ.get('PATH', '')
@@ -590,8 +538,6 @@ class Configuration(object):
symbolizer_search_paths)
# Setup the sanitizer compile flags
self.cxx.flags += ['-g', '-fno-omit-frame-pointer']
- if self.target_info.platform() == 'linux':
- self.cxx.link_flags += ['-ldl']
if san == 'Address':
self.cxx.flags += ['-fsanitize=address']
if llvm_symbolizer is not None:
@@ -620,6 +566,10 @@ class Configuration(object):
else:
self.lit_config.fatal('unsupported value for '
'use_sanitizer: {0}'.format(san))
+ san_lib = self.get_lit_conf('sanitizer_library')
+ if san_lib:
+ self.cxx.link_flags += [
+ san_lib, '-Wl,-rpath,%s' % os.path.dirname(san_lib)]
def configure_coverage(self):
self.generate_coverage = self.get_lit_bool('generate_coverage', False)
@@ -692,18 +642,4 @@ class Configuration(object):
"inferred target_triple as: %r" % self.config.target_triple)
def configure_env(self):
- if self.target_info.platform() == 'darwin':
- library_paths = []
- # Configure the library path for libc++
- libcxx_library = self.get_lit_conf('libcxx_library')
- if self.use_system_cxx_lib:
- pass
- elif libcxx_library:
- library_paths += [os.path.dirname(libcxx_library)]
- elif self.cxx_library_root:
- library_paths += [self.cxx_library_root]
- # Configure the abi library path
- if self.abi_library_root:
- library_paths += [self.abi_library_root]
- if library_paths:
- self.env['DYLD_LIBRARY_PATH'] = ':'.join(library_paths)
+ self.target_info.configure_env(self.env)
diff --git a/test/libcxx/test/format.py b/test/libcxx/test/format.py
index 238dcdb29af7..19c9fc742a49 100644
--- a/test/libcxx/test/format.py
+++ b/test/libcxx/test/format.py
@@ -64,20 +64,24 @@ class LibcxxTestFormat(object):
return (lit.Test.UNSUPPORTED,
"A lit.local.cfg marked this unsupported")
- res = lit.TestRunner.parseIntegratedTestScript(
+ script = lit.TestRunner.parseIntegratedTestScript(
test, require_script=is_sh_test)
# Check if a result for the test was returned. If so return that
# result.
- if isinstance(res, lit.Test.Result):
- return res
+ if isinstance(script, lit.Test.Result):
+ return script
if lit_config.noExecute:
return lit.Test.Result(lit.Test.PASS)
- # res is not an instance of lit.test.Result. Expand res into its parts.
- script, tmpBase, execDir = res
+
# Check that we don't have run lines on tests that don't support them.
if not is_sh_test and len(script) != 0:
lit_config.fatal('Unsupported RUN line found in test %s' % name)
+ tmpDir, tmpBase = lit.TestRunner.getTempPaths(test)
+ substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir,
+ tmpBase)
+ script = lit.TestRunner.applySubstitutions(script, substitutions)
+
# Dispatch the test based on its suffix.
if is_sh_test:
if not isinstance(self.executor, LocalExecutor):
@@ -86,11 +90,11 @@ class LibcxxTestFormat(object):
return lit.Test.UNSUPPORTED, 'ShTest format not yet supported'
return lit.TestRunner._runShTest(test, lit_config,
self.execute_external, script,
- tmpBase, execDir)
+ tmpBase)
elif is_fail_test:
return self._evaluate_fail_test(test)
elif is_pass_test:
- return self._evaluate_pass_test(test, tmpBase, execDir, lit_config)
+ return self._evaluate_pass_test(test, tmpBase, lit_config)
else:
# No other test type is supported
assert False
@@ -98,7 +102,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, execDir, lit_config):
+ def _evaluate_pass_test(self, test, tmpBase, lit_config):
+ execDir = os.path.dirname(test.getExecPath())
source_path = test.getSourcePath()
exec_path = tmpBase + '.exe'
object_path = tmpBase + '.o'
diff --git a/test/libcxx/test/target_info.py b/test/libcxx/test/target_info.py
index a61737786896..667644d2fec6 100644
--- a/test/libcxx/test/target_info.py
+++ b/test/libcxx/test/target_info.py
@@ -1,55 +1,202 @@
+import importlib
+import lit.util # pylint: disable=import-error,no-name-in-module
import locale
+import os
import platform
import sys
-class TargetInfo(object):
+class DefaultTargetInfo(object):
+ def __init__(self, full_config):
+ self.full_config = full_config
+
def platform(self):
- raise NotImplementedError
+ return sys.platform.lower().strip()
- def system(self):
- raise NotImplementedError
+ def add_locale_features(self, features):
+ self.full_config.lit_config.warning(
+ "No locales entry for target_system: %s" % self.platform())
- def platform_ver(self):
- raise NotImplementedError
+ def add_cxx_compile_flags(self, flags): pass
+ def add_cxx_link_flags(self, flags): pass
+ def configure_env(self, env): pass
+ def allow_cxxabi_link(self): return True
+ def add_sanitizer_features(self, sanitizer_type, features): pass
+ def use_lit_shell_default(self): return False
- def platform_name(self):
- raise NotImplementedError
- def supports_locale(self, loc):
- raise NotImplementedError
+def test_locale(loc):
+ assert loc is not None
+ default_locale = locale.setlocale(locale.LC_ALL)
+ try:
+ locale.setlocale(locale.LC_ALL, loc)
+ return True
+ except locale.Error:
+ return False
+ finally:
+ locale.setlocale(locale.LC_ALL, default_locale)
-class LocalTI(TargetInfo):
- def platform(self):
- platform_name = sys.platform.lower().strip()
- # Strip the '2' from linux2.
- if platform_name.startswith('linux'):
- platform_name = 'linux'
- return platform_name
+def add_common_locales(features, lit_config):
+ # A list of locales needed by the test-suite.
+ # The list uses the canonical name for the locale used in the test-suite
+ # TODO: On Linux ISO8859 *may* needs to hyphenated.
+ locales = [
+ 'en_US.UTF-8',
+ 'fr_FR.UTF-8',
+ 'ru_RU.UTF-8',
+ 'zh_CN.UTF-8',
+ 'fr_CA.ISO8859-1',
+ 'cs_CZ.ISO8859-2'
+ ]
+ for loc in locales:
+ if test_locale(loc):
+ features.add('locale.{0}'.format(loc))
+ else:
+ lit_config.warning('The locale {0} is not supported by '
+ 'your platform. Some tests will be '
+ 'unsupported.'.format(loc))
+
+
+class DarwinLocalTI(DefaultTargetInfo):
+ def __init__(self, full_config):
+ super(DarwinLocalTI, self).__init__(full_config)
+
+ def add_locale_features(self, features):
+ add_common_locales(feature, self.full_config.lit_config)
+
+ def add_cxx_compile_flags(self, flags):
+ try:
+ out = lit.util.capture(['xcrun', '--show-sdk-path']).strip()
+ res = 0
+ except OSError:
+ res = -1
+ if res == 0 and out:
+ sdk_path = out
+ self.full_config.lit_config.note('using SDKROOT: %r' % sdk_path)
+ flags += ["-isysroot", sdk_path]
+
+ def add_cxx_link_flags(self, flags):
+ flags += ['-lSystem']
+
+ def configure_env(self, env):
+ library_paths = []
+ # Configure the library path for libc++
+ libcxx_library = self.full_config.get_lit_conf('libcxx_library')
+ if self.full_config.use_system_cxx_lib:
+ pass
+ elif libcxx_library:
+ library_paths += [os.path.dirname(libcxx_library)]
+ elif self.full_config.cxx_library_root:
+ library_paths += [self.full_config.cxx_library_root]
+ # Configure the abi library path
+ if self.full_config.abi_library_root:
+ library_paths += [self.full_config.abi_library_root]
+ if library_paths:
+ env['DYLD_LIBRARY_PATH'] = ':'.join(library_paths)
+
+ def allow_cxxabi_link(self):
+ # Don't link libc++abi explicitly on OS X because the symbols
+ # should be available in libc++ directly.
+ return False
+
+ def add_sanitizer_features(self, sanitizer_type, features):
+ if san == 'Undefined':
+ features.add('sanitizer-new-delete')
+
+
+class FreeBSDLocalTI(DefaultTargetInfo):
+ def __init__(self, full_config):
+ super(FreeBSDLocalTI, self).__init__(full_config)
- def system(self):
- return platform.system()
+ def add_locale_features(self, features):
+ add_common_locales(features, self.full_config.lit_config)
+
+ def add_cxx_link_flags(self, flags):
+ flags += ['-lc', '-lm', '-lpthread', '-lgcc_s', '-lcxxrt']
+
+
+class LinuxLocalTI(DefaultTargetInfo):
+ def __init__(self, full_config):
+ super(LinuxLocalTI, self).__init__(full_config)
+
+ def platform(self):
+ return 'linux'
def platform_name(self):
- if self.platform() == 'linux':
- name, _, _ = platform.linux_distribution()
- name = name.lower().strip()
- if name:
- return name
- return None
+ name, _, _ = platform.linux_distribution()
+ name = name.lower().strip()
+ return name # Permitted to be None
def platform_ver(self):
- if self.platform() == 'linux':
- _, ver, _ = platform.linux_distribution()
- ver = ver.lower().strip()
- if ver:
- return ver
- return None
-
- def supports_locale(self, loc):
- try:
- locale.setlocale(locale.LC_ALL, loc)
- return True
- except locale.Error:
- return False
+ _, ver, _ = platform.linux_distribution()
+ ver = ver.lower().strip()
+ return ver # Permitted to be None.
+
+ def add_locale_features(self, features):
+ add_common_locales(features, self.full_config.lit_config)
+ # Some linux distributions have different locale data than others.
+ # Insert the distributions name and name-version into the available
+ # features to allow tests to XFAIL on them.
+ name = self.platform_name()
+ ver = self.platform_ver()
+ if name:
+ features.add(name)
+ if name and ver:
+ features.add('%s-%s' % (name, ver))
+
+ def add_cxx_compile_flags(self, flags):
+ flags += ['-D__STDC_FORMAT_MACROS',
+ '-D__STDC_LIMIT_MACROS',
+ '-D__STDC_CONSTANT_MACROS']
+
+ def add_cxx_link_flags(self, flags):
+ enable_threads = ('libcpp-has-no-threads' not in
+ self.full_config.config.available_features)
+ llvm_unwinder = self.full_config.get_lit_bool('llvm_unwinder', False)
+ flags += ['-lm']
+ if not llvm_unwinder:
+ flags += ['-lgcc_s', '-lgcc']
+ if enable_threads:
+ flags += ['-lpthread']
+ flags += ['-lc']
+ if llvm_unwinder:
+ flags += ['-lunwind', '-ldl']
+ else:
+ flags += ['-lgcc_s', '-lgcc']
+ san = self.full_config.get_lit_conf('use_sanitizer', '').strip()
+ if san:
+ # The libraries and their order are taken from the
+ # linkSanitizerRuntimeDeps function in
+ # clang/lib/Driver/Tools.cpp
+ flags += ['-lpthread', '-lrt', '-lm', '-ldl']
+
+
+class WindowsLocalTI(DefaultTargetInfo):
+ def __init__(self, full_config):
+ super(WindowsLocalTI, self).__init__(full_config)
+
+ def add_locale_features(self, features):
+ add_common_locales(features, self.full_config.lit_config)
+
+ def use_lit_shell_default(self):
+ # Default to the internal shell on Windows, as bash on Windows is
+ # usually very slow.
+ return True
+
+
+def make_target_info(full_config):
+ default = "libcxx.test.target_info.LocalTI"
+ info_str = full_config.get_lit_conf('target_info', default)
+ if info_str != default:
+ mod_path, _, info = info_str.rpartition('.')
+ mod = importlib.import_module(mod_path)
+ target_info = getattr(mod, info)(full_config)
+ full_config.lit_config.note("inferred target_info as: %r" % info_str)
+ return target_info
+ target_system = platform.system()
+ if target_system == 'Darwin': return DarwinLocalTI(full_config)
+ if target_system == 'FreeBSD': return FreeBSDLocalTI(full_config)
+ if target_system == 'Linux': return LinuxLocalTI(full_config)
+ if target_system == 'Windows': return WindowsLocalTI(full_config)
+ return DefaultTargetInfo(full_config)
diff --git a/test/libcxx/test/tracing.py b/test/libcxx/test/tracing.py
index efef158160c5..766fc192f9f5 100644
--- a/test/libcxx/test/tracing.py
+++ b/test/libcxx/test/tracing.py
@@ -11,14 +11,14 @@ def trace_function(function, log_calls, log_results, label=''):
# Perform the call itself, logging before, after, and anything thrown.
try:
if log_calls:
- print '{}: Calling {}'.format(label, call_str)
+ print('{}: Calling {}'.format(label, call_str))
res = function(*args, **kwargs)
if log_results:
- print '{}: {} -> {}'.format(label, call_str, res)
+ print('{}: {} -> {}'.format(label, call_str, res))
return res
except Exception as ex:
if log_results:
- print '{}: {} raised {}'.format(label, call_str, type(ex))
+ print('{}: {} raised {}'.format(label, call_str, type(ex)))
raise ex
return wrapper
diff --git a/test/std/thread/futures/version.pass.cpp b/test/libcxx/thread/futures/version.pass.cpp
index 6730a1477db7..6730a1477db7 100644
--- a/test/std/thread/futures/version.pass.cpp
+++ b/test/libcxx/thread/futures/version.pass.cpp
diff --git a/test/libcxx/type_traits/convert_to_integral.pass.cpp b/test/libcxx/type_traits/convert_to_integral.pass.cpp
index b97832b5e6d7..3fdc98f5468f 100644
--- a/test/libcxx/type_traits/convert_to_integral.pass.cpp
+++ b/test/libcxx/type_traits/convert_to_integral.pass.cpp
@@ -1,7 +1,22 @@
-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
// TODO: Make this test pass for all standards.
// XFAIL: c++98, c++03
+// <type_traits>
+
+// __convert_to_integral(Tp)
+
+// Test that the __convert_to_integral functions properly converts Tp to the
+// correct type and value for integral, enum and user defined types.
+
#include <limits>
#include <type_traits>
#include <cstdint>
diff --git a/test/libcxx/type_traits/lazy_metafunctions.pass.cpp b/test/libcxx/type_traits/lazy_metafunctions.pass.cpp
new file mode 100644
index 000000000000..8f75080ab956
--- /dev/null
+++ b/test/libcxx/type_traits/lazy_metafunctions.pass.cpp
@@ -0,0 +1,137 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// <type_traits>
+
+// __lazy_enable_if, __lazy_not, __lazy_and and __lazy_or
+
+// Test the libc++ lazy meta-programming helpers in <type_traits>
+
+#include <type_traits>
+
+template <class Type>
+struct Identity {
+ typedef Type type;
+};
+
+typedef std::true_type TrueT;
+typedef std::false_type FalseT;
+
+typedef Identity<TrueT> LazyTrueT;
+typedef Identity<FalseT> LazyFalseT;
+
+// A type that cannot be instantiated
+template <class T>
+struct CannotInst {
+ typedef T type;
+ static_assert(std::is_same<T, T>::value == false, "");
+};
+
+
+template <int Value>
+struct NextInt {
+ typedef NextInt<Value + 1> type;
+ static const int value = Value;
+};
+
+template <int Value>
+const int NextInt<Value>::value;
+
+
+template <class Type>
+struct HasTypeImp {
+ template <class Up, class = typename Up::type>
+ static TrueT test(int);
+ template <class>
+ static FalseT test(...);
+
+ typedef decltype(test<Type>(0)) type;
+};
+
+// A metafunction that returns True if Type has a nested 'type' typedef
+// and false otherwise.
+template <class Type>
+struct HasType : HasTypeImp<Type>::type {};
+
+void LazyEnableIfTest() {
+ {
+ typedef std::__lazy_enable_if<true, NextInt<0> > Result;
+ static_assert(HasType<Result>::value, "");
+ static_assert(Result::type::value == 1, "");
+ }
+ {
+ typedef std::__lazy_enable_if<false, CannotInst<int> > Result;
+ static_assert(!HasType<Result>::value, "");
+ }
+}
+
+void LazyNotTest() {
+ {
+ typedef std::__lazy_not<LazyTrueT> NotT;
+ static_assert(std::is_same<typename NotT::type, FalseT>::value, "");
+ static_assert(NotT::value == false, "");
+ }
+ {
+ typedef std::__lazy_not<LazyFalseT> NotT;
+ static_assert(std::is_same<typename NotT::type, TrueT>::value, "");
+ static_assert(NotT::value == true, "");
+ }
+ {
+ // Check that CannotInst<int> is not instantiated.
+ typedef std::__lazy_not<CannotInst<int> > NotT;
+
+ static_assert(std::is_same<NotT, NotT>::value, "");
+
+ }
+}
+
+void LazyAndTest() {
+ { // Test that it acts as the identity function for a single value
+ static_assert(std::__lazy_and<LazyFalseT>::value == false, "");
+ static_assert(std::__lazy_and<LazyTrueT>::value == true, "");
+ }
+ {
+ static_assert(std::__lazy_and<LazyTrueT, LazyTrueT>::value == true, "");
+ static_assert(std::__lazy_and<LazyTrueT, LazyFalseT>::value == false, "");
+ static_assert(std::__lazy_and<LazyFalseT, LazyTrueT>::value == false, "");
+ static_assert(std::__lazy_and<LazyFalseT, LazyFalseT>::value == false, "");
+ }
+ { // Test short circuiting - CannotInst<T> should never be instantiated.
+ static_assert(std::__lazy_and<LazyFalseT, CannotInst<int>>::value == false, "");
+ static_assert(std::__lazy_and<LazyTrueT, LazyFalseT, CannotInst<int>>::value == false, "");
+ }
+}
+
+
+void LazyOrTest() {
+ { // Test that it acts as the identity function for a single value
+ static_assert(std::__lazy_or<LazyFalseT>::value == false, "");
+ static_assert(std::__lazy_or<LazyTrueT>::value == true, "");
+ }
+ {
+ static_assert(std::__lazy_or<LazyTrueT, LazyTrueT>::value == true, "");
+ static_assert(std::__lazy_or<LazyTrueT, LazyFalseT>::value == true, "");
+ static_assert(std::__lazy_or<LazyFalseT, LazyTrueT>::value == true, "");
+ static_assert(std::__lazy_or<LazyFalseT, LazyFalseT>::value == false, "");
+ }
+ { // Test short circuiting - CannotInst<T> should never be instantiated.
+ static_assert(std::__lazy_or<LazyTrueT, CannotInst<int>>::value == true, "");
+ static_assert(std::__lazy_or<LazyFalseT, LazyTrueT, CannotInst<int>>::value == true, "");
+ }
+}
+
+
+int main() {
+ LazyEnableIfTest();
+ LazyNotTest();
+ LazyAndTest();
+ LazyOrTest();
+} \ No newline at end of file
diff --git a/test/libcxx/utilities/memory/util.smartptr/race_condition.pass.cpp b/test/libcxx/utilities/memory/util.smartptr/race_condition.pass.cpp
index 25dd31190685..fce8443ebd0c 100644
--- a/test/libcxx/utilities/memory/util.smartptr/race_condition.pass.cpp
+++ b/test/libcxx/utilities/memory/util.smartptr/race_condition.pass.cpp
@@ -87,7 +87,8 @@ int main() {
}
{
// Test with in-place shared_count.
- Ptr p = std::make_shared<int>(42);
+ int val = 42;
+ Ptr p = std::make_shared<int>(val);
run_test(p);
assert(p.use_count() == 1);
}
diff --git a/test/std/utilities/date.time/asctime.thread-unsafe.fail.cpp b/test/libcxx/utilities/time/date.time/asctime.thread-unsafe.fail.cpp
index 3a9749e21c52..3a9749e21c52 100644
--- a/test/std/utilities/date.time/asctime.thread-unsafe.fail.cpp
+++ b/test/libcxx/utilities/time/date.time/asctime.thread-unsafe.fail.cpp
diff --git a/test/std/utilities/date.time/ctime.thread-unsafe.fail.cpp b/test/libcxx/utilities/time/date.time/ctime.thread-unsafe.fail.cpp
index cd246c631527..cd246c631527 100644
--- a/test/std/utilities/date.time/ctime.thread-unsafe.fail.cpp
+++ b/test/libcxx/utilities/time/date.time/ctime.thread-unsafe.fail.cpp
diff --git a/test/std/utilities/date.time/gmtime.thread-unsafe.fail.cpp b/test/libcxx/utilities/time/date.time/gmtime.thread-unsafe.fail.cpp
index a6debcbd98d8..a6debcbd98d8 100644
--- a/test/std/utilities/date.time/gmtime.thread-unsafe.fail.cpp
+++ b/test/libcxx/utilities/time/date.time/gmtime.thread-unsafe.fail.cpp
diff --git a/test/std/utilities/date.time/localtime.thread-unsafe.fail.cpp b/test/libcxx/utilities/time/date.time/localtime.thread-unsafe.fail.cpp
index c9e55c8fd3a6..c9e55c8fd3a6 100644
--- a/test/std/utilities/date.time/localtime.thread-unsafe.fail.cpp
+++ b/test/libcxx/utilities/time/date.time/localtime.thread-unsafe.fail.cpp
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index 17f0686add6e..fa25834d1110 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -1,6 +1,6 @@
@AUTO_GEN_COMMENT@
config.cxx_under_test = "@LIBCXX_COMPILER@"
-config.std = "@LIBCXX_STD_VERSION@"
+config.project_obj_root = "@CMAKE_BINARY_DIR@"
config.libcxx_src_root = "@LIBCXX_SOURCE_DIR@"
config.libcxx_obj_root = "@LIBCXX_BINARY_DIR@"
config.cxx_library_root = "@LIBCXX_LIBRARY_DIR@"
@@ -8,14 +8,9 @@ config.enable_exceptions = "@LIBCXX_ENABLE_EXCEPTIONS@"
config.enable_rtti = "@LIBCXX_ENABLE_RTTI@"
config.enable_shared = "@LIBCXX_ENABLE_SHARED@"
config.enable_32bit = "@LIBCXX_BUILD_32_BITS@"
-config.enable_global_filesystem_namespace = "@LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE@"
-config.enable_stdin = "@LIBCXX_ENABLE_STDIN@"
-config.enable_stdout = "@LIBCXX_ENABLE_STDOUT@"
-config.enable_threads = "@LIBCXX_ENABLE_THREADS@"
-config.enable_thread_unsafe_c_functions = "@LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS@"
-config.enable_monotonic_clock = "@LIBCXX_ENABLE_MONOTONIC_CLOCK@"
config.cxx_abi = "@LIBCXX_CXX_ABI_LIBNAME@"
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@"
diff --git a/test/std/algorithms/alg.modifying.operations/alg.partitions/stable_partition.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/stable_partition.pass.cpp
index 7810dec2fe1b..cf23c7743996 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.partitions/stable_partition.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.partitions/stable_partition.pass.cpp
@@ -17,10 +17,9 @@
#include <algorithm>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
+#include "test_macros.h"
#include "test_iterators.h"
struct is_odd
@@ -283,7 +282,7 @@ test()
}
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
struct is_null
{
@@ -298,9 +297,10 @@ test1()
const unsigned size = 5;
std::unique_ptr<int> array[size];
Iter r = std::stable_partition(Iter(array), Iter(array+size), is_null());
+ assert(r == Iter(array+size));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
int main()
{
@@ -308,7 +308,7 @@ int main()
test<random_access_iterator<std::pair<int,int>*> >();
test<std::pair<int,int>*>();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test1<bidirectional_iterator<std::unique_ptr<int>*> >();
#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp
index abc89dc56097..eb37ccac5779 100644
--- a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp
@@ -17,18 +17,16 @@
#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()
{
int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
int ib[] = {0, 1, 2, 3, 0, 1, 2, 3};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]); ((void)sb); // unused in c++11
typedef input_iterator<const int*> II;
typedef random_access_iterator<const int*> RAI;
@@ -39,7 +37,7 @@ int main()
assert(std::mismatch(RAI(ia), RAI(ia + sa), RAI(ib))
== (std::pair<RAI, RAI>(RAI(ia+3), RAI(ib+3))));
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER > 11 // We have the four iteration version
assert(std::mismatch(II(ia), II(ia + sa), II(ib), II(ib+sb))
== (std::pair<II, II>(II(ia+3), II(ib+3))));
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 8d85d993cd61..3e1dfd17c3ff 100644
--- a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp
@@ -19,10 +19,11 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "counting_predicates.hpp"
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
#define HAS_FOUR_ITERATOR_VERSION
#endif
@@ -31,7 +32,7 @@ int main()
int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
int ib[] = {0, 1, 2, 3, 0, 1, 2, 3};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ const unsigned sb = sizeof(ib)/sizeof(ib[0]); ((void)sb); // unused in c++11
typedef input_iterator<const int*> II;
typedef random_access_iterator<const int*> RAI;
diff --git a/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp b/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp
index 8db8177fb9c8..70abd1809753 100644
--- a/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp
@@ -29,9 +29,9 @@ test()
int ib[] = {2, 4};
const unsigned sb = sizeof(ib)/sizeof(ib[0]);
int ic[] = {1, 2};
- const unsigned sc = sizeof(ic)/sizeof(ic[0]);
+ const unsigned sc = sizeof(ic)/sizeof(ic[0]); ((void)sc);
int id[] = {3, 3, 3, 3};
- const unsigned sd = sizeof(id)/sizeof(id[0]);
+ const unsigned sd = sizeof(id)/sizeof(id[0]); ((void)sd);
assert(std::includes(Iter1(ia), Iter1(ia), Iter2(ib), Iter2(ib)));
assert(!std::includes(Iter1(ia), Iter1(ia), Iter2(ib), Iter2(ib+1)));
diff --git a/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp
index 7e1aef4749a5..299dc893560f 100644
--- a/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp
@@ -30,9 +30,9 @@ test()
int ib[] = {2, 4};
const unsigned sb = sizeof(ib)/sizeof(ib[0]);
int ic[] = {1, 2};
- const unsigned sc = sizeof(ic)/sizeof(ic[0]);
+ const unsigned sc = sizeof(ic)/sizeof(ic[0]); ((void)sc);
int id[] = {3, 3, 3, 3};
- const unsigned sd = sizeof(id)/sizeof(id[0]);
+ const unsigned sd = sizeof(id)/sizeof(id[0]); ((void)sd);
assert(std::includes(Iter1(ia), Iter1(ia), Iter2(ib), Iter2(ib), std::less<int>()));
assert(!std::includes(Iter1(ia), Iter1(ia), Iter2(ib), Iter2(ib+1), std::less<int>()));
diff --git a/test/std/atomics/atomics.flag/atomic_flag_clear.pass.cpp b/test/std/atomics/atomics.flag/atomic_flag_clear.pass.cpp
index 8a60f8196dab..3a74e13faf19 100644
--- a/test/std/atomics/atomics.flag/atomic_flag_clear.pass.cpp
+++ b/test/std/atomics/atomics.flag/atomic_flag_clear.pass.cpp
@@ -22,13 +22,13 @@
int main()
{
{
- std::atomic_flag f = ATOMIC_FLAG_INIT;
+ std::atomic_flag f(false);
f.test_and_set();
atomic_flag_clear(&f);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
+ volatile std::atomic_flag f(false);
f.test_and_set();
atomic_flag_clear(&f);
assert(f.test_and_set() == 0);
diff --git a/test/std/atomics/atomics.flag/atomic_flag_clear_explicit.pass.cpp b/test/std/atomics/atomics.flag/atomic_flag_clear_explicit.pass.cpp
index 92e57ecc03f8..0467384455cc 100644
--- a/test/std/atomics/atomics.flag/atomic_flag_clear_explicit.pass.cpp
+++ b/test/std/atomics/atomics.flag/atomic_flag_clear_explicit.pass.cpp
@@ -22,37 +22,37 @@
int main()
{
{
- std::atomic_flag f = ATOMIC_FLAG_INIT;
+ std::atomic_flag f(false);
f.test_and_set();
atomic_flag_clear_explicit(&f, std::memory_order_relaxed);
assert(f.test_and_set() == 0);
}
{
- std::atomic_flag f = ATOMIC_FLAG_INIT;
+ std::atomic_flag f(false);
f.test_and_set();
atomic_flag_clear_explicit(&f, std::memory_order_release);
assert(f.test_and_set() == 0);
}
{
- std::atomic_flag f = ATOMIC_FLAG_INIT;
+ std::atomic_flag f(false);
f.test_and_set();
atomic_flag_clear_explicit(&f, std::memory_order_seq_cst);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
+ volatile std::atomic_flag f(false);
f.test_and_set();
atomic_flag_clear_explicit(&f, std::memory_order_relaxed);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
+ volatile std::atomic_flag f(false);
f.test_and_set();
atomic_flag_clear_explicit(&f, std::memory_order_release);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
+ volatile std::atomic_flag f(false);
f.test_and_set();
atomic_flag_clear_explicit(&f, std::memory_order_seq_cst);
assert(f.test_and_set() == 0);
diff --git a/test/std/atomics/atomics.flag/clear.pass.cpp b/test/std/atomics/atomics.flag/clear.pass.cpp
index 7c9362680bba..ea5ae45ae99a 100644
--- a/test/std/atomics/atomics.flag/clear.pass.cpp
+++ b/test/std/atomics/atomics.flag/clear.pass.cpp
@@ -22,49 +22,49 @@
int main()
{
{
- std::atomic_flag f = ATOMIC_FLAG_INIT;
+ std::atomic_flag f(false);
f.test_and_set();
f.clear();
assert(f.test_and_set() == 0);
}
{
- std::atomic_flag f = ATOMIC_FLAG_INIT;
+ std::atomic_flag f(false);
f.test_and_set();
f.clear(std::memory_order_relaxed);
assert(f.test_and_set() == 0);
}
{
- std::atomic_flag f = ATOMIC_FLAG_INIT;
+ std::atomic_flag f(false);
f.test_and_set();
f.clear(std::memory_order_release);
assert(f.test_and_set() == 0);
}
{
- std::atomic_flag f = ATOMIC_FLAG_INIT;
+ std::atomic_flag f(false);
f.test_and_set();
f.clear(std::memory_order_seq_cst);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
+ volatile std::atomic_flag f(false);
f.test_and_set();
f.clear();
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
+ volatile std::atomic_flag f(false);
f.test_and_set();
f.clear(std::memory_order_relaxed);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
+ volatile std::atomic_flag f(false);
f.test_and_set();
f.clear(std::memory_order_release);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
+ volatile std::atomic_flag f(false);
f.test_and_set();
f.clear(std::memory_order_seq_cst);
assert(f.test_and_set() == 0);
diff --git a/test/std/atomics/atomics.flag/default.pass.cpp b/test/std/atomics/atomics.flag/default.pass.cpp
index 45f5e709245b..11c08f50266a 100644
--- a/test/std/atomics/atomics.flag/default.pass.cpp
+++ b/test/std/atomics/atomics.flag/default.pass.cpp
@@ -22,7 +22,8 @@
int main()
{
std::atomic_flag f;
-
+ f.clear();
+ assert(f.test_and_set() == 0);
{
typedef std::atomic_flag A;
_ALIGNAS_TYPE(A) char storage[sizeof(A)] = {1};
diff --git a/test/std/atomics/atomics.flag/init.pass.cpp b/test/std/atomics/atomics.flag/init.pass.cpp
index c90509d8fbb5..c4a121b094a4 100644
--- a/test/std/atomics/atomics.flag/init.pass.cpp
+++ b/test/std/atomics/atomics.flag/init.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// XFAIL: c++98, c++03
// <atomic>
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/no-variadics.pass.cpp b/test/std/atomics/atomics.flag/init03.pass.cpp
index 7099c45fab81..0910bc5ceccb 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/no-variadics.pass.cpp
+++ b/test/std/atomics/atomics.flag/init03.pass.cpp
@@ -6,19 +6,20 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: libcpp-has-no-threads
-// <functional>
+// <atomic>
-// class function<R()>
+// struct atomic_flag
-// template<class F> function(F);
+// TESTING EXTENSION atomic_flag(bool)
-#define _LIBCPP_HAS_NO_VARIADICS
-#include <functional>
+#include <atomic>
#include <cassert>
int main()
{
- std::function<void()> f(static_cast<void(*)()>(0));
- assert(!f);
+ std::atomic_flag f(false);
+ assert(f.test_and_set() == 0);
}
diff --git a/test/std/atomics/atomics.types.generic/address.pass.cpp b/test/std/atomics/atomics.types.generic/address.pass.cpp
index 3b9f3ce76cad..eceac25c9d94 100644
--- a/test/std/atomics/atomics.types.generic/address.pass.cpp
+++ b/test/std/atomics/atomics.types.generic/address.pass.cpp
@@ -81,12 +81,13 @@ do_test()
{
typedef typename std::remove_pointer<T>::type X;
A obj(T(0));
+ bool b0 = obj.is_lock_free();
+ ((void)b0); // mark as unused
assert(obj == T(0));
std::atomic_init(&obj, T(1));
assert(obj == T(1));
std::atomic_init(&obj, T(2));
assert(obj == T(2));
- bool b0 = obj.is_lock_free();
obj.store(T(0));
assert(obj == T(0));
obj.store(T(1), std::memory_order_release);
diff --git a/test/std/atomics/atomics.types.generic/bool.pass.cpp b/test/std/atomics/atomics.types.generic/bool.pass.cpp
index dd851e86530c..8eb04ee577cf 100644
--- a/test/std/atomics/atomics.types.generic/bool.pass.cpp
+++ b/test/std/atomics/atomics.types.generic/bool.pass.cpp
@@ -60,7 +60,6 @@
int main()
{
{
- volatile std::atomic<bool> _;
volatile std::atomic<bool> obj(true);
assert(obj == true);
std::atomic_init(&obj, false);
@@ -116,7 +115,6 @@ int main()
assert(obj == true);
}
{
- std::atomic<bool> _;
std::atomic<bool> obj(true);
assert(obj == true);
std::atomic_init(&obj, false);
@@ -172,7 +170,6 @@ int main()
assert(obj == true);
}
{
- std::atomic_bool _;
std::atomic_bool obj(true);
assert(obj == true);
std::atomic_init(&obj, false);
diff --git a/test/std/atomics/atomics.types.generic/integral.pass.cpp b/test/std/atomics/atomics.types.generic/integral.pass.cpp
index f9c758336099..802a37c30a93 100644
--- a/test/std/atomics/atomics.types.generic/integral.pass.cpp
+++ b/test/std/atomics/atomics.types.generic/integral.pass.cpp
@@ -103,6 +103,7 @@ do_test()
std::atomic_init(&obj, T(2));
assert(obj == T(2));
bool b0 = obj.is_lock_free();
+ ((void)b0); // mark as unused
obj.store(T(0));
assert(obj == T(0));
obj.store(T(1), std::memory_order_release);
diff --git a/test/std/atomics/atomics.types.generic/trivially_copyable.fail.cpp b/test/std/atomics/atomics.types.generic/trivially_copyable.fail.cpp
index f2bf4db0de48..d940980e32f0 100644
--- a/test/std/atomics/atomics.types.generic/trivially_copyable.fail.cpp
+++ b/test/std/atomics/atomics.types.generic/trivially_copyable.fail.cpp
@@ -57,12 +57,12 @@ struct NotTriviallyCopyable {
NotTriviallyCopyable ( int i ) : i_(i) {}
NotTriviallyCopyable ( const NotTriviallyCopyable &rhs) : i_(rhs.i_) {}
int i_;
- };
+};
-template <class T>
+template <class T, class >
void test ( T t ) {
std::atomic<T> t0(t);
- }
+}
int main()
{
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp
index f1cc993ed33e..7b221dc6eff8 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp
@@ -24,10 +24,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A a;
@@ -52,37 +53,10 @@ test()
assert(a == T(2));
assert(t == T(2));
}
-}
-
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
+ }
};
int main()
{
- test<A>();
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<int*>();
- test<const int*>();
+ TestEachAtomicType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp
index f667ab7f139b..27de5bec4928 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp
@@ -27,10 +27,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A a;
@@ -59,37 +60,10 @@ test()
assert(a == T(2));
assert(t == T(2));
}
-}
-
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
+ }
};
int main()
{
- test<A>();
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<int*>();
- test<const int*>();
+ TestEachAtomicType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp
index 175c445d4560..8c12715647e8 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp
@@ -25,11 +25,11 @@
#include <cassert>
#include <cmpxchg_loop.h>
+#include "atomic_helpers.h"
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A a;
@@ -54,37 +54,10 @@ test()
assert(a == T(2));
assert(t == T(2));
}
-}
-
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
+ }
};
int main()
{
- test<A>();
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<int*>();
- test<const int*>();
+ TestEachAtomicType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp
index 46f80bfbcb7b..90a93f02b978 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp
@@ -29,10 +29,11 @@
#include <cmpxchg_loop.h>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A a;
@@ -61,37 +62,10 @@ test()
assert(a == T(2));
assert(t == T(2));
}
-}
-
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
+ }
};
int main()
{
- test<A>();
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<int*>();
- test<const int*>();
+ TestEachAtomicType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp
index 525e74aa6374..035d974427a4 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp
@@ -24,10 +24,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
typedef std::atomic<T> A;
A t;
std::atomic_init(&t, T(1));
@@ -37,37 +38,11 @@ test()
std::atomic_init(&vt, T(3));
assert(std::atomic_exchange(&vt, T(4)) == T(3));
assert(vt == T(4));
-}
-
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
+ }
};
+
int main()
{
- test<A>();
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<int*>();
- test<const int*>();
+ TestEachAtomicType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp
index 9fe4ac816448..4d66bb5f3b81 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp
@@ -24,10 +24,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
typedef std::atomic<T> A;
A t;
std::atomic_init(&t, T(1));
@@ -39,37 +40,11 @@ test()
assert(std::atomic_exchange_explicit(&vt, T(4), std::memory_order_seq_cst)
== T(3));
assert(vt == T(4));
-}
-
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
+ }
};
+
int main()
{
- test<A>();
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<int*>();
- test<const int*>();
+ TestEachAtomicType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp
index 3408def9058a..48ff601539cf 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.pass.cpp
@@ -32,10 +32,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A t;
@@ -50,11 +51,11 @@ test()
assert(std::atomic_fetch_add(&t, T(2)) == T(1));
assert(t == T(3));
}
-}
+ }
+};
template <class T>
-void
-testp()
+void testp()
{
{
typedef std::atomic<T> A;
@@ -74,38 +75,9 @@ testp()
}
}
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
- A(const A& a) : i(a.i) {}
- A(const volatile A& a) : i(a.i) {}
-
- void operator=(const volatile A& a) volatile {i = a.i;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
-};
-
int main()
{
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+ TestEachIntegralType<TestFn>()();
testp<int*>();
testp<const int*>();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp
index 9977bd491e7a..2dc90c9aca68 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp
@@ -32,10 +32,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A t;
@@ -52,7 +53,8 @@ test()
std::memory_order_seq_cst) == T(1));
assert(t == T(3));
}
-}
+ }
+};
template <class T>
void
@@ -78,38 +80,9 @@ testp()
}
}
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
- A(const A& a) : i(a.i) {}
- A(const volatile A& a) : i(a.i) {}
-
- void operator=(const volatile A& a) volatile {i = a.i;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
-};
-
int main()
{
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+ TestEachIntegralType<TestFn>()();
testp<int*>();
testp<const int*>();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp
index 4c7c0432efc9..57355d30411e 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and.pass.cpp
@@ -23,10 +23,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A t;
@@ -41,24 +42,10 @@ test()
assert(std::atomic_fetch_and(&t, T(2)) == T(3));
assert(t == T(2));
}
-}
+ }
+};
int main()
{
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+ TestEachIntegralType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp
index d83bbf264de5..26ff5f65e7db 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp
@@ -23,10 +23,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A t;
@@ -43,24 +44,10 @@ test()
std::memory_order_seq_cst) == T(3));
assert(t == T(2));
}
-}
+ }
+};
int main()
{
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+ TestEachIntegralType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp
index acf6d439de43..ca44fdc3217d 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or.pass.cpp
@@ -23,10 +23,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A t;
@@ -41,24 +42,10 @@ test()
assert(std::atomic_fetch_or(&t, T(2)) == T(3));
assert(t == T(3));
}
-}
+ }
+};
int main()
{
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+ TestEachIntegralType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp
index 72685e4d9408..72bbde798cb9 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_or_explicit.pass.cpp
@@ -23,10 +23,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A t;
@@ -43,24 +44,10 @@ test()
std::memory_order_seq_cst) == T(3));
assert(t == T(3));
}
-}
+ }
+};
int main()
{
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+ TestEachIntegralType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp
index ed8b541291af..2743040428c5 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.pass.cpp
@@ -32,10 +32,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A t;
@@ -50,11 +51,11 @@ test()
assert(std::atomic_fetch_sub(&t, T(2)) == T(3));
assert(t == T(1));
}
-}
+ }
+};
template <class T>
-void
-testp()
+void testp()
{
{
typedef std::atomic<T> A;
@@ -74,38 +75,9 @@ testp()
}
}
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
- A(const A& a) : i(a.i) {}
- A(const volatile A& a) : i(a.i) {}
-
- void operator=(const volatile A& a) volatile {i = a.i;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
-};
-
int main()
{
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+ TestEachIntegralType<TestFn>()();
testp<int*>();
testp<const int*>();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp
index e6c92eada6df..6e94c505fd8c 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.pass.cpp
@@ -33,10 +33,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A t;
@@ -53,11 +54,11 @@ test()
std::memory_order_seq_cst) == T(3));
assert(t == T(1));
}
-}
+ }
+};
template <class T>
-void
-testp()
+void testp()
{
{
typedef std::atomic<T> A;
@@ -79,38 +80,9 @@ testp()
}
}
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
- A(const A& a) : i(a.i) {}
- A(const volatile A& a) : i(a.i) {}
-
- void operator=(const volatile A& a) volatile {i = a.i;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
-};
-
int main()
{
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+ TestEachIntegralType<TestFn>()();
testp<int*>();
testp<const int*>();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp
index fc6b97b7db45..42d57dedbd11 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor.pass.cpp
@@ -23,10 +23,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A t;
@@ -41,24 +42,10 @@ test()
assert(std::atomic_fetch_xor(&t, T(2)) == T(3));
assert(t == T(1));
}
-}
+ }
+};
int main()
{
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+ TestEachIntegralType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp
index 58772aa4d152..8f388fee6325 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_xor_explicit.pass.cpp
@@ -23,10 +23,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A t;
@@ -43,24 +44,10 @@ test()
std::memory_order_seq_cst) == T(3));
assert(t == T(1));
}
-}
+ }
+};
int main()
{
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+ TestEachIntegralType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_helpers.h b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_helpers.h
new file mode 100644
index 000000000000..e31420b156c6
--- /dev/null
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_helpers.h
@@ -0,0 +1,51 @@
+#ifndef ATOMIC_HELPERS_H
+#define ATOMIC_HELPERS_H
+
+#include <cassert>
+
+#include "test_macros.h"
+
+struct UserAtomicType
+{
+ int i;
+
+ explicit UserAtomicType(int d = 0) TEST_NOEXCEPT : i(d) {}
+
+ friend bool operator==(const UserAtomicType& x, const UserAtomicType& y)
+ { return x.i == y.i; }
+};
+
+template < template <class TestArg> class TestFunctor >
+struct TestEachIntegralType {
+ void operator()() const {
+ TestFunctor<char>()();
+ TestFunctor<signed char>()();
+ TestFunctor<unsigned char>()();
+ TestFunctor<short>()();
+ TestFunctor<unsigned short>()();
+ TestFunctor<int>()();
+ TestFunctor<unsigned int>()();
+ TestFunctor<long>()();
+ TestFunctor<unsigned long>()();
+ TestFunctor<long long>()();
+ TestFunctor<unsigned long long>()();
+ TestFunctor<wchar_t>();
+#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+ TestFunctor<char16_t>()();
+ TestFunctor<char32_t>()();
+#endif
+ }
+};
+
+template < template <class TestArg> class TestFunctor >
+struct TestEachAtomicType {
+ void operator()() const {
+ TestEachIntegralType<TestFunctor>()();
+ TestFunctor<UserAtomicType>()();
+ TestFunctor<int*>()();
+ TestFunctor<const int*>()();
+ }
+};
+
+
+#endif // ATOMIC_HELPER_H
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp
index 137b6f60f746..884c02dfe7ea 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
-// ... assertion fails line 34
+// ... assertion fails line 36
// <atomic>
@@ -24,10 +24,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
typedef std::atomic<T> A;
A t;
std::atomic_init(&t, T(1));
@@ -35,37 +36,10 @@ test()
volatile A vt;
std::atomic_init(&vt, T(2));
assert(vt == T(2));
-}
-
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
+ }
};
int main()
{
- test<A>();
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<int*>();
- test<const int*>();
+ TestEachAtomicType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp
index 18a1605e2092..5d50016ed32c 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp
@@ -20,17 +20,21 @@
// atomic_is_lock_free(const atomic<T>* obj);
#include <atomic>
+#include <cassert>
+
+#include "atomic_helpers.h"
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
typedef std::atomic<T> A;
A t;
bool b1 = std::atomic_is_lock_free(static_cast<const A*>(&t));
volatile A vt;
bool b2 = std::atomic_is_lock_free(static_cast<const volatile A*>(&vt));
-}
+ assert(b1 == b2);
+ }
+};
struct A
{
@@ -39,23 +43,6 @@ struct A
int main()
{
- test<A>();
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<int*>();
- test<const int*>();
+ TestFn<A>()();
+ TestEachAtomicType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp
index 66918c71f1f6..e7b8e64b434f 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
-// ... assertion fails line 34
+// ... assertion fails line 35
// <atomic>
@@ -24,10 +24,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
typedef std::atomic<T> A;
A t;
std::atomic_init(&t, T(1));
@@ -35,37 +36,10 @@ test()
volatile A vt;
std::atomic_init(&vt, T(2));
assert(std::atomic_load(&vt) == T(2));
-}
-
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
+ }
};
int main()
{
- test<A>();
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<int*>();
- test<const int*>();
+ TestEachAtomicType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp
index 5f402a9f139f..56533fa871e5 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp
@@ -24,10 +24,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
typedef std::atomic<T> A;
A t;
std::atomic_init(&t, T(1));
@@ -35,37 +36,10 @@ test()
volatile A vt;
std::atomic_init(&vt, T(2));
assert(std::atomic_load_explicit(&vt, std::memory_order_seq_cst) == T(2));
-}
-
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
+ }
};
int main()
{
- test<A>();
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<int*>();
- test<const int*>();
+ TestEachAtomicType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp
index 2b9582b3c522..e61dae904116 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
-// ... assertion fails line 31
// <atomic>
@@ -24,10 +23,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
typedef std::atomic<T> A;
A t;
std::atomic_store(&t, T(1));
@@ -35,37 +35,11 @@ test()
volatile A vt;
std::atomic_store(&vt, T(2));
assert(vt == T(2));
-}
-
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
+ }
};
+
int main()
{
- test<A>();
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<int*>();
- test<const int*>();
+ TestEachAtomicType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp
index 8fe0c7d88421..e57cf8b1b323 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
-// ... assertion fails line 31
// <atomic>
@@ -24,10 +23,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
typedef std::atomic<T> A;
A t;
std::atomic_store_explicit(&t, T(1), std::memory_order_seq_cst);
@@ -35,37 +35,11 @@ test()
volatile A vt;
std::atomic_store_explicit(&vt, T(2), std::memory_order_seq_cst);
assert(vt == T(2));
-}
-
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
+ }
};
+
int main()
{
- test<A>();
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
- test<int*>();
- test<const int*>();
+ TestEachAtomicType<TestFn>()();
}
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_var_init.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_var_init.pass.cpp
index 5fed691da268..9f25807fbcde 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_var_init.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_var_init.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// XFAIL: c++98, c++03
// <atomic>
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp
index 0eda2338d257..f6944c7255bc 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp
@@ -10,6 +10,10 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
+// NOTE: atomic<> of a TriviallyCopyable class is wrongly rejected by older
+// clang versions. It was fixed right before the llvm 3.5 release. See PR18097.
+// XFAIL: apple-clang-6.0, clang-3.4, clang-3.3
+
// <atomic>
// constexpr atomic<T>::atomic(T value)
@@ -18,6 +22,8 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
struct UserType {
int i;
@@ -30,27 +36,29 @@ struct UserType {
};
template <class Tp>
-void test() {
- typedef std::atomic<Tp> Atomic;
- static_assert(std::is_literal_type<Atomic>::value, "");
- constexpr Tp t(42);
- {
- constexpr Atomic a(t);
- assert(a == t);
- }
- {
- constexpr Atomic a{t};
- assert(a == t);
+struct TestFunc {
+ void operator()() const {
+ typedef std::atomic<Tp> Atomic;
+ static_assert(std::is_literal_type<Atomic>::value, "");
+ constexpr Tp t(42);
+ {
+ constexpr Atomic a(t);
+ assert(a == t);
+ }
+ {
+ constexpr Atomic a{t};
+ assert(a == t);
+ }
+ {
+ constexpr Atomic a = ATOMIC_VAR_INIT(t);
+ assert(a == t);
+ }
}
- {
- constexpr Atomic a = ATOMIC_VAR_INIT(t);
- assert(a == t);
- }
-}
+};
int main()
{
- test<int>();
- test<UserType>();
+ TestFunc<UserType>()();
+ TestEachIntegralType<TestFunc>()();
}
diff --git a/test/std/containers/associative/map/allocator_mismatch.fail.cpp b/test/std/containers/associative/map/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..f5da14539c47
--- /dev/null
+++ b/test/std/containers/associative/map/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <map>
+// The container's value type must be the same as the allocator's value type
+
+#include <map>
+
+int main()
+{
+ std::map<int, int, std::less<int>, std::allocator<long> > m;
+}
diff --git a/test/std/containers/associative/map/compare.pass.cpp b/test/std/containers/associative/map/compare.pass.cpp
index aa4d5999ff46..26ac7af7d908 100644
--- a/test/std/containers/associative/map/compare.pass.cpp
+++ b/test/std/containers/associative/map/compare.pass.cpp
@@ -17,16 +17,36 @@
// http://llvm.org/bugs/show_bug.cgi?id=16549
#include <map>
+#include <utility>
+#include <cassert>
struct Key {
template <typename T> Key(const T&) {}
bool operator< (const Key&) const { return false; }
};
-int
-main()
+int main()
{
- std::map<Key, int>::iterator it = std::map<Key, int>().find(Key(0));
- std::pair<std::map<Key, int>::iterator, bool> result =
- std::map<Key, int>().insert(std::make_pair(Key(0), 0));
+ typedef std::map<Key, int> MapT;
+ typedef MapT::iterator Iter;
+ typedef std::pair<Iter, bool> IterBool;
+ {
+ MapT m_empty;
+ MapT m_contains;
+ m_contains[Key(0)] = 42;
+
+ Iter it = m_empty.find(Key(0));
+ assert(it == m_empty.end());
+ it = m_contains.find(Key(0));
+ assert(it != m_contains.end());
+ }
+ {
+ MapT map;
+ IterBool result = map.insert(std::make_pair(Key(0), 42));
+ assert(result.second);
+ assert(result.first->second = 42);
+ IterBool result2 = map.insert(std::make_pair(Key(0), 43));
+ assert(!result2.second);
+ assert(map[Key(0)] == 42);
+ }
}
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 86b1e3d2dfa6..0da28507fce3 100644
--- a/test/std/containers/associative/map/map.access/at.pass.cpp
+++ b/test/std/containers/associative/map/map.access/at.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <map>
// class map
diff --git a/test/std/containers/associative/map/map.access/index_rv_key.pass.cpp b/test/std/containers/associative/map/map.access/index_rv_key.pass.cpp
index d14603e1a281..6511dcc85f53 100644
--- a/test/std/containers/associative/map/map.access/index_rv_key.pass.cpp
+++ b/test/std/containers/associative/map/map.access/index_rv_key.pass.cpp
@@ -16,14 +16,14 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "min_allocator.h"
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
- typedef std::pair<MoveOnly, double> V;
std::map<MoveOnly, double> m;
assert(m.size() == 0);
assert(m[1] == 0.0);
@@ -37,10 +37,8 @@ int main()
assert(m[6] == 6.5);
assert(m.size() == 2);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if __cplusplus >= 201103L
{
- typedef std::pair<MoveOnly, double> V;
+ typedef std::pair<const MoveOnly, double> V;
std::map<MoveOnly, double, std::less<MoveOnly>, min_allocator<V>> m;
assert(m.size() == 0);
assert(m[1] == 0.0);
diff --git a/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp b/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
index 1f11fc9582ed..dedc89bd435e 100644
--- a/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
@@ -33,16 +33,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
}
{
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 eed26d3a6136..9baa19b53d05 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
@@ -31,16 +31,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
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 f80b1d323178..3b28118b5b1e 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
@@ -33,16 +33,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
{
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 9347b8329ae3..0f1fd396639e 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
@@ -31,16 +31,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
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 4598e9945d4e..f25dff2c86da 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
@@ -94,18 +94,19 @@ struct some_alloc3
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
{
- typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
@@ -117,28 +118,28 @@ int main()
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc <MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc <V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // always equal allocator, throwable swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc2<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc2<V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // POCS allocator, nothrow swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc <MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc <V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
{ // always equal allocator, nothrow swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc2<V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
{ // NOT always equal allocator, nothrow swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc3<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc3<V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
diff --git a/test/std/containers/associative/multimap/allocator_mismatch.fail.cpp b/test/std/containers/associative/multimap/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..18823212f409
--- /dev/null
+++ b/test/std/containers/associative/multimap/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <map>
+// The container's value type must be the same as the allocator's value type
+
+#include <map>
+
+int main()
+{
+ std::multimap<int, int, std::less<int>, std::allocator<long> > m;
+}
diff --git a/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
index d1db40b1fc7a..5f05a0dca28e 100644
--- a/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
@@ -33,16 +33,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
}
{
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 cb55e3fb33ec..dd1701240c63 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
@@ -31,16 +31,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
{
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 8ad9e8b82fd1..635a8dca0357 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
@@ -33,16 +33,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
{
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 66ea8737fb75..0f31f04ff829 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
@@ -31,16 +31,17 @@ struct some_comp
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
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 1013c62804b8..e70ee1fae565 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
@@ -94,18 +94,19 @@ struct some_alloc3
int main()
{
#if __has_feature(cxx_noexcept)
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
{
- typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
@@ -117,28 +118,28 @@ int main()
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for comp
- typedef std::multimap<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc <MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc <V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // always equal allocator, throwable swap for comp
- typedef std::multimap<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc2<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc2<V>> C;
C c1, c2;
static_assert(!noexcept(swap(c1, c2)), "");
}
{ // POCS allocator, nothrow swap for comp
- typedef std::multimap<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc <MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc <V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
{ // always equal allocator, nothrow swap for comp
- typedef std::multimap<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C;
+ typedef std::multimap<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc2<V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
{ // NOT always equal allocator, nothrow swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc3<MoveOnly>> C;
+ typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc3<V>> C;
C c1, c2;
static_assert( noexcept(swap(c1, c2)), "");
}
diff --git a/test/std/containers/associative/multimap/scary.pass.cpp b/test/std/containers/associative/multimap/scary.pass.cpp
index b99d9bc2df91..e6dc5aaca953 100644
--- a/test/std/containers/associative/multimap/scary.pass.cpp
+++ b/test/std/containers/associative/multimap/scary.pass.cpp
@@ -21,4 +21,5 @@ int main()
typedef std::multimap<int, int> M2;
M2::iterator i;
M1::iterator j = i;
+ ((void)j);
}
diff --git a/test/std/containers/associative/multiset/allocator_mismatch.fail.cpp b/test/std/containers/associative/multiset/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..b2b30d6fdc1d
--- /dev/null
+++ b/test/std/containers/associative/multiset/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+// The container's value type must be the same as the allocator's value type
+
+#include <set>
+
+int main()
+{
+ std::multiset<int, std::less<int>, std::allocator<long> > ms;
+}
diff --git a/test/std/containers/associative/multiset/scary.pass.cpp b/test/std/containers/associative/multiset/scary.pass.cpp
index f5ee32714e86..bc4328b5332b 100644
--- a/test/std/containers/associative/multiset/scary.pass.cpp
+++ b/test/std/containers/associative/multiset/scary.pass.cpp
@@ -21,4 +21,5 @@ int main()
typedef std::multiset<int> M2;
M2::iterator i;
M1::iterator j = i;
+ ((void)j);
}
diff --git a/test/std/containers/associative/set/allocator_mismatch.fail.cpp b/test/std/containers/associative/set/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..6905d9344864
--- /dev/null
+++ b/test/std/containers/associative/set/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <set>
+// The container's value type must be the same as the allocator's value type
+
+#include <set>
+
+int main()
+{
+ std::set<int, std::less<int>, std::allocator<long> > s;
+}
diff --git a/test/std/containers/sequences/array/array.cons/initializer_list.pass.cpp b/test/std/containers/sequences/array/array.cons/initializer_list.pass.cpp
index b9775eef0673..5e429adb6fc9 100644
--- a/test/std/containers/sequences/array/array.cons/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/array/array.cons/initializer_list.pass.cpp
@@ -14,6 +14,10 @@
#include <array>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
diff --git a/test/std/containers/sequences/array/array.data/data.pass.cpp b/test/std/containers/sequences/array/array.data/data.pass.cpp
index 08e4fd39d377..d7aed70c98ad 100644
--- a/test/std/containers/sequences/array/array.data/data.pass.cpp
+++ b/test/std/containers/sequences/array/array.data/data.pass.cpp
@@ -14,6 +14,10 @@
#include <array>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
diff --git a/test/std/containers/sequences/array/array.data/data_const.pass.cpp b/test/std/containers/sequences/array/array.data/data_const.pass.cpp
index 8eb9762dcb89..58840e940899 100644
--- a/test/std/containers/sequences/array/array.data/data_const.pass.cpp
+++ b/test/std/containers/sequences/array/array.data/data_const.pass.cpp
@@ -14,6 +14,10 @@
#include <array>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
diff --git a/test/std/containers/sequences/array/array.fill/fill.pass.cpp b/test/std/containers/sequences/array/array.fill/fill.pass.cpp
index 675f49500627..5bc42ceb89f3 100644
--- a/test/std/containers/sequences/array/array.fill/fill.pass.cpp
+++ b/test/std/containers/sequences/array/array.fill/fill.pass.cpp
@@ -14,6 +14,10 @@
#include <array>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
diff --git a/test/std/containers/sequences/array/array.size/size.pass.cpp b/test/std/containers/sequences/array/array.size/size.pass.cpp
index fe5a0d5c8db0..a833fdc04715 100644
--- a/test/std/containers/sequences/array/array.size/size.pass.cpp
+++ b/test/std/containers/sequences/array/array.size/size.pass.cpp
@@ -14,6 +14,10 @@
#include <array>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
diff --git a/test/std/containers/sequences/array/array.special/swap.pass.cpp b/test/std/containers/sequences/array/array.special/swap.pass.cpp
index 08e437739ee6..c1b0b235ab34 100644
--- a/test/std/containers/sequences/array/array.special/swap.pass.cpp
+++ b/test/std/containers/sequences/array/array.special/swap.pass.cpp
@@ -14,6 +14,10 @@
#include <array>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
diff --git a/test/std/containers/sequences/array/array.swap/swap.pass.cpp b/test/std/containers/sequences/array/array.swap/swap.pass.cpp
index c7a4cb8df38c..651798e1e790 100644
--- a/test/std/containers/sequences/array/array.swap/swap.pass.cpp
+++ b/test/std/containers/sequences/array/array.swap/swap.pass.cpp
@@ -14,6 +14,10 @@
#include <array>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
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 4f4fbcf93af6..13323dd8e519 100644
--- a/test/std/containers/sequences/array/array.tuple/get.fail.cpp
+++ b/test/std/containers/sequences/array/array.tuple/get.fail.cpp
@@ -11,15 +11,31 @@
// template <size_t I, class T, size_t N> T& get(array<T, N>& a);
+// Prevent -Warray-bounds from issuing a diagnostic when testing with clang verify.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Warray-bounds"
+#endif
+
#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.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
typedef double T;
typedef std::array<T, 3> C;
C c = {1, 2, 3.5};
- std::get<3>(c) = 5.5; // Can't get element 3!
+ 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/array.tuple/get.pass.cpp b/test/std/containers/sequences/array/array.tuple/get.pass.cpp
index d9e242cd420b..4f210c4f762e 100644
--- a/test/std/containers/sequences/array/array.tuple/get.pass.cpp
+++ b/test/std/containers/sequences/array/array.tuple/get.pass.cpp
@@ -14,12 +14,19 @@
#include <array>
#include <cassert>
-#if __cplusplus > 201103L
+#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.
+#include "disable_missing_braces_warning.h"
+
+
+#if TEST_STD_VER > 11
struct S {
std::array<int, 3> a;
int k;
constexpr S() : a{1,2,3}, k(std::get<2>(a)) {}
- };
+};
constexpr std::array<int, 2> getArr () { return { 3, 4 }; }
#endif
@@ -35,7 +42,7 @@ int main()
assert(c[1] == 5.5);
assert(c[2] == 3.5);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef double T;
typedef std::array<T, 3> C;
diff --git a/test/std/containers/sequences/array/array.tuple/get_const.pass.cpp b/test/std/containers/sequences/array/array.tuple/get_const.pass.cpp
index 1cbdfa4ff393..04606bf6cf73 100644
--- a/test/std/containers/sequences/array/array.tuple/get_const.pass.cpp
+++ b/test/std/containers/sequences/array/array.tuple/get_const.pass.cpp
@@ -14,6 +14,12 @@
#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.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
@@ -24,7 +30,7 @@ int main()
assert(std::get<1>(c) == 2);
assert(std::get<2>(c) == 3.5);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef double T;
typedef std::array<T, 3> C;
diff --git a/test/std/containers/sequences/array/array.tuple/get_const_rv.pass.cpp b/test/std/containers/sequences/array/array.tuple/get_const_rv.pass.cpp
new file mode 100644
index 000000000000..a22c91a4de47
--- /dev/null
+++ b/test/std/containers/sequences/array/array.tuple/get_const_rv.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.
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+
+// template <size_t I, class T, size_t N> const T&& get(const array<T, N>&& a);
+
+// UNSUPPORTED: c++98, c++03
+
+#include <array>
+#include <memory>
+#include <type_traits>
+#include <utility>
+#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.
+#include "disable_missing_braces_warning.h"
+
+int main()
+{
+
+ {
+ typedef std::unique_ptr<double> T;
+ typedef std::array<T, 1> C;
+ const C c = {std::unique_ptr<double>(new double(3.5))};
+ static_assert(std::is_same<const T&&, decltype(std::get<0>(std::move(c)))>::value, "");
+ static_assert(noexcept(std::get<0>(std::move(c))), "");
+ const T&& t = std::get<0>(std::move(c));
+ assert(*t == 3.5);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef double T;
+ typedef std::array<T, 3> C;
+ constexpr const C c = {1, 2, 3.5};
+ static_assert(std::get<0>(std::move(c)) == 1, "");
+ static_assert(std::get<1>(std::move(c)) == 2, "");
+ static_assert(std::get<2>(std::move(c)) == 3.5, "");
+ }
+#endif
+}
diff --git a/test/std/containers/sequences/array/array.tuple/get_rv.pass.cpp b/test/std/containers/sequences/array/array.tuple/get_rv.pass.cpp
index 8eec3ceff514..72ef49b157f6 100644
--- a/test/std/containers/sequences/array/array.tuple/get_rv.pass.cpp
+++ b/test/std/containers/sequences/array/array.tuple/get_rv.pass.cpp
@@ -11,14 +11,20 @@
// template <size_t I, class T, size_t N> T&& get(array<T, N>&& a);
+// UNSUPPORTED: c++98, c++03
+
#include <array>
#include <memory>
#include <utility>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
{
typedef std::unique_ptr<double> T;
typedef std::array<T, 1> C;
@@ -26,5 +32,4 @@ int main()
T t = std::get<0>(std::move(c));
assert(*t == 3.5);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/array/at.pass.cpp b/test/std/containers/sequences/array/at.pass.cpp
index b5cf8a5aaa8f..5cb89dfeeb9a 100644
--- a/test/std/containers/sequences/array/at.pass.cpp
+++ b/test/std/containers/sequences/array/at.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <array>
// reference operator[] (size_type)
@@ -17,6 +18,12 @@
#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.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
@@ -27,7 +34,7 @@ int main()
assert(r1 == 1);
r1 = 5.5;
assert(c.front() == 5.5);
-
+
C::reference r2 = c.at(2);
assert(r2 == 3.5);
r2 = 7.5;
@@ -50,7 +57,7 @@ int main()
catch (const std::out_of_range &) {}
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef double T;
typedef std::array<T, 3> C;
diff --git a/test/std/containers/sequences/array/begin.pass.cpp b/test/std/containers/sequences/array/begin.pass.cpp
index 9cba0d6fceb0..b12ffc851b84 100644
--- a/test/std/containers/sequences/array/begin.pass.cpp
+++ b/test/std/containers/sequences/array/begin.pass.cpp
@@ -14,6 +14,10 @@
#include <array>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
@@ -27,6 +31,4 @@ int main()
*i = 5.5;
assert(c[0] == 5.5);
}
- {
- }
}
diff --git a/test/std/containers/sequences/array/front_back.pass.cpp b/test/std/containers/sequences/array/front_back.pass.cpp
index 45a963b9947d..bccaade986ea 100644
--- a/test/std/containers/sequences/array/front_back.pass.cpp
+++ b/test/std/containers/sequences/array/front_back.pass.cpp
@@ -17,6 +17,12 @@
#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.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
@@ -45,12 +51,12 @@ int main()
assert(r2 == 3.5);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef double T;
typedef std::array<T, 3> C;
constexpr C c = {1, 2, 3.5};
-
+
constexpr T t1 = c.front();
static_assert (t1 == 1, "");
diff --git a/test/std/containers/sequences/array/indexing.pass.cpp b/test/std/containers/sequences/array/indexing.pass.cpp
index e4dda0dc5cfd..5ccb0b487b95 100644
--- a/test/std/containers/sequences/array/indexing.pass.cpp
+++ b/test/std/containers/sequences/array/indexing.pass.cpp
@@ -17,6 +17,12 @@
#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.
+#include "disable_missing_braces_warning.h"
+
int main()
{
{
@@ -42,13 +48,13 @@ int main()
C::const_reference r2 = c[2];
assert(r2 == 3.5);
}
-
-#if _LIBCPP_STD_VER > 11
+
+#if TEST_STD_VER > 11
{
typedef double T;
typedef std::array<T, 3> C;
constexpr C c = {1, 2, 3.5};
-
+
constexpr T t1 = c[0];
static_assert (t1 == 1, "");
diff --git a/test/std/containers/sequences/deque/allocator_mismatch.fail.cpp b/test/std/containers/sequences/deque/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..9223c1ecddcb
--- /dev/null
+++ b/test/std/containers/sequences/deque/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+// The container's value type must be the same as the allocator's value type
+
+#include <deque>
+
+int main()
+{
+ std::deque<int, std::allocator<long> > d;
+}
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 522f839973db..84f04f9d52da 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
@@ -14,6 +14,7 @@
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -58,7 +59,6 @@ template <class C>
void
testN(int start, int N, int M)
{
- typedef typename C::const_iterator CI;
C c1 = make<C>(N, start);
test(c1, M);
}
@@ -73,7 +73,7 @@ int main()
for (int k = 0; k < N; ++k)
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
}
-#if __cplusplus >= 201103L
+#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]);
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 9eb514ba92f7..2bf2423fb9af 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
@@ -14,6 +14,7 @@
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -58,7 +59,6 @@ template <class C>
void
testN(int start, int N, int M)
{
- typedef typename C::const_iterator CI;
C c1 = make<C>(N, start);
test(c1, M, -10);
}
@@ -73,7 +73,7 @@ int main()
for (int k = 0; k < N; ++k)
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
}
-#if __cplusplus >= 201103L
+#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]);
diff --git a/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp b/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp
index fb00069f33b6..0cf0387211d3 100644
--- a/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp
@@ -14,6 +14,7 @@
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -51,7 +52,6 @@ template <class C>
void
testN(int start, int N)
{
- typedef typename C::const_iterator CI;
C c1 = make<C>(N, start);
test(c1);
}
@@ -65,7 +65,7 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<int> >(rng[i], rng[j]);
}
-#if __cplusplus >= 201103L
+#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]);
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 51a37cc33b7a..6507f58e1194 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
@@ -15,6 +15,7 @@
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "min_allocator.h"
@@ -44,7 +45,6 @@ template <class C>
void
test(C& c1, const C& c2)
{
- std::size_t c1_osize = c1.size();
c1.assign(c2.begin(), c2.end());
assert(distance(c1.begin(), c1.end()) == c1.size());
assert(c1 == c2);
@@ -54,8 +54,6 @@ template <class C>
void
testN(int start, int N, int M)
{
- typedef typename C::iterator I;
- typedef typename C::const_iterator CI;
C c1 = make<C>(N, start);
C c2 = make<C>(M);
test(c1, c2);
@@ -67,7 +65,6 @@ testI(C& c1, const C& c2)
{
typedef typename C::const_iterator CI;
typedef input_iterator<CI> ICI;
- std::size_t c1_osize = c1.size();
c1.assign(ICI(c2.begin()), ICI(c2.end()));
assert(distance(c1.begin(), c1.end()) == c1.size());
assert(c1 == c2);
@@ -77,8 +74,6 @@ template <class C>
void
testNI(int start, int N, int M)
{
- typedef typename C::iterator I;
- typedef typename C::const_iterator CI;
C c1 = make<C>(N, start);
C c2 = make<C>(M);
testI(c1, c2);
@@ -95,7 +90,7 @@ int main()
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
testNI<std::deque<int> >(1500, 2000, 1000);
}
-#if __cplusplus >= 201103L
+#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]);
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 3ab79a095fce..e00e0442d22e 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
@@ -14,6 +14,7 @@
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "min_allocator.h"
@@ -44,7 +45,6 @@ void
test(C& c1, int size, int v)
{
typedef typename C::const_iterator CI;
- std::size_t c1_osize = c1.size();
c1.assign(size, v);
assert(c1.size() == size);
assert(distance(c1.begin(), c1.end()) == c1.size());
@@ -56,8 +56,6 @@ template <class C>
void
testN(int start, int N, int M)
{
- typedef typename C::iterator I;
- typedef typename C::const_iterator CI;
C c1 = make<C>(N, start);
test(c1, M, -10);
}
@@ -72,7 +70,7 @@ int main()
for (int k = 0; k < N; ++k)
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
}
-#if __cplusplus >= 201103L
+#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]);
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 7a0a2512ee2f..713f2159e598 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp
@@ -11,13 +11,14 @@
// template <class... Args> iterator emplace(const_iterator p, Args&&... args);
+// UNSUPPORTED: c++98, c++03
+
#include <deque>
#include <cassert>
#include "../../../Emplaceable.h"
#include "min_allocator.h"
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class C>
C
@@ -45,7 +46,6 @@ template <class C>
void
test(int P, C& c1)
{
- typedef typename C::iterator I;
typedef typename C::const_iterator CI;
std::size_t c1_osize = c1.size();
CI i = c1.emplace(c1.begin() + P, Emplaceable(1, 2.5));
@@ -59,8 +59,6 @@ template <class C>
void
testN(int start, int N)
{
- typedef typename C::iterator I;
- typedef typename C::const_iterator CI;
for (int i = 0; i <= 3; ++i)
{
if (0 <= i && i <= N)
@@ -87,11 +85,9 @@ testN(int start, int N)
}
}
-#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]);
@@ -99,7 +95,6 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<Emplaceable> >(rng[i], rng[j]);
}
-#if __cplusplus >= 201103L
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng)/sizeof(rng[0]);
@@ -107,6 +102,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/insert_iter_iter.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp
index ecb95d72a21e..fbe3cb69ccdd 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
@@ -17,6 +17,7 @@
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "MoveOnly.h"
#include "../../../stack_allocator.h"
@@ -49,7 +50,6 @@ void
test(int P, const C& c0, const C& c2)
{
{
- typedef typename C::iterator I;
typedef typename C::const_iterator CI;
typedef input_iterator<CI> BCI;
C c1 = c0;
@@ -67,7 +67,6 @@ test(int P, const C& c0, const C& c2)
assert(*i == j);
}
{
- typedef typename C::iterator I;
typedef typename C::const_iterator CI;
typedef forward_iterator<CI> BCI;
C c1 = c0;
@@ -85,7 +84,6 @@ test(int P, const C& c0, const C& c2)
assert(*i == j);
}
{
- typedef typename C::iterator I;
typedef typename C::const_iterator CI;
typedef bidirectional_iterator<CI> BCI;
C c1 = c0;
@@ -108,8 +106,6 @@ template <class C>
void
testN(int start, int N, int M)
{
- typedef typename C::iterator I;
- typedef typename C::const_iterator CI;
for (int i = 0; i <= 3; ++i)
{
if (0 <= i && i <= N)
@@ -170,7 +166,6 @@ template <class C>
void
testI(int P, C& c1, const C& c2)
{
- typedef typename C::iterator I;
typedef typename C::const_iterator CI;
typedef input_iterator<CI> ICI;
std::size_t c1_osize = c1.size();
@@ -191,8 +186,6 @@ template <class C>
void
testNI(int start, int N, int M)
{
- typedef typename C::iterator I;
- typedef typename C::const_iterator CI;
for (int i = 0; i <= 3; ++i)
{
if (0 <= i && i <= N)
@@ -244,7 +237,7 @@ template <class C>
void
test_move()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
C c;
typedef typename C::const_iterator CI;
{
@@ -263,7 +256,7 @@ test_move()
j = 0;
for (CI i = c.begin(); i != c.end(); ++i, ++j)
assert(*i == MoveOnly(j));
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
int main()
@@ -276,11 +269,11 @@ int main()
for (int k = 0; k < N; ++k)
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
testNI<std::deque<int> >(1500, 2000, 1000);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test_move<std::deque<MoveOnly, stack_allocator<MoveOnly, 2000> > >();
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
-#if __cplusplus >= 201103L
+#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]);
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 b7e73f265028..3c7b0fef28b4 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
@@ -11,13 +11,14 @@
// iterator insert (const_iterator p, value_type&& v);
+// UNSUPPORTED: c++98, c++03
+
#include <deque>
#include <cassert>
#include "MoveOnly.h"
#include "min_allocator.h"
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class C>
C
@@ -45,7 +46,6 @@ template <class C>
void
test(int P, C& c1, int x)
{
- typedef typename C::iterator I;
typedef typename C::const_iterator CI;
std::size_t c1_osize = c1.size();
CI i = c1.insert(c1.begin() + P, MoveOnly(x));
@@ -65,8 +65,6 @@ template <class C>
void
testN(int start, int N)
{
- typedef typename C::iterator I;
- typedef typename C::const_iterator CI;
for (int i = 0; i <= 3; ++i)
{
if (0 <= i && i <= N)
@@ -93,11 +91,8 @@ testN(int start, int N)
}
}
-#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]);
@@ -105,7 +100,6 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<MoveOnly> >(rng[i], rng[j]);
}
-#if __cplusplus >= 201103L
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng)/sizeof(rng[0]);
@@ -113,6 +107,4 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<MoveOnly, min_allocator<MoveOnly>> >(rng[i], rng[j]);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
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 2737dfba7739..0efe3b44c604 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
@@ -16,6 +16,7 @@
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -44,7 +45,6 @@ template <class C>
void
test(int P, C& c1, int size, int x)
{
- typedef typename C::iterator I;
typedef typename C::const_iterator CI;
std::size_t c1_osize = c1.size();
CI i = c1.insert(c1.begin() + P, size, x);
@@ -64,8 +64,6 @@ template <class C>
void
testN(int start, int N, int M)
{
- typedef typename C::iterator I;
- typedef typename C::const_iterator CI;
for (int i = 0; i <= 3; ++i)
{
if (0 <= i && i <= N)
@@ -145,7 +143,7 @@ int main()
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
self_reference_test<std::deque<int> >();
}
-#if __cplusplus >= 201103L
+#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]);
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 fbbaad4f89e5..04c4ca4f7b26 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
@@ -14,6 +14,7 @@
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -42,7 +43,6 @@ template <class C>
void
test(int P, C& c1, int x)
{
- typedef typename C::iterator I;
typedef typename C::const_iterator CI;
std::size_t c1_osize = c1.size();
CI i = c1.insert(c1.begin() + P, x);
@@ -62,8 +62,6 @@ template <class C>
void
testN(int start, int N)
{
- typedef typename C::iterator I;
- typedef typename C::const_iterator CI;
for (int i = 0; i <= 3; ++i)
{
if (0 <= i && i <= N)
@@ -126,7 +124,7 @@ int main()
testN<std::deque<int> >(rng[i], rng[j]);
self_reference_test<std::deque<int> >();
}
-#if __cplusplus >= 201103L
+#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]);
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 8ad6b53f1b5f..b37e961e442f 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <deque>
// void push_back(const value_type& x);
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 e01b2a224ffd..b4caa947aed8 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <deque>
// void push_front(const value_type& x);
diff --git a/test/std/containers/sequences/forwardlist/allocator_mismatch.fail.cpp b/test/std/containers/sequences/forwardlist/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..b53075d033bc
--- /dev/null
+++ b/test/std/containers/sequences/forwardlist/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <forward_list>
+// The container's value type must be the same as the allocator's value type
+
+#include <forward_list>
+
+int main()
+{
+ std::forward_list<int, std::allocator<long> > fl;
+}
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 8341f7ba0cb2..88ecb7540951 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
@@ -24,7 +24,7 @@ int main()
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef MoveOnly T;
- typedef test_allocator<int> A;
+ typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
typedef std::move_iterator<T*> I;
@@ -39,7 +39,7 @@ int main()
}
{
typedef MoveOnly T;
- typedef other_allocator<int> A;
+ typedef other_allocator<T> A;
typedef std::forward_list<T, A> C;
T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
typedef std::move_iterator<T*> I;
@@ -55,7 +55,7 @@ int main()
#if __cplusplus >= 201103L
{
typedef MoveOnly T;
- typedef min_allocator<int> A;
+ typedef min_allocator<T> A;
typedef std::forward_list<T, A> C;
T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
typedef std::move_iterator<T*> I;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp
index 6bb575ef80f1..3f0e45af1f0b 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp
@@ -24,7 +24,7 @@ int main()
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef MoveOnly T;
- typedef test_allocator<int> A;
+ typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
typedef std::move_iterator<T*> I;
@@ -39,7 +39,7 @@ int main()
}
{
typedef MoveOnly T;
- typedef test_allocator<int> A;
+ typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
typedef std::move_iterator<T*> I;
@@ -55,7 +55,7 @@ int main()
#if __cplusplus >= 201103L
{
typedef MoveOnly T;
- typedef min_allocator<int> A;
+ typedef min_allocator<T> A;
typedef std::forward_list<T, A> C;
T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
typedef std::move_iterator<T*> I;
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 43c62eb00cbf..b501347e7893 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <forward_list>
// void push_front(const value_type& x);
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 296ffcd6955d..349a3872d754 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
@@ -15,6 +15,7 @@
#include <cassert>
#include <iterator>
+#include "test_macros.h"
#include "min_allocator.h"
typedef int T;
@@ -44,7 +45,6 @@ tests(const C& c, int p, int f)
{
typename C::const_iterator i = c.begin();
int n = 0;
- int d = 1;
if (p == f || p == f+1)
{
for (n = 0; n < size_t1; ++n, ++i)
@@ -106,7 +106,7 @@ int main()
}
}
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
// splicing different containers
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.spec/equal.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.spec/equal.pass.cpp
index ca673b583683..9f01fed66465 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.spec/equal.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.spec/equal.pass.cpp
@@ -22,12 +22,12 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
void test(int N, int M)
{
- typedef typename C::value_type T;
C c1;
for (int i = 0; i < N; ++i)
c1.push_front(i);
@@ -52,7 +52,7 @@ int main()
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
test<std::forward_list<int> >(i, j);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
test<std::forward_list<int, min_allocator<int>> >(i, j);
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.spec/relational.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.spec/relational.pass.cpp
index 42e245d007b0..e65e064ffdaf 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.spec/relational.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.spec/relational.pass.cpp
@@ -30,12 +30,12 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
void test(int N, int M)
{
- typedef typename C::value_type T;
C c1;
for (int i = 0; i < N; ++i)
c1.push_front(i);
@@ -57,7 +57,7 @@ int main()
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
test<std::forward_list<int> >(i, j);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
test<std::forward_list<int, min_allocator<int>> >(i, j);
diff --git a/test/std/containers/sequences/list/allocator_mismatch.fail.cpp b/test/std/containers/sequences/list/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..3490d106a60c
--- /dev/null
+++ b/test/std/containers/sequences/list/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+// The container's value type must be the same as the allocator's value type
+
+#include <list>
+
+int main()
+{
+ std::list<int, std::allocator<long> > l;
+}
diff --git a/test/std/containers/sequences/list/incomplete_type.pass.cpp b/test/std/containers/sequences/list/incomplete_type.pass.cpp
new file mode 100644
index 000000000000..adfb4d45fc81
--- /dev/null
+++ b/test/std/containers/sequences/list/incomplete_type.pass.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// Check that std::list and it's iterators can be instantiated with an incomplete
+// type.
+
+#include <list>
+
+struct A {
+ std::list<A> l;
+ std::list<A>::iterator it;
+ std::list<A>::const_iterator cit;
+ std::list<A>::reverse_iterator rit;
+ std::list<A>::const_reverse_iterator crit;
+};
+
+int main() {
+ A a;
+}
diff --git a/test/std/containers/sequences/list/list.modifiers/insert_iter_iter_iter.pass.cpp b/test/std/containers/sequences/list/list.modifiers/insert_iter_iter_iter.pass.cpp
index a7f1917ab856..736b9baae746 100644
--- a/test/std/containers/sequences/list/list.modifiers/insert_iter_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/insert_iter_iter_iter.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <list>
// template <InputIterator Iter>
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 eeb74b83e509..c0f6ed198751 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <list>
// iterator insert(const_iterator position, size_type n, const value_type& x);
diff --git a/test/std/containers/sequences/list/list.modifiers/insert_iter_value.pass.cpp b/test/std/containers/sequences/list/list.modifiers/insert_iter_value.pass.cpp
index 406e93a376a1..1aacb63e4a70 100644
--- a/test/std/containers/sequences/list/list.modifiers/insert_iter_value.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/insert_iter_value.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <list>
// iterator insert(const_iterator position, const value_type& x);
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 9d3c05e26b1c..8d16142defc0 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: 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 6609005262eb..aafcceecd471 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <list>
// void push_front(const value_type& x);
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 b580eb4ae3b0..4dd871c9447e 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
@@ -28,6 +28,32 @@ struct some_alloc
some_alloc(const some_alloc&);
};
+template <class T>
+struct some_alloc2
+{
+ typedef T value_type;
+
+ some_alloc2() {}
+ some_alloc2(const some_alloc2&);
+ void deallocate(void*, unsigned) {}
+
+ typedef std::false_type propagate_on_container_move_assignment;
+ typedef std::true_type is_always_equal;
+};
+
+template <class T>
+struct some_alloc3
+{
+ typedef T value_type;
+
+ some_alloc3() {}
+ some_alloc3(const some_alloc3&);
+ void deallocate(void*, unsigned) {}
+
+ typedef std::false_type propagate_on_container_move_assignment;
+ typedef std::false_type is_always_equal;
+};
+
int main()
{
#if __has_feature(cxx_noexcept)
@@ -45,7 +71,22 @@ int main()
}
{
typedef std::vector<bool, some_alloc<bool>> C;
+#if TEST_STD_VER > 14
+ static_assert( std::is_nothrow_move_assignable<C>::value, "");
+#else
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+#endif
+ }
+#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, "");
}
+ { // POCMA false, is_always_equal false
+ typedef std::vector<bool, some_alloc3<bool>> C;
+ static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+ }
+#endif
+
#endif
}
diff --git a/test/std/containers/sequences/vector/allocator_mismatch.fail.cpp b/test/std/containers/sequences/vector/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..65fdb63ee6a0
--- /dev/null
+++ b/test/std/containers/sequences/vector/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+// The container's value type must be the same as the allocator's value type
+
+#include <vector>
+
+int main()
+{
+ std::vector<int, std::allocator<long> > v;
+}
diff --git a/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp
index 1c4a4f7c9282..c09224497966 100644
--- a/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp
@@ -29,6 +29,33 @@ struct some_alloc
some_alloc(const some_alloc&);
};
+template <class T>
+struct some_alloc2
+{
+ typedef T value_type;
+
+ some_alloc2() {}
+ some_alloc2(const some_alloc2&);
+ void deallocate(void*, unsigned) {}
+
+ typedef std::false_type propagate_on_container_move_assignment;
+ typedef std::true_type is_always_equal;
+};
+
+template <class T>
+struct some_alloc3
+{
+ typedef T value_type;
+
+ some_alloc3() {}
+ some_alloc3(const some_alloc3&);
+ void deallocate(void*, unsigned) {}
+
+ typedef std::false_type propagate_on_container_move_assignment;
+ typedef std::false_type is_always_equal;
+};
+
+
int main()
{
#if __has_feature(cxx_noexcept)
@@ -46,7 +73,24 @@ int main()
}
{
typedef std::vector<MoveOnly, some_alloc<MoveOnly>> C;
+ // In C++17, move assignment for allocators are not allowed to throw
+#if TEST_STD_VER > 14
+ static_assert( std::is_nothrow_move_assignable<C>::value, "");
+#else
+ static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+#endif
+ }
+
+#if TEST_STD_VER > 14
+ { // POCMA false, is_always_equal true
+ typedef std::vector<MoveOnly, some_alloc2<MoveOnly>> C;
+ static_assert( std::is_nothrow_move_assignable<C>::value, "");
+ }
+ { // POCMA false, is_always_equal false
+ typedef std::vector<MoveOnly, some_alloc3<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
#endif
+
+#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 6615a25a620f..785225357d4b 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <vector>
// void push_back(const value_type& x);
diff --git a/test/std/containers/unord/unord.map/allocator_mismatch.fail.cpp b/test/std/containers/unord/unord.map/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..39fcb11add40
--- /dev/null
+++ b/test/std/containers/unord/unord.map/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+// The container's value type must be the same as the allocator's value type
+
+#include <unordered_map>
+
+int main()
+{
+ std::unordered_map<int, int, std::hash<int>, std::less<int>, std::allocator<long> > m;
+}
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 d3e80d86379a..bc3733742600 100644
--- a/test/std/containers/unord/unord.map/bucket_count.pass.cpp
+++ b/test/std/containers/unord/unord.map/bucket_count.pass.cpp
@@ -19,20 +19,18 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
{
{
typedef std::unordered_map<int, std::string> C;
- typedef C::const_iterator I;
- typedef std::pair<int, std::string> P;
const C c;
assert(c.bucket_count() == 0);
}
{
typedef std::unordered_map<int, std::string> C;
- typedef C::const_iterator I;
typedef std::pair<int, std::string> P;
P a[] =
{
@@ -48,19 +46,16 @@ int main()
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 11);
}
-#if __cplusplus >= 201103L
+#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;
- typedef C::const_iterator I;
- typedef std::pair<int, std::string> P;
const C c;
assert(c.bucket_count() == 0);
}
{
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
min_allocator<std::pair<const int, std::string>>> C;
- typedef C::const_iterator I;
typedef std::pair<int, std::string> P;
P a[] =
{
diff --git a/test/std/containers/unord/unord.map/compare.pass.cpp b/test/std/containers/unord/unord.map/compare.pass.cpp
index 8979a3a34ad6..ea6d02f5fcbc 100644
--- a/test/std/containers/unord/unord.map/compare.pass.cpp
+++ b/test/std/containers/unord/unord.map/compare.pass.cpp
@@ -17,6 +17,7 @@
// http://llvm.org/bugs/show_bug.cgi?id=16549
#include <unordered_map>
+#include <cassert>
struct Key {
template <typename T> Key(const T&) {}
@@ -35,8 +36,12 @@ namespace std
int
main()
{
- std::unordered_map<Key, int>::iterator it =
- std::unordered_map<Key, int>().find(Key(0));
- std::pair<std::unordered_map<Key, int>::iterator, bool> result =
- std::unordered_map<Key, int>().insert(std::make_pair(Key(0), 0));
+ typedef std::unordered_map<Key, int> MapT;
+ typedef MapT::iterator Iter;
+ MapT map;
+ Iter it = map.find(Key(0));
+ assert(it == map.end());
+ std::pair<Iter, bool> result = map.insert(std::make_pair(Key(0), 42));
+ assert(result.second);
+ assert(result.first->second == 42);
}
diff --git a/test/std/containers/unord/unord.map/load_factor.pass.cpp b/test/std/containers/unord/unord.map/load_factor.pass.cpp
index 472e41abf6e0..b25c019688a6 100644
--- a/test/std/containers/unord/unord.map/load_factor.pass.cpp
+++ b/test/std/containers/unord/unord.map/load_factor.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <cfloat>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -43,11 +44,10 @@ int main()
}
{
typedef std::unordered_map<int, std::string> C;
- typedef std::pair<int, std::string> P;
const C c;
assert(c.load_factor() == 0);
}
-#if __cplusplus >= 201103L
+#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;
@@ -69,7 +69,6 @@ int main()
{
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
min_allocator<std::pair<const int, std::string>>> C;
- typedef std::pair<int, std::string> P;
const C c;
assert(c.load_factor() == 0);
}
diff --git a/test/std/containers/unord/unord.map/max_bucket_count.pass.cpp b/test/std/containers/unord/unord.map/max_bucket_count.pass.cpp
index b4ca8eb04472..08f014da2f49 100644
--- a/test/std/containers/unord/unord.map/max_bucket_count.pass.cpp
+++ b/test/std/containers/unord/unord.map/max_bucket_count.pass.cpp
@@ -19,23 +19,20 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
{
{
typedef std::unordered_map<int, std::string> C;
- typedef C::const_iterator I;
- typedef std::pair<int, std::string> P;
const C c;
assert(c.max_bucket_count() > 0);
}
-#if __cplusplus >= 201103L
+#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;
- typedef C::const_iterator I;
- typedef std::pair<int, std::string> P;
const C c;
assert(c.max_bucket_count() > 0);
}
diff --git a/test/std/containers/unord/unord.map/max_load_factor.pass.cpp b/test/std/containers/unord/unord.map/max_load_factor.pass.cpp
index 69fd70d2a172..b19a6e6cfa08 100644
--- a/test/std/containers/unord/unord.map/max_load_factor.pass.cpp
+++ b/test/std/containers/unord/unord.map/max_load_factor.pass.cpp
@@ -16,44 +16,37 @@
// float max_load_factor() const;
// void max_load_factor(float mlf);
-#ifdef _LIBCPP_DEBUG
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <unordered_map>
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
{
{
typedef std::unordered_map<int, std::string> C;
- typedef std::pair<int, std::string> P;
const C c;
assert(c.max_load_factor() == 1);
}
{
typedef std::unordered_map<int, std::string> C;
- typedef std::pair<int, std::string> P;
C c;
assert(c.max_load_factor() == 1);
c.max_load_factor(2.5);
assert(c.max_load_factor() == 2.5);
}
-#if __cplusplus >= 201103L
+#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;
- typedef std::pair<int, std::string> P;
const C c;
assert(c.max_load_factor() == 1);
}
{
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
min_allocator<std::pair<const int, std::string>>> C;
- typedef std::pair<int, std::string> P;
C c;
assert(c.max_load_factor() == 1);
c.max_load_factor(2.5);
diff --git a/test/std/containers/unord/unord.map/rehash.pass.cpp b/test/std/containers/unord/unord.map/rehash.pass.cpp
index 84ece2355511..e1a882c69ffd 100644
--- a/test/std/containers/unord/unord.map/rehash.pass.cpp
+++ b/test/std/containers/unord/unord.map/rehash.pass.cpp
@@ -22,6 +22,12 @@
#include "min_allocator.h"
template <class C>
+void rehash_postcondition(const C& c, size_t n)
+{
+ assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
+}
+
+template <class C>
void test(const C& c)
{
assert(c.size() == 4);
@@ -49,13 +55,16 @@ int main()
test(c);
assert(c.bucket_count() >= 5);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 5);
test(c);
c.max_load_factor(2);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 3);
test(c);
c.rehash(31);
+ rehash_postcondition(c, 31);
assert(c.bucket_count() == 31);
test(c);
}
@@ -77,13 +86,16 @@ int main()
test(c);
assert(c.bucket_count() >= 5);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 5);
test(c);
c.max_load_factor(2);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 3);
test(c);
c.rehash(31);
+ rehash_postcondition(c, 31);
assert(c.bucket_count() == 31);
test(c);
}
diff --git a/test/std/containers/unord/unord.map/reserve.pass.cpp b/test/std/containers/unord/unord.map/reserve.pass.cpp
index 48667cdc7f92..bef237f960af 100644
--- a/test/std/containers/unord/unord.map/reserve.pass.cpp
+++ b/test/std/containers/unord/unord.map/reserve.pass.cpp
@@ -31,6 +31,21 @@ void test(const C& c)
assert(c.at(4) == "four");
}
+void reserve_invariant(size_t n) // LWG #2156
+{
+ for (size_t i = 0; i < n; ++i)
+ {
+ std::unordered_map<size_t, size_t> c;
+ c.reserve(n);
+ size_t buckets = c.bucket_count();
+ for (size_t j = 0; j < i; ++j)
+ {
+ c[i] = i;
+ assert(buckets == c.bucket_count());
+ }
+ }
+}
+
int main()
{
{
@@ -88,4 +103,5 @@ int main()
test(c);
}
#endif
+ reserve_invariant(20);
}
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 8ab1eb6211b8..0f98b66aa401 100644
--- a/test/std/containers/unord/unord.map/swap_member.pass.cpp
+++ b/test/std/containers/unord/unord.map/swap_member.pass.cpp
@@ -21,6 +21,7 @@
#include "../../test_compare.h"
#include "../../test_hash.h"
+#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
@@ -31,7 +32,6 @@ 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;
- 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));
c2.max_load_factor(2);
@@ -212,7 +212,6 @@ int main()
typedef test_compare<std::equal_to<int> > Compare;
typedef other_allocator<std::pair<const int, std::string> > Alloc;
typedef std::unordered_map<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));
c2.max_load_factor(2);
@@ -387,13 +386,12 @@ int main()
assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
assert(c2.max_load_factor() == 1);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef test_hash<std::hash<int> > Hash;
typedef test_compare<std::equal_to<int> > Compare;
typedef min_allocator<std::pair<const int, std::string> > Alloc;
typedef std::unordered_map<int, std::string, Hash, Compare, Alloc> C;
- typedef std::pair<int, std::string> P;
C c1(0, Hash(1), Compare(1), Alloc());
C c2(0, Hash(2), Compare(2), Alloc());
c2.max_load_factor(2);
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 18e6683011c8..1420204c5f76 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
@@ -15,6 +15,8 @@
// unordered_map(unordered_map&& u);
+// UNSUPPORTED: c++98, c++03
+
#include <unordered_map>
#include <string>
#include <cassert>
@@ -27,23 +29,12 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_map<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),
@@ -105,23 +96,12 @@ int main()
assert(c0.empty());
}
-#if __cplusplus >= 201103L
{
typedef std::unordered_map<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),
@@ -183,7 +163,6 @@ int main()
assert(c0.empty());
}
-#endif
#if _LIBCPP_DEBUG >= 1
{
std::unordered_map<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
@@ -195,5 +174,4 @@ int main()
assert(s2.size() == 2);
}
#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
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 5fd9f9d6114a..04ce91f69917 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <unordered_map>
// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/clear.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/clear.pass.cpp
index 9f320e949479..9f320e949479 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/clear.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/clear.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/emplace.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/emplace.pass.cpp
index 5de74d2e6c92..5de74d2e6c92 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/emplace.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/emplace.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/emplace_hint.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.pass.cpp
index 21a4689658ae..21a4689658ae 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/emplace_hint.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_const_iter.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.pass.cpp
index dbb812974d46..803ecb5adfcb 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_const_iter.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.pass.cpp
@@ -19,6 +19,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
struct TemplateConstructor
@@ -46,13 +47,13 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
- C::iterator j = c.erase(i);
+ c.erase(i);
assert(c.size() == 3);
assert(c.at(1) == "one");
assert(c.at(3) == "three");
assert(c.at(4) == "four");
}
-#if __cplusplus >= 201103L
+#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;
@@ -68,14 +69,14 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
- C::iterator j = c.erase(i);
+ c.erase(i);
assert(c.size() == 3);
assert(c.at(1) == "one");
assert(c.at(3) == "three");
assert(c.at(4) == "four");
}
#endif
-#if __cplusplus >= 201402L
+#if TEST_STD_VER >= 14
{
// This is LWG #2059
typedef TemplateConstructor T;
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_db1.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_db1.pass.cpp
index 60b093553f18..60b093553f18 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_db1.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_db1.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_db2.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_db2.pass.cpp
index 05046f5dedc1..05046f5dedc1 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_db2.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_db2.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_iter_db1.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db1.pass.cpp
index 81a8d3de1576..81a8d3de1576 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_iter_db1.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db1.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_iter_db2.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db2.pass.cpp
index 4b103a0ad75c..4b103a0ad75c 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_iter_db2.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db2.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_iter_db3.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db3.pass.cpp
index 6ef1e07add1e..6ef1e07add1e 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_iter_db3.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db3.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_iter_db4.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db4.pass.cpp
index 1185ddf8fd4a..1185ddf8fd4a 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_iter_iter_db4.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db4.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_key.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_key.pass.cpp
index 0e8ef8b895a7..cdd19eb3459d 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_key.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_key.pass.cpp
@@ -19,15 +19,16 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
template <typename Unordered>
bool only_deletions ( const Unordered &whole, const Unordered &part ) {
typename Unordered::const_iterator w = whole.begin();
typename Unordered::const_iterator p = part.begin();
-
- while ( w != whole.end () && p != part.end()) {
+
+ while ( w != whole.end () && p != part.end()) {
if ( *w == *p )
p++;
w++;
@@ -96,7 +97,7 @@ int main()
assert(c.erase(3) == 0);
assert(c.size() == 0);
}
-#if __cplusplus >= 201103L
+#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;
@@ -161,7 +162,7 @@ int main()
m[i] = i;
m2[i] = i;
}
-
+
C::iterator i = m2.begin();
int ctr = 0;
while (i != m2.end()) {
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_range.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_range.pass.cpp
index f0664c3c3ffc..f0664c3c3ffc 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/erase_range.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/erase_range.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_const_lvalue.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp
index a16f097b4c01..a16f097b4c01 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_const_lvalue.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_hint_const_lvalue.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp
index 981b8fb18a0a..981b8fb18a0a 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_hint_const_lvalue.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_hint_rvalue.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_rvalue.pass.cpp
index 1618c1019e1c..1618c1019e1c 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_hint_rvalue.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_rvalue.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_init.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_init.pass.cpp
index 81e8a468d83f..81e8a468d83f 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_init.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_init.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_or_assign.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
index 89929c856ec9..a4d8abc7d317 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_or_assign.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_or_assign.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// UNSUPPORTED: c++03, c++11, c++14
+// UNSUPPORTED: c++98, c++03, c++11, c++14
// <unordered_map>
@@ -22,12 +22,10 @@
// template <class M>
// iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); // C++17
-#include <__config>
#include <unordered_map>
#include <cassert>
#include <tuple>
-#include <iostream>
class Moveable
{
@@ -53,7 +51,7 @@ public:
bool operator<(const Moveable& x) const
{return int_ < x.int_ || (int_ == x.int_ && double_ < x.double_);}
size_t hash () const { return std::hash<int>()(int_) + std::hash<double>()(double_); }
-
+
int get() const {return int_;}
bool moved() const {return int_ == -1;}
};
@@ -66,8 +64,6 @@ namespace std {
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
{ // pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj);
typedef std::unordered_map<int, Moveable> M;
@@ -193,6 +189,4 @@ int main()
assert(r->second.get() == 5); // value
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
} \ No newline at end of file
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_range.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_range.pass.cpp
index fc44e7828ffa..fc44e7828ffa 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_range.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_range.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_rvalue.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue.pass.cpp
index f53dc6c7e97a..f53dc6c7e97a 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/insert_rvalue.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue.pass.cpp
diff --git a/test/std/containers/unord/unord.map/unorder.map.modifiers/try.emplace.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
index e6964ce947b5..eabcf2e85db2 100644
--- a/test/std/containers/unord/unord.map/unorder.map.modifiers/try.emplace.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// UNSUPPORTED: c++03, c++11, c++14
+// UNSUPPORTED: c++98, c++03, c++11, c++14
// <unordered_map>
@@ -64,8 +64,6 @@ namespace std {
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
{ // pair<iterator, bool> try_emplace(const key_type& k, Args&&... args);
typedef std::unordered_map<int, Moveable> M;
@@ -110,7 +108,7 @@ int main()
assert(r.first->second.get() == -1); // value
}
- { // pair<iterator, bool> try_emplace(key_type&& k, Args&&... args);
+ { // pair<iterator, bool> try_emplace(key_type&& k, Args&&... args);
typedef std::unordered_map<Moveable, Moveable> M;
typedef std::pair<M::iterator, bool> R;
M m;
@@ -146,7 +144,7 @@ int main()
m.try_emplace ( i, Moveable(i, (double) i));
assert(m.size() == 10);
M::const_iterator it = m.find(2);
-
+
Moveable mv1(3, 3.0);
for (int i=0; i < 20; i += 2)
{
@@ -189,7 +187,4 @@ int main()
assert(r->first.get() == 3); // key
assert(r->second.get() == 4); // value
}
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
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 7e04b8db117c..f3d51f6da275 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
@@ -21,6 +21,7 @@
#include "../../../test_compare.h"
#include "../../../test_hash.h"
+#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
@@ -31,7 +32,6 @@ 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;
- 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));
c2.max_load_factor(2);
@@ -212,7 +212,6 @@ int main()
typedef test_compare<std::equal_to<int> > Compare;
typedef other_allocator<std::pair<const int, std::string> > Alloc;
typedef std::unordered_map<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));
c2.max_load_factor(2);
@@ -387,13 +386,12 @@ int main()
assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
assert(c2.max_load_factor() == 1);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef test_hash<std::hash<int> > Hash;
typedef test_compare<std::equal_to<int> > Compare;
typedef min_allocator<std::pair<const int, std::string> > Alloc;
typedef std::unordered_map<int, std::string, Hash, Compare, Alloc> C;
- typedef std::pair<int, std::string> P;
C c1(0, Hash(1), Compare(1), Alloc());
C c2(0, Hash(2), Compare(2), Alloc());
c2.max_load_factor(2);
diff --git a/test/std/containers/unord/unord.multimap/allocator_mismatch.fail.cpp b/test/std/containers/unord/unord.multimap/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..3c740950d04e
--- /dev/null
+++ b/test/std/containers/unord/unord.multimap/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+// The container's value type must be the same as the allocator's value type
+
+#include <unordered_map>
+
+int main()
+{
+ std::unordered_multimap<int, int, std::hash<int>, std::less<int>, std::allocator<long> > m;
+}
diff --git a/test/std/containers/unord/unord.multimap/rehash.pass.cpp b/test/std/containers/unord/unord.multimap/rehash.pass.cpp
index 1d99208596c1..d36dc42e262d 100644
--- a/test/std/containers/unord/unord.multimap/rehash.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/rehash.pass.cpp
@@ -23,6 +23,12 @@
#include "min_allocator.h"
template <class C>
+void rehash_postcondition(const C& c, size_t n)
+{
+ assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
+}
+
+template <class C>
void test(const C& c)
{
assert(c.size() == 6);
@@ -77,13 +83,16 @@ int main()
test(c);
assert(c.bucket_count() >= 7);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 7);
test(c);
c.max_load_factor(2);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 3);
test(c);
c.rehash(31);
+ rehash_postcondition(c, 31);
assert(c.bucket_count() == 31);
test(c);
}
@@ -105,13 +114,16 @@ int main()
test(c);
assert(c.bucket_count() >= 7);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 7);
test(c);
c.max_load_factor(2);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 3);
test(c);
c.rehash(31);
+ rehash_postcondition(c, 31);
assert(c.bucket_count() == 31);
test(c);
}
diff --git a/test/std/containers/unord/unord.multimap/reserve.pass.cpp b/test/std/containers/unord/unord.multimap/reserve.pass.cpp
index 801c74457d74..388b1f67e450 100644
--- a/test/std/containers/unord/unord.multimap/reserve.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/reserve.pass.cpp
@@ -33,6 +33,21 @@ void test(const C& c)
assert(c.find(4)->second == "four");
}
+void reserve_invariant(size_t n) // LWG #2156
+{
+ for (size_t i = 0; i < n; ++i)
+ {
+ std::unordered_multimap<size_t, size_t> c;
+ c.reserve(n);
+ size_t buckets = c.bucket_count();
+ for (size_t j = 0; j < i; ++j)
+ {
+ c.insert(std::unordered_multimap<size_t, size_t>::value_type(i,i));
+ assert(buckets == c.bucket_count());
+ }
+ }
+}
+
int main()
{
{
@@ -90,4 +105,5 @@ int main()
test(c);
}
#endif
+ reserve_invariant(20);
}
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 37c8119060b7..7c912e01d572 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
@@ -116,7 +116,7 @@ struct some_alloc3
int main()
{
#if __has_feature(cxx_noexcept)
- typedef std::pair<const MoveOnly, MoveOnly> MapType;
+ typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::unordered_multimap<MoveOnly, MoveOnly> C;
C c1, c2;
@@ -124,13 +124,13 @@ int main()
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
- std::equal_to<MoveOnly>, test_allocator<MapType>> C;
+ std::equal_to<MoveOnly>, test_allocator<V>> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
- std::equal_to<MoveOnly>, other_allocator<MapType>> C;
+ std::equal_to<MoveOnly>, other_allocator<V>> C;
C c1, c2;
static_assert(noexcept(swap(c1, c2)), "");
}
@@ -148,47 +148,47 @@ int main()
#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 <MapType>> C;
+ 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)), "");
}
{ // 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<MapType>> C;
+ 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)), "");
}
{ // POCS allocator, throwable swap for hash, nothrow swap for comp
- typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc <MapType>> C;
+ 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)), "");
}
{ // 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<MapType>> C;
+ 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)), "");
}
{ // POCS allocator, nothrow swap for hash, throwable swap for comp
- typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc <MapType>> C;
+ 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)), "");
}
{ // 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<MapType>> C;
+ 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)), "");
}
{ // POCS allocator, nothrow swap for hash, nothrow swap for comp
- typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc <MapType>> C;
+ 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)), "");
}
{ // 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<MapType>> C;
+ 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)), "");
}
{ // 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<MapType>> C;
+ 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)), "");
}
diff --git a/test/std/containers/unord/unord.multiset/allocator_mismatch.fail.cpp b/test/std/containers/unord/unord.multiset/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..5836cb366159
--- /dev/null
+++ b/test/std/containers/unord/unord.multiset/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+// The container's value type must be the same as the allocator's value type
+
+#include <unordered_set>
+
+int main()
+{
+ std::unordered_multiset<int, std::hash<int>, std::less<int>, std::allocator<long> > v;
+}
diff --git a/test/std/containers/unord/unord.multiset/rehash.pass.cpp b/test/std/containers/unord/unord.multiset/rehash.pass.cpp
index bc8d461c60bf..5c7c6aa8aad3 100644
--- a/test/std/containers/unord/unord.multiset/rehash.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/rehash.pass.cpp
@@ -21,6 +21,12 @@
#include "min_allocator.h"
template <class C>
+void rehash_postcondition(const C& c, size_t n)
+{
+ assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
+}
+
+template <class C>
void test(const C& c)
{
assert(c.size() == 6);
@@ -48,13 +54,16 @@ int main()
test(c);
assert(c.bucket_count() >= 7);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 7);
test(c);
c.max_load_factor(2);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 3);
test(c);
c.rehash(31);
+ rehash_postcondition(c, 31);
assert(c.bucket_count() == 31);
test(c);
}
@@ -76,13 +85,16 @@ int main()
test(c);
assert(c.bucket_count() >= 7);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 7);
test(c);
c.max_load_factor(2);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 3);
test(c);
c.rehash(31);
+ rehash_postcondition(c, 31);
assert(c.bucket_count() == 31);
test(c);
}
diff --git a/test/std/containers/unord/unord.multiset/reserve.pass.cpp b/test/std/containers/unord/unord.multiset/reserve.pass.cpp
index 0c17583d371d..1d393a09cde2 100644
--- a/test/std/containers/unord/unord.multiset/reserve.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/reserve.pass.cpp
@@ -30,6 +30,21 @@ void test(const C& c)
assert(c.count(4) == 1);
}
+void reserve_invariant(size_t n) // LWG #2156
+{
+ for (size_t i = 0; i < n; ++i)
+ {
+ std::unordered_multiset<size_t> c;
+ c.reserve(n);
+ size_t buckets = c.bucket_count();
+ for (size_t j = 0; j < i; ++j)
+ {
+ c.insert(i);
+ assert(buckets == c.bucket_count());
+ }
+ }
+}
+
int main()
{
{
@@ -87,4 +102,5 @@ int main()
test(c);
}
#endif
+ reserve_invariant(20);
}
diff --git a/test/std/containers/unord/unord.set/allocator_mismatch.fail.cpp b/test/std/containers/unord/unord.set/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..b87c9a24d3a5
--- /dev/null
+++ b/test/std/containers/unord/unord.set/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+// The container's value type must be the same as the allocator's value type
+
+#include <unordered_set>
+
+int main()
+{
+ std::unordered_set<int, std::hash<int>, std::less<int>, std::allocator<long> > v;
+}
diff --git a/test/std/containers/unord/unord.set/rehash.pass.cpp b/test/std/containers/unord/unord.set/rehash.pass.cpp
index 30fffa561f78..e28c25dc8197 100644
--- a/test/std/containers/unord/unord.set/rehash.pass.cpp
+++ b/test/std/containers/unord/unord.set/rehash.pass.cpp
@@ -21,6 +21,12 @@
#include "min_allocator.h"
template <class C>
+void rehash_postcondition(const C& c, size_t n)
+{
+ assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
+}
+
+template <class C>
void test(const C& c)
{
assert(c.size() == 4);
@@ -48,13 +54,16 @@ int main()
test(c);
assert(c.bucket_count() >= 5);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 5);
test(c);
c.max_load_factor(2);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 3);
test(c);
c.rehash(31);
+ rehash_postcondition(c, 31);
assert(c.bucket_count() == 31);
test(c);
}
@@ -76,13 +85,16 @@ int main()
test(c);
assert(c.bucket_count() >= 5);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 5);
test(c);
c.max_load_factor(2);
c.rehash(3);
+ rehash_postcondition(c, 3);
assert(c.bucket_count() == 3);
test(c);
c.rehash(31);
+ rehash_postcondition(c, 31);
assert(c.bucket_count() == 31);
test(c);
}
diff --git a/test/std/containers/unord/unord.set/reserve.pass.cpp b/test/std/containers/unord/unord.set/reserve.pass.cpp
index 7d6656a18674..078b886b267e 100644
--- a/test/std/containers/unord/unord.set/reserve.pass.cpp
+++ b/test/std/containers/unord/unord.set/reserve.pass.cpp
@@ -30,6 +30,21 @@ void test(const C& c)
assert(c.count(4) == 1);
}
+void reserve_invariant(size_t n) // LWG #2156
+{
+ for (size_t i = 0; i < n; ++i)
+ {
+ std::unordered_set<size_t> c;
+ c.reserve(n);
+ size_t buckets = c.bucket_count();
+ for (size_t j = 0; j < i; ++j)
+ {
+ c.insert(i);
+ assert(buckets == c.bucket_count());
+ }
+ }
+}
+
int main()
{
{
@@ -87,4 +102,5 @@ int main()
test(c);
}
#endif
+ reserve_invariant(20);
}
diff --git a/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp b/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp
index f61a28e84d4c..a5db81e6c632 100644
--- a/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp
+++ b/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp
@@ -24,6 +24,10 @@ test()
B* p1 = new B(1);
std::auto_ptr<B> ap1(p1);
std::auto_ptr_ref<A> apr = ap1;
+ std::auto_ptr<A> ap2(apr);
+ assert(ap1.get() == nullptr);
+ assert(ap2.get() == p1);
+ ap2.release();
delete p1;
}
diff --git a/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp b/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp
index 2d1c2af8062d..256563439a17 100644
--- a/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp
+++ b/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp
@@ -25,6 +25,8 @@ void
test()
{
static_assert((std::is_same<typename std::auto_ptr<T>::element_type, T>::value), "");
+ std::auto_ptr<T> p;
+ ((void)p);
}
int main()
@@ -32,5 +34,4 @@ int main()
test<int>();
test<double>();
test<void>();
- std::auto_ptr<void> p;
}
diff --git a/test/std/depr/depr.c.headers/extern_c.pass.cpp b/test/std/depr/depr.c.headers/extern_c.pass.cpp
new file mode 100644
index 000000000000..d4d8b5fafdde
--- /dev/null
+++ b/test/std/depr/depr.c.headers/extern_c.pass.cpp
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// Sometimes C++'s <foo.h> headers get included within extern "C" contexts. This
+// is ill-formed (no diagnostic required), per [using.headers]p3, but we permit
+// it as an extension.
+
+extern "C" {
+#include <assert.h>
+// complex.h is not supported in extern "C".
+#include <ctype.h>
+#include <errno.h>
+#include <fenv.h>
+#include <float.h>
+#include <inttypes.h>
+#include <iso646.h>
+#include <limits.h>
+#include <locale.h>
+#include <math.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdalign.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+// tgmath.h is not supported in extern "C".
+#include <time.h>
+// FIXME: #include <uchar.h>
+#include <wchar.h>
+#include <wctype.h>
+}
+
+int main() {}
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 4adf82da95ec..637cf72287b8 100644
--- a/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
@@ -12,6 +12,250 @@
#include <inttypes.h>
#include <type_traits>
+#ifndef INT8_MIN
+#error INT8_MIN not defined
+#endif
+
+#ifndef INT16_MIN
+#error INT16_MIN not defined
+#endif
+
+#ifndef INT32_MIN
+#error INT32_MIN not defined
+#endif
+
+#ifndef INT64_MIN
+#error INT64_MIN not defined
+#endif
+
+#ifndef INT8_MAX
+#error INT8_MAX not defined
+#endif
+
+#ifndef INT16_MAX
+#error INT16_MAX not defined
+#endif
+
+#ifndef INT32_MAX
+#error INT32_MAX not defined
+#endif
+
+#ifndef INT64_MAX
+#error INT64_MAX not defined
+#endif
+
+#ifndef UINT8_MAX
+#error UINT8_MAX not defined
+#endif
+
+#ifndef UINT16_MAX
+#error UINT16_MAX not defined
+#endif
+
+#ifndef UINT32_MAX
+#error UINT32_MAX not defined
+#endif
+
+#ifndef UINT64_MAX
+#error UINT64_MAX not defined
+#endif
+
+#ifndef INT_LEAST8_MIN
+#error INT_LEAST8_MIN not defined
+#endif
+
+#ifndef INT_LEAST16_MIN
+#error INT_LEAST16_MIN not defined
+#endif
+
+#ifndef INT_LEAST32_MIN
+#error INT_LEAST32_MIN not defined
+#endif
+
+#ifndef INT_LEAST64_MIN
+#error INT_LEAST64_MIN not defined
+#endif
+
+#ifndef INT_LEAST8_MAX
+#error INT_LEAST8_MAX not defined
+#endif
+
+#ifndef INT_LEAST16_MAX
+#error INT_LEAST16_MAX not defined
+#endif
+
+#ifndef INT_LEAST32_MAX
+#error INT_LEAST32_MAX not defined
+#endif
+
+#ifndef INT_LEAST64_MAX
+#error INT_LEAST64_MAX not defined
+#endif
+
+#ifndef UINT_LEAST8_MAX
+#error UINT_LEAST8_MAX not defined
+#endif
+
+#ifndef UINT_LEAST16_MAX
+#error UINT_LEAST16_MAX not defined
+#endif
+
+#ifndef UINT_LEAST32_MAX
+#error UINT_LEAST32_MAX not defined
+#endif
+
+#ifndef UINT_LEAST64_MAX
+#error UINT_LEAST64_MAX not defined
+#endif
+
+#ifndef INT_FAST8_MIN
+#error INT_FAST8_MIN not defined
+#endif
+
+#ifndef INT_FAST16_MIN
+#error INT_FAST16_MIN not defined
+#endif
+
+#ifndef INT_FAST32_MIN
+#error INT_FAST32_MIN not defined
+#endif
+
+#ifndef INT_FAST64_MIN
+#error INT_FAST64_MIN not defined
+#endif
+
+#ifndef INT_FAST8_MAX
+#error INT_FAST8_MAX not defined
+#endif
+
+#ifndef INT_FAST16_MAX
+#error INT_FAST16_MAX not defined
+#endif
+
+#ifndef INT_FAST32_MAX
+#error INT_FAST32_MAX not defined
+#endif
+
+#ifndef INT_FAST64_MAX
+#error INT_FAST64_MAX not defined
+#endif
+
+#ifndef UINT_FAST8_MAX
+#error UINT_FAST8_MAX not defined
+#endif
+
+#ifndef UINT_FAST16_MAX
+#error UINT_FAST16_MAX not defined
+#endif
+
+#ifndef UINT_FAST32_MAX
+#error UINT_FAST32_MAX not defined
+#endif
+
+#ifndef UINT_FAST64_MAX
+#error UINT_FAST64_MAX not defined
+#endif
+
+#ifndef INTPTR_MIN
+#error INTPTR_MIN not defined
+#endif
+
+#ifndef INTPTR_MAX
+#error INTPTR_MAX not defined
+#endif
+
+#ifndef UINTPTR_MAX
+#error UINTPTR_MAX not defined
+#endif
+
+#ifndef INTMAX_MIN
+#error INTMAX_MIN not defined
+#endif
+
+#ifndef INTMAX_MAX
+#error INTMAX_MAX not defined
+#endif
+
+#ifndef UINTMAX_MAX
+#error UINTMAX_MAX not defined
+#endif
+
+#ifndef PTRDIFF_MIN
+#error PTRDIFF_MIN not defined
+#endif
+
+#ifndef PTRDIFF_MAX
+#error PTRDIFF_MAX not defined
+#endif
+
+#ifndef SIG_ATOMIC_MIN
+#error SIG_ATOMIC_MIN not defined
+#endif
+
+#ifndef SIG_ATOMIC_MAX
+#error SIG_ATOMIC_MAX not defined
+#endif
+
+#ifndef SIZE_MAX
+#error SIZE_MAX not defined
+#endif
+
+#ifndef WCHAR_MIN
+#error WCHAR_MIN not defined
+#endif
+
+#ifndef WCHAR_MAX
+#error WCHAR_MAX not defined
+#endif
+
+#ifndef WINT_MIN
+#error WINT_MIN not defined
+#endif
+
+#ifndef WINT_MAX
+#error WINT_MAX not defined
+#endif
+
+#ifndef INT8_C
+#error INT8_C not defined
+#endif
+
+#ifndef INT16_C
+#error INT16_C not defined
+#endif
+
+#ifndef INT32_C
+#error INT32_C not defined
+#endif
+
+#ifndef INT64_C
+#error INT64_C not defined
+#endif
+
+#ifndef UINT8_C
+#error UINT8_C not defined
+#endif
+
+#ifndef UINT16_C
+#error UINT16_C not defined
+#endif
+
+#ifndef UINT32_C
+#error UINT32_C not defined
+#endif
+
+#ifndef UINT64_C
+#error UINT64_C not defined
+#endif
+
+#ifndef INTMAX_C
+#error INTMAX_C not defined
+#endif
+
+#ifndef UINTMAX_C
+#error UINTMAX_C not defined
+#endif
+
#ifndef PRId8
#error PRId8 not defined
#endif
@@ -631,6 +875,48 @@
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;
+ }
+ {
imaxdiv_t i1 = {0};
}
intmax_t i = 0;
diff --git a/test/std/depr/depr.c.headers/locale_h.pass.cpp b/test/std/depr/depr.c.headers/locale_h.pass.cpp
index 6ecf5a82e8dd..f5735b6ea19d 100644
--- a/test/std/depr/depr.c.headers/locale_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/locale_h.pass.cpp
@@ -42,7 +42,7 @@
int main()
{
- lconv lc;
+ lconv lc; ((void)lc);
static_assert((std::is_same<decltype(setlocale(0, "")), char*>::value), "");
static_assert((std::is_same<decltype(localeconv()), lconv*>::value), "");
}
diff --git a/test/std/depr/depr.c.headers/math_h.pass.cpp b/test/std/depr/depr.c.headers/math_h.pass.cpp
index b03a61b15e11..ed12fcf73a8c 100644
--- a/test/std/depr/depr.c.headers/math_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/math_h.pass.cpp
@@ -9,7 +9,8 @@
// <math.h>
-// XFAIL: linux
+// NOTE: isinf and isnan are tested separately because they are expected to fail
+// on linux. We don't want their expected failure to hide other failures in this file.
#include <math.h>
#include <type_traits>
@@ -17,498 +18,1168 @@
#include "hexfloat.h"
+// convertible to int/float/double/etc
+template <class T, int N=0>
+struct Value {
+ operator T () { return T(N); }
+};
+
+// See PR21083
+// Ambiguous is a user-defined type that defines its own overloads of cmath
+// functions. When the std overloads are candidates too (by using or adl),
+// they should not interfere.
+struct Ambiguous : std::true_type { // ADL
+ operator float () { return 0.f; }
+ operator double () { return 0.; }
+};
+Ambiguous abs(Ambiguous){ return Ambiguous(); }
+Ambiguous acos(Ambiguous){ return Ambiguous(); }
+Ambiguous asin(Ambiguous){ return Ambiguous(); }
+Ambiguous atan(Ambiguous){ return Ambiguous(); }
+Ambiguous atan2(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous ceil(Ambiguous){ return Ambiguous(); }
+Ambiguous cos(Ambiguous){ return Ambiguous(); }
+Ambiguous cosh(Ambiguous){ return Ambiguous(); }
+Ambiguous exp(Ambiguous){ return Ambiguous(); }
+Ambiguous fabs(Ambiguous){ return Ambiguous(); }
+Ambiguous floor(Ambiguous){ return Ambiguous(); }
+Ambiguous fmod(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous frexp(Ambiguous, int*){ return Ambiguous(); }
+Ambiguous ldexp(Ambiguous, int){ return Ambiguous(); }
+Ambiguous log(Ambiguous){ return Ambiguous(); }
+Ambiguous log10(Ambiguous){ return Ambiguous(); }
+Ambiguous modf(Ambiguous, Ambiguous*){ return Ambiguous(); }
+Ambiguous pow(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous sin(Ambiguous){ return Ambiguous(); }
+Ambiguous sinh(Ambiguous){ return Ambiguous(); }
+Ambiguous sqrt(Ambiguous){ return Ambiguous(); }
+Ambiguous tan(Ambiguous){ return Ambiguous(); }
+Ambiguous tanh(Ambiguous){ return Ambiguous(); }
+Ambiguous signbit(Ambiguous){ return Ambiguous(); }
+Ambiguous fpclassify(Ambiguous){ return Ambiguous(); }
+Ambiguous isfinite(Ambiguous){ return Ambiguous(); }
+Ambiguous isnormal(Ambiguous){ return Ambiguous(); }
+Ambiguous isgreater(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous isgreaterequal(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous isless(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous islessequal(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous islessgreater(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous isunordered(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous acosh(Ambiguous){ return Ambiguous(); }
+Ambiguous asinh(Ambiguous){ return Ambiguous(); }
+Ambiguous atanh(Ambiguous){ return Ambiguous(); }
+Ambiguous cbrt(Ambiguous){ return Ambiguous(); }
+Ambiguous copysign(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous erf(Ambiguous){ return Ambiguous(); }
+Ambiguous erfc(Ambiguous){ return Ambiguous(); }
+Ambiguous exp2(Ambiguous){ return Ambiguous(); }
+Ambiguous expm1(Ambiguous){ return Ambiguous(); }
+Ambiguous fdim(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous fma(Ambiguous, Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous fmax(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous fmin(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous hypot(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous ilogb(Ambiguous){ return Ambiguous(); }
+Ambiguous lgamma(Ambiguous){ return Ambiguous(); }
+Ambiguous llrint(Ambiguous){ return Ambiguous(); }
+Ambiguous llround(Ambiguous){ return Ambiguous(); }
+Ambiguous log1p(Ambiguous){ return Ambiguous(); }
+Ambiguous log2(Ambiguous){ return Ambiguous(); }
+Ambiguous logb(Ambiguous){ return Ambiguous(); }
+Ambiguous lrint(Ambiguous){ return Ambiguous(); }
+Ambiguous lround(Ambiguous){ return Ambiguous(); }
+Ambiguous nearbyint(Ambiguous){ return Ambiguous(); }
+Ambiguous nextafter(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous nexttoward(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous remainder(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous remquo(Ambiguous, Ambiguous, int*){ return Ambiguous(); }
+Ambiguous rint(Ambiguous){ return Ambiguous(); }
+Ambiguous round(Ambiguous){ return Ambiguous(); }
+Ambiguous scalbln(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous scalbn(Ambiguous, Ambiguous){ return Ambiguous(); }
+Ambiguous tgamma(Ambiguous){ return Ambiguous(); }
+Ambiguous trunc(Ambiguous){ return Ambiguous(); }
+
+void test_abs()
+{
+ static_assert((std::is_same<decltype(abs((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(abs((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(abs((long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(abs(Ambiguous())), Ambiguous>::value), "");
+ assert(abs(-1.) == 1);
+}
+
void test_acos()
{
+ static_assert((std::is_same<decltype(acos((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(acos((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acos((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acos((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acos((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acos((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acos((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acos((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acos((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(acos((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acos((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(acosf(0)), float>::value), "");
static_assert((std::is_same<decltype(acosl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(acos(Ambiguous())), Ambiguous>::value), "");
assert(acos(1) == 0);
}
void test_asin()
{
+ static_assert((std::is_same<decltype(asin((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(asin((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asin((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asin((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asin((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asin((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asin((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asin((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asin((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(asin((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asin((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(asinf(0)), float>::value), "");
static_assert((std::is_same<decltype(asinl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(asin(Ambiguous())), Ambiguous>::value), "");
assert(asin(0) == 0);
}
void test_atan()
{
+ static_assert((std::is_same<decltype(atan((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(atan((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(atan((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(atanf(0)), float>::value), "");
static_assert((std::is_same<decltype(atanl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(atan(Ambiguous())), Ambiguous>::value), "");
assert(atan(0) == 0);
}
void test_atan2()
{
+ static_assert((std::is_same<decltype(atan2((float)0, (float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(atan2((bool)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan2((unsigned short)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan2((int)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(atan2((float)0, (unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan2((double)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan2((long double)0, (unsigned long)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(atan2((int)0, (long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan2((int)0, (unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(atan2((double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan2((long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(atan2((float)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan2((float)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(atan2((double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(atan2f(0,0)), float>::value), "");
static_assert((std::is_same<decltype(atan2l(0,0)), long double>::value), "");
+ static_assert((std::is_same<decltype(atan2((int)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atan2(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(atan2(0,1) == 0);
}
void test_ceil()
{
+ static_assert((std::is_same<decltype(ceil((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(ceil((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(ceil((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(ceil((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(ceil((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(ceil((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(ceil((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(ceil((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(ceil((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(ceil((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(ceil((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(ceilf(0)), float>::value), "");
static_assert((std::is_same<decltype(ceill(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(ceil(Ambiguous())), Ambiguous>::value), "");
assert(ceil(0) == 0);
}
void test_cos()
{
+ static_assert((std::is_same<decltype(cos((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(cos((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cos((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cos((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cos((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cos((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cos((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cos((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cos((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(cos((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cos((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(cosf(0)), float>::value), "");
static_assert((std::is_same<decltype(cosl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(cos(Ambiguous())), Ambiguous>::value), "");
assert(cos(0) == 1);
}
void test_cosh()
{
+ static_assert((std::is_same<decltype(cosh((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(cosh((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cosh((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cosh((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cosh((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cosh((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cosh((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cosh((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cosh((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(cosh((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cosh((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(coshf(0)), float>::value), "");
static_assert((std::is_same<decltype(coshl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(cosh(Ambiguous())), Ambiguous>::value), "");
assert(cosh(0) == 1);
}
void test_exp()
{
+ static_assert((std::is_same<decltype(exp((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(exp((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(exp((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(expf(0)), float>::value), "");
static_assert((std::is_same<decltype(expl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(exp(Ambiguous())), Ambiguous>::value), "");
assert(exp(0) == 1);
}
void test_fabs()
{
+ static_assert((std::is_same<decltype(fabs((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(fabs((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fabs((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fabs((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fabs((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fabs((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fabs((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fabs((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fabs((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(fabs((double)0)), double>::value), "");
- static_assert((std::is_same<decltype(fabsf(0.f)), float>::value), "");
- static_assert((std::is_same<decltype(fabsl(0.L)), long double>::value), "");
- assert(fabs(-1.f) == 1);
+ static_assert((std::is_same<decltype(fabs((long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fabsf(0.0f)), float>::value), "");
+ static_assert((std::is_same<decltype(fabsl(0.0L)), long double>::value), "");
+ static_assert((std::is_same<decltype(fabs(Ambiguous())), Ambiguous>::value), "");
+ assert(fabs(-1) == 1);
}
void test_floor()
{
+ static_assert((std::is_same<decltype(floor((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(floor((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(floor((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(floor((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(floor((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(floor((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(floor((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(floor((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(floor((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(floor((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(floor((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(floorf(0)), float>::value), "");
static_assert((std::is_same<decltype(floorl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(floor(Ambiguous())), Ambiguous>::value), "");
assert(floor(1) == 1);
}
void test_fmod()
{
+ static_assert((std::is_same<decltype(fmod((float)0, (float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(fmod((bool)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmod((unsigned short)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmod((int)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmod((float)0, (unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmod((double)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmod((long double)0, (unsigned long)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmod((int)0, (long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmod((int)0, (unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(fmod((double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmod((long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmod((float)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmod((float)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmod((double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(fmodf(0,0)), float>::value), "");
static_assert((std::is_same<decltype(fmodl(0,0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmod((int)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmod(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(fmod(1.5,1) == .5);
}
void test_frexp()
{
int ip;
+ static_assert((std::is_same<decltype(frexp((float)0, &ip)), float>::value), "");
+ static_assert((std::is_same<decltype(frexp((bool)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(frexp((unsigned short)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(frexp((int)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(frexp((unsigned int)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(frexp((long)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(frexp((unsigned long)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(frexp((long long)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(frexp((unsigned long long)0, &ip)), double>::value), "");
static_assert((std::is_same<decltype(frexp((double)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(frexp((long double)0, &ip)), long double>::value), "");
static_assert((std::is_same<decltype(frexpf(0, &ip)), float>::value), "");
static_assert((std::is_same<decltype(frexpl(0, &ip)), long double>::value), "");
+ static_assert((std::is_same<decltype(frexp(Ambiguous(), &ip)), Ambiguous>::value), "");
assert(frexp(0, &ip) == 0);
}
void test_ldexp()
{
int ip = 1;
+ static_assert((std::is_same<decltype(ldexp((float)0, ip)), float>::value), "");
+ static_assert((std::is_same<decltype(ldexp((bool)0, ip)), double>::value), "");
+ static_assert((std::is_same<decltype(ldexp((unsigned short)0, ip)), double>::value), "");
+ static_assert((std::is_same<decltype(ldexp((int)0, ip)), double>::value), "");
+ static_assert((std::is_same<decltype(ldexp((unsigned int)0, ip)), double>::value), "");
+ static_assert((std::is_same<decltype(ldexp((long)0, ip)), double>::value), "");
+ static_assert((std::is_same<decltype(ldexp((unsigned long)0, ip)), double>::value), "");
+ static_assert((std::is_same<decltype(ldexp((long long)0, ip)), double>::value), "");
+ static_assert((std::is_same<decltype(ldexp((unsigned long long)0, ip)), double>::value), "");
static_assert((std::is_same<decltype(ldexp((double)0, ip)), double>::value), "");
+ static_assert((std::is_same<decltype(ldexp((long double)0, ip)), long double>::value), "");
static_assert((std::is_same<decltype(ldexpf(0, ip)), float>::value), "");
static_assert((std::is_same<decltype(ldexpl(0, ip)), long double>::value), "");
+ static_assert((std::is_same<decltype(ldexp(Ambiguous(), ip)), Ambiguous>::value), "");
assert(ldexp(1, ip) == 2);
}
void test_log()
{
+ static_assert((std::is_same<decltype(log((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(log((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(log((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(logf(0)), float>::value), "");
static_assert((std::is_same<decltype(logl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(log(Ambiguous())), Ambiguous>::value), "");
assert(log(1) == 0);
}
void test_log10()
{
+ static_assert((std::is_same<decltype(log10((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(log10((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log10((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log10((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log10((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log10((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log10((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log10((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log10((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(log10((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log10((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(log10f(0)), float>::value), "");
static_assert((std::is_same<decltype(log10l(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(log10(Ambiguous())), Ambiguous>::value), "");
assert(log10(1) == 0);
}
void test_modf()
{
+ static_assert((std::is_same<decltype(modf((float)0, (float*)0)), float>::value), "");
static_assert((std::is_same<decltype(modf((double)0, (double*)0)), double>::value), "");
+ static_assert((std::is_same<decltype(modf((long double)0, (long double*)0)), long double>::value), "");
static_assert((std::is_same<decltype(modff(0, (float*)0)), float>::value), "");
static_assert((std::is_same<decltype(modfl(0, (long double*)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(modf(Ambiguous(), (Ambiguous*)0)), Ambiguous>::value), "");
double i;
assert(modf(1., &i) == 0);
}
void test_pow()
{
+ static_assert((std::is_same<decltype(pow((float)0, (float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(pow((bool)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(pow((unsigned short)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(pow((int)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(pow((float)0, (unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(pow((double)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(pow((long double)0, (unsigned long)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(pow((int)0, (long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(pow((int)0, (unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(pow((double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(pow((long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(pow((float)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(pow((float)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(pow((double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(powf(0,0)), float>::value), "");
static_assert((std::is_same<decltype(powl(0,0)), long double>::value), "");
+ static_assert((std::is_same<decltype(pow((int)0, (int)0)), double>::value), "");
+// static_assert((std::is_same<decltype(pow(Value<int>(), (int)0)), double>::value), "");
+// static_assert((std::is_same<decltype(pow(Value<long double>(), (float)0)), long double>::value), "");
+// static_assert((std::is_same<decltype(pow((float) 0, Value<float>())), float>::value), "");
+ static_assert((std::is_same<decltype(pow(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(pow(1,1) == 1);
+// assert(pow(Value<int,1>(), Value<float,1>()) == 1);
+// assert(pow(1.0f, Value<double,1>()) == 1);
+// assert(pow(1.0, Value<int,1>()) == 1);
+// assert(pow(Value<long double,1>(), 1LL) == 1);
}
void test_sin()
{
+ static_assert((std::is_same<decltype(sin((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(sin((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sin((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sin((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sin((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sin((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sin((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sin((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sin((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(sin((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sin((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(sinf(0)), float>::value), "");
static_assert((std::is_same<decltype(sinl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(sin(Ambiguous())), Ambiguous>::value), "");
assert(sin(0) == 0);
}
void test_sinh()
{
+ static_assert((std::is_same<decltype(sinh((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(sinh((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sinh((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sinh((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sinh((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sinh((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sinh((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sinh((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sinh((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(sinh((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sinh((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(sinhf(0)), float>::value), "");
static_assert((std::is_same<decltype(sinhl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(sinh(Ambiguous())), Ambiguous>::value), "");
assert(sinh(0) == 0);
}
void test_sqrt()
{
+ static_assert((std::is_same<decltype(sqrt((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(sqrt((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sqrt((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sqrt((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sqrt((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sqrt((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sqrt((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sqrt((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sqrt((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(sqrt((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(sqrt((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(sqrtf(0)), float>::value), "");
static_assert((std::is_same<decltype(sqrtl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(sqrt(Ambiguous())), Ambiguous>::value), "");
assert(sqrt(4) == 2);
}
void test_tan()
{
+ static_assert((std::is_same<decltype(tan((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(tan((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tan((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tan((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tan((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tan((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tan((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tan((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tan((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(tan((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tan((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(tanf(0)), float>::value), "");
static_assert((std::is_same<decltype(tanl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(tan(Ambiguous())), Ambiguous>::value), "");
assert(tan(0) == 0);
}
void test_tanh()
{
+ static_assert((std::is_same<decltype(tanh((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(tanh((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tanh((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tanh((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tanh((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tanh((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tanh((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tanh((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tanh((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(tanh((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tanh((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(tanhf(0)), float>::value), "");
static_assert((std::is_same<decltype(tanhl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(tanh(Ambiguous())), Ambiguous>::value), "");
assert(tanh(0) == 0);
}
void test_signbit()
{
+#ifdef signbit
+#error signbit defined
+#endif
static_assert((std::is_same<decltype(signbit((float)0)), bool>::value), "");
static_assert((std::is_same<decltype(signbit((double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(signbit(0)), bool>::value), "");
static_assert((std::is_same<decltype(signbit((long double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(signbit(Ambiguous())), Ambiguous>::value), "");
assert(signbit(-1.0) == true);
}
void test_fpclassify()
{
+#ifdef fpclassify
+#error fpclassify defined
+#endif
static_assert((std::is_same<decltype(fpclassify((float)0)), int>::value), "");
static_assert((std::is_same<decltype(fpclassify((double)0)), int>::value), "");
+ static_assert((std::is_same<decltype(fpclassify(0)), int>::value), "");
static_assert((std::is_same<decltype(fpclassify((long double)0)), int>::value), "");
+ static_assert((std::is_same<decltype(fpclassify(Ambiguous())), Ambiguous>::value), "");
assert(fpclassify(-1.0) == FP_NORMAL);
}
void test_isfinite()
{
+#ifdef isfinite
+#error isfinite defined
+#endif
static_assert((std::is_same<decltype(isfinite((float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isfinite((double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isfinite(0)), bool>::value), "");
static_assert((std::is_same<decltype(isfinite((long double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isfinite(Ambiguous())), Ambiguous>::value), "");
assert(isfinite(-1.0) == true);
}
-void test_isinf()
-{
- static_assert((std::is_same<decltype(isinf((float)0)), bool>::value), "");
- static_assert((std::is_same<decltype(isinf((double)0)), bool>::value), "");
- static_assert((std::is_same<decltype(isinf((long double)0)), bool>::value), "");
- assert(isinf(-1.0) == false);
-}
-
-void test_isnan()
-{
- static_assert((std::is_same<decltype(isnan((float)0)), bool>::value), "");
- static_assert((std::is_same<decltype(isnan((double)0)), bool>::value), "");
- static_assert((std::is_same<decltype(isnan((long double)0)), bool>::value), "");
- assert(isnan(-1.0) == false);
-}
-
void test_isnormal()
{
+#ifdef isnormal
+#error isnormal defined
+#endif
static_assert((std::is_same<decltype(isnormal((float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isnormal((double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isnormal(0)), bool>::value), "");
static_assert((std::is_same<decltype(isnormal((long double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isnormal(Ambiguous())), Ambiguous>::value), "");
assert(isnormal(-1.0) == true);
}
void test_isgreater()
{
+#ifdef isgreater
+#error isgreater defined
+#endif
static_assert((std::is_same<decltype(isgreater((float)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreater((float)0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreater((float)0, (long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreater((double)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreater((double)0, (double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isgreater(0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreater((double)0, (long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreater((long double)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreater((long double)0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreater((long double)0, (long double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isgreater(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(isgreater(-1.0, 0.F) == false);
}
void test_isgreaterequal()
{
+#ifdef isgreaterequal
+#error isgreaterequal defined
+#endif
static_assert((std::is_same<decltype(isgreaterequal((float)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreaterequal((float)0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreaterequal((float)0, (long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreaterequal((double)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreaterequal((double)0, (double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isgreaterequal(0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreaterequal((double)0, (long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreaterequal((long double)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreaterequal((long double)0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isgreaterequal((long double)0, (long double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isgreaterequal(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(isgreaterequal(-1.0, 0.F) == false);
}
void test_isless()
{
+#ifdef isless
+#error isless defined
+#endif
static_assert((std::is_same<decltype(isless((float)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isless((float)0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isless((float)0, (long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isless((double)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isless((double)0, (double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isless(0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isless((double)0, (long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isless((long double)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isless((long double)0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isless((long double)0, (long double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isless(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(isless(-1.0, 0.F) == true);
}
void test_islessequal()
{
+#ifdef islessequal
+#error islessequal defined
+#endif
static_assert((std::is_same<decltype(islessequal((float)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessequal((float)0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessequal((float)0, (long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessequal((double)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessequal((double)0, (double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(islessequal(0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessequal((double)0, (long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessequal((long double)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessequal((long double)0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessequal((long double)0, (long double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(islessequal(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(islessequal(-1.0, 0.F) == true);
}
void test_islessgreater()
{
+#ifdef islessgreater
+#error islessgreater defined
+#endif
static_assert((std::is_same<decltype(islessgreater((float)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessgreater((float)0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessgreater((float)0, (long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessgreater((double)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessgreater((double)0, (double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(islessgreater(0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessgreater((double)0, (long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessgreater((long double)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessgreater((long double)0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(islessgreater((long double)0, (long double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(islessgreater(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(islessgreater(-1.0, 0.F) == true);
}
void test_isunordered()
{
+#ifdef isunordered
+#error isunordered defined
+#endif
static_assert((std::is_same<decltype(isunordered((float)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isunordered((float)0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isunordered((float)0, (long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isunordered((double)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isunordered((double)0, (double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isunordered(0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isunordered((double)0, (long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isunordered((long double)0, (float)0)), bool>::value), "");
static_assert((std::is_same<decltype(isunordered((long double)0, (double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isunordered((long double)0, (long double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isunordered(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(isunordered(-1.0, 0.F) == false);
}
void test_acosh()
{
+ static_assert((std::is_same<decltype(acosh((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(acosh((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acosh((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acosh((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acosh((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acosh((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acosh((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acosh((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acosh((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(acosh((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(acosh((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(acoshf(0)), float>::value), "");
static_assert((std::is_same<decltype(acoshl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(acosh(Ambiguous())), Ambiguous>::value), "");
assert(acosh(1) == 0);
}
void test_asinh()
{
+ static_assert((std::is_same<decltype(asinh((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(asinh((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asinh((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asinh((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asinh((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asinh((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asinh((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asinh((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asinh((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(asinh((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(asinh((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(asinhf(0)), float>::value), "");
static_assert((std::is_same<decltype(asinhl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(asinh(Ambiguous())), Ambiguous>::value), "");
assert(asinh(0) == 0);
}
void test_atanh()
{
+ static_assert((std::is_same<decltype(atanh((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(atanh((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atanh((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atanh((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atanh((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atanh((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atanh((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atanh((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atanh((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(atanh((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(atanh((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(atanhf(0)), float>::value), "");
static_assert((std::is_same<decltype(atanhl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(atanh(Ambiguous())), Ambiguous>::value), "");
assert(atanh(0) == 0);
}
void test_cbrt()
{
+ static_assert((std::is_same<decltype(cbrt((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(cbrt((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cbrt((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cbrt((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cbrt((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cbrt((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cbrt((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cbrt((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cbrt((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(cbrt((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(cbrt((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(cbrtf(0)), float>::value), "");
static_assert((std::is_same<decltype(cbrtl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(cbrt(Ambiguous())), Ambiguous>::value), "");
assert(cbrt(1) == 1);
}
void test_copysign()
{
+ static_assert((std::is_same<decltype(copysign((float)0, (float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(copysign((bool)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(copysign((unsigned short)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(copysign((int)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(copysign((float)0, (unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(copysign((double)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(copysign((long double)0, (unsigned long)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(copysign((int)0, (long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(copysign((int)0, (unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(copysign((double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(copysign((long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(copysign((float)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(copysign((float)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(copysign((double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(copysignf(0,0)), float>::value), "");
static_assert((std::is_same<decltype(copysignl(0,0)), long double>::value), "");
+ static_assert((std::is_same<decltype(copysign((int)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(copysign(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(copysign(1,1) == 1);
}
void test_erf()
{
+ static_assert((std::is_same<decltype(erf((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(erf((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erf((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erf((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erf((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erf((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erf((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erf((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erf((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(erf((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erf((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(erff(0)), float>::value), "");
static_assert((std::is_same<decltype(erfl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(erf(Ambiguous())), Ambiguous>::value), "");
assert(erf(0) == 0);
}
void test_erfc()
{
+ static_assert((std::is_same<decltype(erfc((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(erfc((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erfc((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erfc((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erfc((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erfc((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erfc((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erfc((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erfc((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(erfc((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(erfc((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(erfcf(0)), float>::value), "");
static_assert((std::is_same<decltype(erfcl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(erfc(Ambiguous())), Ambiguous>::value), "");
assert(erfc(0) == 1);
}
void test_exp2()
{
+ static_assert((std::is_same<decltype(exp2((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(exp2((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp2((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp2((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp2((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp2((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp2((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp2((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp2((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(exp2((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(exp2((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(exp2f(0)), float>::value), "");
static_assert((std::is_same<decltype(exp2l(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(exp2(Ambiguous())), Ambiguous>::value), "");
assert(exp2(1) == 2);
}
void test_expm1()
{
+ static_assert((std::is_same<decltype(expm1((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(expm1((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(expm1((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(expm1((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(expm1((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(expm1((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(expm1((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(expm1((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(expm1((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(expm1((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(expm1((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(expm1f(0)), float>::value), "");
static_assert((std::is_same<decltype(expm1l(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(expm1(Ambiguous())), Ambiguous>::value), "");
assert(expm1(0) == 0);
}
void test_fdim()
{
+ static_assert((std::is_same<decltype(fdim((float)0, (float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(fdim((bool)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fdim((unsigned short)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fdim((int)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fdim((float)0, (unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fdim((double)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fdim((long double)0, (unsigned long)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fdim((int)0, (long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fdim((int)0, (unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(fdim((double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fdim((long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fdim((float)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fdim((float)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fdim((double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(fdimf(0,0)), float>::value), "");
static_assert((std::is_same<decltype(fdiml(0,0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fdim((int)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fdim(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(fdim(1,0) == 1);
}
void test_fma()
{
+ static_assert((std::is_same<decltype(fma((bool)0, (float)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((char)0, (float)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((unsigned)0, (float)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((float)0, (int)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((float)0, (long)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((float)0, (float)0, (unsigned long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((float)0, (float)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((float)0, (float)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fma((float)0, (float)0, (float)0)), float>::value), "");
+
+ static_assert((std::is_same<decltype(fma((bool)0, (double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((char)0, (double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((unsigned)0, (double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((double)0, (int)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((double)0, (long)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((double)0, (double)0, (unsigned long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((double)0, (double)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fma((double)0, (double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(fma((double)0, (double)0, (double)0)), double>::value), "");
+
+ static_assert((std::is_same<decltype(fma((bool)0, (long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fma((char)0, (long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fma((unsigned)0, (long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fma((long double)0, (int)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fma((long double)0, (long)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fma((long double)0, (long double)0, (unsigned long long)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fma((long double)0, (long double)0, (float)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fma((double)0, (long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fma((long double)0, (long double)0, (long double)0)), long double>::value), "");
+
static_assert((std::is_same<decltype(fmaf(0,0,0)), float>::value), "");
static_assert((std::is_same<decltype(fmal(0,0,0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fma(Ambiguous(), Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(fma(1,1,1) == 2);
}
void test_fmax()
{
+ static_assert((std::is_same<decltype(fmax((float)0, (float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(fmax((bool)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmax((unsigned short)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmax((int)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmax((float)0, (unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmax((double)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmax((long double)0, (unsigned long)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmax((int)0, (long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmax((int)0, (unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(fmax((double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmax((long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmax((float)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmax((float)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmax((double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(fmaxf(0,0)), float>::value), "");
static_assert((std::is_same<decltype(fmaxl(0,0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmax((int)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmax(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(fmax(1,0) == 1);
}
void test_fmin()
{
+ static_assert((std::is_same<decltype(fmin((float)0, (float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(fmin((bool)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmin((unsigned short)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmin((int)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmin((float)0, (unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmin((double)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmin((long double)0, (unsigned long)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmin((int)0, (long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmin((int)0, (unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(fmin((double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmin((long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmin((float)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmin((float)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmin((double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(fminf(0,0)), float>::value), "");
static_assert((std::is_same<decltype(fminl(0,0)), long double>::value), "");
+ static_assert((std::is_same<decltype(fmin((int)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(fmin(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(fmin(1,0) == 0);
}
void test_hypot()
{
+ static_assert((std::is_same<decltype(hypot((float)0, (float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(hypot((bool)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(hypot((unsigned short)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(hypot((int)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(hypot((float)0, (unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(hypot((double)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(hypot((long double)0, (unsigned long)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(hypot((int)0, (long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(hypot((int)0, (unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(hypot((double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(hypot((long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(hypot((float)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(hypot((float)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(hypot((double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(hypotf(0,0)), float>::value), "");
static_assert((std::is_same<decltype(hypotl(0,0)), long double>::value), "");
+ static_assert((std::is_same<decltype(hypot((int)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(hypot(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(hypot(3,4) == 5);
}
void test_ilogb()
{
+ static_assert((std::is_same<decltype(ilogb((float)0)), int>::value), "");
+ static_assert((std::is_same<decltype(ilogb((bool)0)), int>::value), "");
+ static_assert((std::is_same<decltype(ilogb((unsigned short)0)), int>::value), "");
+ static_assert((std::is_same<decltype(ilogb((int)0)), int>::value), "");
+ static_assert((std::is_same<decltype(ilogb((unsigned int)0)), int>::value), "");
+ static_assert((std::is_same<decltype(ilogb((long)0)), int>::value), "");
+ static_assert((std::is_same<decltype(ilogb((unsigned long)0)), int>::value), "");
+ static_assert((std::is_same<decltype(ilogb((long long)0)), int>::value), "");
+ static_assert((std::is_same<decltype(ilogb((unsigned long long)0)), int>::value), "");
static_assert((std::is_same<decltype(ilogb((double)0)), int>::value), "");
+ static_assert((std::is_same<decltype(ilogb((long double)0)), int>::value), "");
static_assert((std::is_same<decltype(ilogbf(0)), int>::value), "");
static_assert((std::is_same<decltype(ilogbl(0)), int>::value), "");
+ static_assert((std::is_same<decltype(ilogb(Ambiguous())), Ambiguous>::value), "");
assert(ilogb(1) == 0);
}
void test_lgamma()
{
+ static_assert((std::is_same<decltype(lgamma((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(lgamma((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(lgamma((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(lgamma((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(lgamma((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(lgamma((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(lgamma((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(lgamma((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(lgamma((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(lgamma((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(lgamma((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(lgammaf(0)), float>::value), "");
static_assert((std::is_same<decltype(lgammal(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(lgamma(Ambiguous())), Ambiguous>::value), "");
assert(lgamma(1) == 0);
}
void test_llrint()
{
+ static_assert((std::is_same<decltype(llrint((float)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llrint((bool)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llrint((unsigned short)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llrint((int)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llrint((unsigned int)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llrint((long)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llrint((unsigned long)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llrint((long long)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llrint((unsigned long long)0)), long long>::value), "");
static_assert((std::is_same<decltype(llrint((double)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llrint((long double)0)), long long>::value), "");
static_assert((std::is_same<decltype(llrintf(0)), long long>::value), "");
static_assert((std::is_same<decltype(llrintl(0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llrint(Ambiguous())), Ambiguous>::value), "");
assert(llrint(1) == 1LL);
}
void test_llround()
{
+ static_assert((std::is_same<decltype(llround((float)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llround((bool)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llround((unsigned short)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llround((int)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llround((unsigned int)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llround((long)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llround((unsigned long)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llround((long long)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llround((unsigned long long)0)), long long>::value), "");
static_assert((std::is_same<decltype(llround((double)0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llround((long double)0)), long long>::value), "");
static_assert((std::is_same<decltype(llroundf(0)), long long>::value), "");
static_assert((std::is_same<decltype(llroundl(0)), long long>::value), "");
+ static_assert((std::is_same<decltype(llround(Ambiguous())), Ambiguous>::value), "");
assert(llround(1) == 1LL);
}
void test_log1p()
{
+ static_assert((std::is_same<decltype(log1p((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(log1p((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log1p((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log1p((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log1p((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log1p((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log1p((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log1p((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log1p((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(log1p((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log1p((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(log1pf(0)), float>::value), "");
static_assert((std::is_same<decltype(log1pl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(log1p(Ambiguous())), Ambiguous>::value), "");
assert(log1p(0) == 0);
}
void test_log2()
{
+ static_assert((std::is_same<decltype(log2((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(log2((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log2((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log2((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log2((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log2((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log2((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log2((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log2((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(log2((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(log2((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(log2f(0)), float>::value), "");
static_assert((std::is_same<decltype(log2l(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(log2(Ambiguous())), Ambiguous>::value), "");
assert(log2(1) == 0);
}
void test_logb()
{
+ static_assert((std::is_same<decltype(logb((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(logb((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(logb((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(logb((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(logb((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(logb((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(logb((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(logb((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(logb((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(logb((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(logb((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(logbf(0)), float>::value), "");
static_assert((std::is_same<decltype(logbl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(logb(Ambiguous())), Ambiguous>::value), "");
assert(logb(1) == 0);
}
void test_lrint()
{
+ static_assert((std::is_same<decltype(lrint((float)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lrint((bool)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lrint((unsigned short)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lrint((int)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lrint((unsigned int)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lrint((long)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lrint((unsigned long)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lrint((long long)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lrint((unsigned long long)0)), long>::value), "");
static_assert((std::is_same<decltype(lrint((double)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lrint((long double)0)), long>::value), "");
static_assert((std::is_same<decltype(lrintf(0)), long>::value), "");
static_assert((std::is_same<decltype(lrintl(0)), long>::value), "");
+ static_assert((std::is_same<decltype(lrint(Ambiguous())), Ambiguous>::value), "");
assert(lrint(1) == 1L);
}
void test_lround()
{
+ static_assert((std::is_same<decltype(lround((float)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lround((bool)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lround((unsigned short)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lround((int)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lround((unsigned int)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lround((long)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lround((unsigned long)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lround((long long)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lround((unsigned long long)0)), long>::value), "");
static_assert((std::is_same<decltype(lround((double)0)), long>::value), "");
+ static_assert((std::is_same<decltype(lround((long double)0)), long>::value), "");
static_assert((std::is_same<decltype(lroundf(0)), long>::value), "");
static_assert((std::is_same<decltype(lroundl(0)), long>::value), "");
+ static_assert((std::is_same<decltype(lround(Ambiguous())), Ambiguous>::value), "");
assert(lround(1) == 1L);
}
@@ -521,96 +1192,229 @@ void test_nan()
void test_nearbyint()
{
+ static_assert((std::is_same<decltype(nearbyint((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(nearbyint((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nearbyint((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nearbyint((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nearbyint((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nearbyint((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nearbyint((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nearbyint((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nearbyint((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(nearbyint((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nearbyint((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(nearbyintf(0)), float>::value), "");
static_assert((std::is_same<decltype(nearbyintl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(nearbyint(Ambiguous())), Ambiguous>::value), "");
assert(nearbyint(1) == 1);
}
void test_nextafter()
{
+ static_assert((std::is_same<decltype(nextafter((float)0, (float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(nextafter((bool)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nextafter((unsigned short)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nextafter((int)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(nextafter((float)0, (unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nextafter((double)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nextafter((long double)0, (unsigned long)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(nextafter((int)0, (long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nextafter((int)0, (unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(nextafter((double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nextafter((long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(nextafter((float)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nextafter((float)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(nextafter((double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(nextafterf(0,0)), float>::value), "");
static_assert((std::is_same<decltype(nextafterl(0,0)), long double>::value), "");
+ static_assert((std::is_same<decltype(nextafter((int)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nextafter(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(nextafter(0,1) == hexfloat<double>(0x1, 0, -1074));
}
void test_nexttoward()
{
+ static_assert((std::is_same<decltype(nexttoward((float)0, (long double)0)), float>::value), "");
+ static_assert((std::is_same<decltype(nexttoward((bool)0, (long double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nexttoward((unsigned short)0, (long double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nexttoward((int)0, (long double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nexttoward((unsigned int)0, (long double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nexttoward((long)0, (long double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nexttoward((unsigned long)0, (long double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nexttoward((long long)0, (long double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nexttoward((unsigned long long)0, (long double)0)), double>::value), "");
static_assert((std::is_same<decltype(nexttoward((double)0, (long double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(nexttoward((long double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(nexttowardf(0, (long double)0)), float>::value), "");
static_assert((std::is_same<decltype(nexttowardl(0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(nexttoward(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(nexttoward(0, 1) == hexfloat<double>(0x1, 0, -1074));
}
void test_remainder()
{
+ static_assert((std::is_same<decltype(remainder((float)0, (float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(remainder((bool)0, (float)0)), double>::value), "");
+ static_assert((std::is_same<decltype(remainder((unsigned short)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(remainder((int)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(remainder((float)0, (unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(remainder((double)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(remainder((long double)0, (unsigned long)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(remainder((int)0, (long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(remainder((int)0, (unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(remainder((double)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(remainder((long double)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(remainder((float)0, (double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(remainder((float)0, (long double)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(remainder((double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(remainderf(0,0)), float>::value), "");
static_assert((std::is_same<decltype(remainderl(0,0)), long double>::value), "");
static_assert((std::is_same<decltype(remainder((int)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(remainder(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(remainder(0.5,1) == 0.5);
}
void test_remquo()
{
int ip;
+ static_assert((std::is_same<decltype(remquo((float)0, (float)0, &ip)), float>::value), "");
+ static_assert((std::is_same<decltype(remquo((bool)0, (float)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(remquo((unsigned short)0, (double)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(remquo((int)0, (long double)0, &ip)), long double>::value), "");
+ static_assert((std::is_same<decltype(remquo((float)0, (unsigned int)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(remquo((double)0, (long)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(remquo((long double)0, (unsigned long)0, &ip)), long double>::value), "");
+ static_assert((std::is_same<decltype(remquo((int)0, (long long)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(remquo((int)0, (unsigned long long)0, &ip)), double>::value), "");
static_assert((std::is_same<decltype(remquo((double)0, (double)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(remquo((long double)0, (long double)0, &ip)), long double>::value), "");
+ static_assert((std::is_same<decltype(remquo((float)0, (double)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(remquo((float)0, (long double)0, &ip)), long double>::value), "");
+ static_assert((std::is_same<decltype(remquo((double)0, (long double)0, &ip)), long double>::value), "");
static_assert((std::is_same<decltype(remquof(0,0, &ip)), float>::value), "");
static_assert((std::is_same<decltype(remquol(0,0, &ip)), long double>::value), "");
+ static_assert((std::is_same<decltype(remquo((int)0, (int)0, &ip)), double>::value), "");
+ static_assert((std::is_same<decltype(remquo(Ambiguous(), Ambiguous(), &ip)), Ambiguous>::value), "");
assert(remquo(0.5,1, &ip) == 0.5);
}
void test_rint()
{
+ static_assert((std::is_same<decltype(rint((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(rint((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(rint((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(rint((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(rint((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(rint((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(rint((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(rint((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(rint((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(rint((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(rint((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(rintf(0)), float>::value), "");
static_assert((std::is_same<decltype(rintl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(rint(Ambiguous())), Ambiguous>::value), "");
assert(rint(1) == 1);
}
void test_round()
{
+ static_assert((std::is_same<decltype(round((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(round((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(round((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(round((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(round((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(round((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(round((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(round((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(round((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(round((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(round((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(roundf(0)), float>::value), "");
static_assert((std::is_same<decltype(roundl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(round(Ambiguous())), Ambiguous>::value), "");
assert(round(1) == 1);
}
void test_scalbln()
{
+ static_assert((std::is_same<decltype(scalbln((float)0, (long)0)), float>::value), "");
+ static_assert((std::is_same<decltype(scalbln((bool)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbln((unsigned short)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbln((int)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbln((unsigned int)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbln((long)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbln((unsigned long)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbln((long long)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbln((unsigned long long)0, (long)0)), double>::value), "");
static_assert((std::is_same<decltype(scalbln((double)0, (long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbln((long double)0, (long)0)), long double>::value), "");
static_assert((std::is_same<decltype(scalblnf(0, (long)0)), float>::value), "");
static_assert((std::is_same<decltype(scalblnl(0, (long)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(scalbln(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(scalbln(1, 1) == 2);
}
void test_scalbn()
{
+ static_assert((std::is_same<decltype(scalbn((float)0, (int)0)), float>::value), "");
+ static_assert((std::is_same<decltype(scalbn((bool)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbn((unsigned short)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbn((int)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbn((unsigned int)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbn((long)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbn((unsigned long)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbn((long long)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbn((unsigned long long)0, (int)0)), double>::value), "");
static_assert((std::is_same<decltype(scalbn((double)0, (int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(scalbn((long double)0, (int)0)), long double>::value), "");
static_assert((std::is_same<decltype(scalbnf(0, (int)0)), float>::value), "");
static_assert((std::is_same<decltype(scalbnl(0, (int)0)), long double>::value), "");
+ static_assert((std::is_same<decltype(scalbn(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
assert(scalbn(1, 1) == 2);
}
void test_tgamma()
{
+ static_assert((std::is_same<decltype(tgamma((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(tgamma((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tgamma((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tgamma((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tgamma((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tgamma((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tgamma((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tgamma((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tgamma((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(tgamma((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(tgamma((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(tgammaf(0)), float>::value), "");
static_assert((std::is_same<decltype(tgammal(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(tgamma(Ambiguous())), Ambiguous>::value), "");
assert(tgamma(1) == 1);
}
void test_trunc()
{
+ static_assert((std::is_same<decltype(trunc((float)0)), float>::value), "");
+ static_assert((std::is_same<decltype(trunc((bool)0)), double>::value), "");
+ static_assert((std::is_same<decltype(trunc((unsigned short)0)), double>::value), "");
+ static_assert((std::is_same<decltype(trunc((int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(trunc((unsigned int)0)), double>::value), "");
+ static_assert((std::is_same<decltype(trunc((long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(trunc((unsigned long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(trunc((long long)0)), double>::value), "");
+ static_assert((std::is_same<decltype(trunc((unsigned long long)0)), double>::value), "");
static_assert((std::is_same<decltype(trunc((double)0)), double>::value), "");
+ static_assert((std::is_same<decltype(trunc((long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(truncf(0)), float>::value), "");
static_assert((std::is_same<decltype(truncl(0)), long double>::value), "");
+ static_assert((std::is_same<decltype(trunc(Ambiguous())), Ambiguous>::value), "");
assert(trunc(1) == 1);
}
int main()
{
+ test_abs();
test_acos();
test_asin();
test_atan();
@@ -636,8 +1440,6 @@ int main()
test_signbit();
test_fpclassify();
test_isfinite();
- test_isinf();
- test_isnan();
test_isnormal();
test_isgreater();
test_isgreaterequal();
diff --git a/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp b/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp
new file mode 100644
index 000000000000..cc7eaac7de62
--- /dev/null
+++ b/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <math.h>
+
+// isinf
+
+// XFAIL: linux
+
+#include <math.h>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+#ifdef isinf
+#error isinf defined
+#endif
+ static_assert((std::is_same<decltype(isinf((float)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isinf((double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isinf(0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isinf((long double)0)), bool>::value), "");
+ assert(isinf(-1.0) == false);
+}
diff --git a/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp b/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp
new file mode 100644
index 000000000000..118f96bdd434
--- /dev/null
+++ b/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <math.h>
+
+// isnan
+
+// XFAIL: linux
+
+#include <math.h>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+#ifdef isnan
+#error isnan defined
+#endif
+ static_assert((std::is_same<decltype(isnan((float)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isnan((double)0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isnan(0)), bool>::value), "");
+ static_assert((std::is_same<decltype(isnan((long double)0)), bool>::value), "");
+ assert(isnan(-1.0) == false);
+}
diff --git a/test/std/depr/depr.c.headers/setjmp_h.pass.cpp b/test/std/depr/depr.c.headers/setjmp_h.pass.cpp
index 36f425390694..9bc35b747493 100644
--- a/test/std/depr/depr.c.headers/setjmp_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/setjmp_h.pass.cpp
@@ -12,6 +12,10 @@
#include <setjmp.h>
#include <type_traits>
+#ifndef setjmp
+#error setjmp not defined
+#endif
+
int main()
{
jmp_buf jb;
diff --git a/test/std/depr/depr.c.headers/signal_h.pass.cpp b/test/std/depr/depr.c.headers/signal_h.pass.cpp
index a8ef5f993fe6..83f45c9b142e 100644
--- a/test/std/depr/depr.c.headers/signal_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/signal_h.pass.cpp
@@ -50,7 +50,7 @@
int main()
{
- sig_atomic_t sig;
+ sig_atomic_t sig; ((void)sig);
typedef void (*func)(int);
static_assert((std::is_same<decltype(signal(0, (func)0)), func>::value), "");
static_assert((std::is_same<decltype(raise(0)), int>::value), "");
diff --git a/test/std/depr/depr.c.headers/stdarg_h.pass.cpp b/test/std/depr/depr.c.headers/stdarg_h.pass.cpp
index 7a60902529ea..f7d12b1ad551 100644
--- a/test/std/depr/depr.c.headers/stdarg_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/stdarg_h.pass.cpp
@@ -32,4 +32,5 @@
int main()
{
va_list va;
+ ((void)va);
}
diff --git a/test/std/depr/depr.c.headers/stddef_h.pass.cpp b/test/std/depr/depr.c.headers/stddef_h.pass.cpp
index 140c91b53e6e..0c08c782a3e4 100644
--- a/test/std/depr/depr.c.headers/stddef_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/stddef_h.pass.cpp
@@ -10,6 +10,7 @@
// <stddef.h>
#include <stddef.h>
+#include <cassert>
#include <type_traits>
#ifndef NULL
@@ -22,6 +23,9 @@
int main()
{
+ void *p = NULL;
+ assert(!p);
+
static_assert(sizeof(size_t) == sizeof(void*),
"sizeof(size_t) == sizeof(void*)");
static_assert(std::is_unsigned<size_t>::value,
@@ -34,4 +38,22 @@ int main()
"std::is_signed<ptrdiff_t>::value");
static_assert(std::is_integral<ptrdiff_t>::value,
"std::is_integral<ptrdiff_t>::value");
+ static_assert((std::is_same<decltype(nullptr), nullptr_t>::value),
+ "decltype(nullptr) == nullptr_t");
+ static_assert(sizeof(nullptr_t) == sizeof(void*),
+ "sizeof(nullptr_t) == sizeof(void*)");
+ static_assert(std::is_pod<max_align_t>::value,
+ "std::is_pod<max_align_t>::value");
+ static_assert((std::alignment_of<max_align_t>::value >=
+ std::alignment_of<long long>::value),
+ "std::alignment_of<max_align_t>::value >= "
+ "std::alignment_of<long long>::value");
+ static_assert(std::alignment_of<max_align_t>::value >=
+ std::alignment_of<long double>::value,
+ "std::alignment_of<max_align_t>::value >= "
+ "std::alignment_of<long double>::value");
+ static_assert(std::alignment_of<max_align_t>::value >=
+ std::alignment_of<void*>::value,
+ "std::alignment_of<max_align_t>::value >= "
+ "std::alignment_of<void*>::value");
}
diff --git a/test/std/depr/depr.c.headers/stdint_h.pass.cpp b/test/std/depr/depr.c.headers/stdint_h.pass.cpp
index 3861ee509753..92bb04e558bb 100644
--- a/test/std/depr/depr.c.headers/stdint_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/stdint_h.pass.cpp
@@ -223,10 +223,10 @@ int main()
assert(UINTMAX_MAX == std::numeric_limits<uintmax_t>::max());
// PTRDIFF_MIN
- assert(PTRDIFF_MIN == std::numeric_limits<ptrdiff_t>::min());
+ assert(PTRDIFF_MIN == std::numeric_limits<std::ptrdiff_t>::min());
// PTRDIFF_MAX
- assert(PTRDIFF_MAX == std::numeric_limits<ptrdiff_t>::max());
+ assert(PTRDIFF_MAX == std::numeric_limits<std::ptrdiff_t>::max());
// SIG_ATOMIC_MIN
assert(SIG_ATOMIC_MIN == std::numeric_limits<sig_atomic_t>::min());
diff --git a/test/std/depr/depr.c.headers/stdio_h.pass.cpp b/test/std/depr/depr.c.headers/stdio_h.pass.cpp
index d4cfbc80a5ce..3c5dd0ebf0e0 100644
--- a/test/std/depr/depr.c.headers/stdio_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/stdio_h.pass.cpp
@@ -11,6 +11,27 @@
#include <stdio.h>
#include <type_traits>
+#include "test_macros.h"
+
+#ifdef getc
+#error getc is defined
+#endif
+
+#ifdef putc
+#error putc is defined
+#endif
+
+#ifdef clearerr
+#error clearerr is defined
+#endif
+
+#ifdef feof
+#error feof is defined
+#endif
+
+#ifdef ferror
+#error ferror is defined
+#endif
#ifndef BUFSIZ
#error BUFSIZ not defined
@@ -78,14 +99,16 @@
#include <cstdarg>
-#pragma clang diagnostic ignored "-Wformat-zero-length"
+#pragma GCC diagnostic ignored "-Wformat-zero-length"
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // for tmpnam
int main()
{
FILE* fp = 0;
fpos_t fpos = {0};
- size_t s = 0;
+ size_t s = 0; ((void)s);
char* cp = 0;
+ char arr[] = {'a', 'b'};
va_list va;
static_assert((std::is_same<decltype(remove("")), int>::value), "");
static_assert((std::is_same<decltype(rename("","")), int>::value), "");
@@ -117,7 +140,7 @@ int main()
static_assert((std::is_same<decltype(fputs("",fp)), int>::value), "");
static_assert((std::is_same<decltype(getc(fp)), int>::value), "");
static_assert((std::is_same<decltype(getchar()), int>::value), "");
-#if _LIBCPP_STD_VER < 14
+#if TEST_STD_VER < 14
static_assert((std::is_same<decltype(gets(cp)), char*>::value), "");
#endif
static_assert((std::is_same<decltype(putc(0,fp)), int>::value), "");
@@ -125,7 +148,7 @@ int main()
static_assert((std::is_same<decltype(puts("")), int>::value), "");
static_assert((std::is_same<decltype(ungetc(0,fp)), int>::value), "");
static_assert((std::is_same<decltype(fread((void*)0,0,0,fp)), size_t>::value), "");
- static_assert((std::is_same<decltype(fwrite((const void*)0,0,0,fp)), size_t>::value), "");
+ static_assert((std::is_same<decltype(fwrite((const void*)arr,1,0,fp)), size_t>::value), "");
static_assert((std::is_same<decltype(fgetpos(fp, &fpos)), int>::value), "");
static_assert((std::is_same<decltype(fseek(fp, 0,0)), int>::value), "");
static_assert((std::is_same<decltype(fsetpos(fp, &fpos)), int>::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 47e1527fb175..96d1143d4de6 100644
--- a/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
@@ -12,6 +12,36 @@
#include <stdlib.h>
#include <type_traits>
+// As of 1/10/2015 clang emits a -Wnonnull warnings even if the warning occurs
+// in an unevaluated context. For this reason we manually suppress the warning.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wnonnull"
+#endif
+
+#ifdef abs
+#error abs is defined
+#endif
+
+#ifdef labs
+#error labs is defined
+#endif
+
+#ifdef llabs
+#error llabs is defined
+#endif
+
+#ifdef div
+#error div is defined
+#endif
+
+#ifdef ldiv
+#error ldiv is defined
+#endif
+
+#ifdef lldiv
+#error lldiv is defined
+#endif
+
#ifndef EXIT_FAILURE
#error EXIT_FAILURE not defined
#endif
@@ -34,10 +64,10 @@
int main()
{
- size_t s = 0;
- div_t d;
- ldiv_t ld;
- lldiv_t lld;
+ size_t s = 0; ((void)s);
+ div_t d; ((void)d);
+ ldiv_t ld; ((void)ld);
+ lldiv_t lld; ((void)lld);
char** endptr = 0;
static_assert((std::is_same<decltype(atof("")), double>::value), "");
static_assert((std::is_same<decltype(atoi("")), int>::value), "");
diff --git a/test/std/depr/depr.c.headers/time_h.pass.cpp b/test/std/depr/depr.c.headers/time_h.pass.cpp
index c468693ccb26..0d229af409bd 100644
--- a/test/std/depr/depr.c.headers/time_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/time_h.pass.cpp
@@ -22,7 +22,7 @@
int main()
{
- clock_t c = 0;
+ clock_t c = 0; ((void)c);
size_t s = 0;
time_t t = 0;
tm tmv = {0};
diff --git a/test/std/depr/depr.c.headers/wchar_h.pass.cpp b/test/std/depr/depr.c.headers/wchar_h.pass.cpp
index 68bea49cfe03..e561b3e5a724 100644
--- a/test/std/depr/depr.c.headers/wchar_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/wchar_h.pass.cpp
@@ -9,6 +9,7 @@
// <wchar.h>
+
#include <wchar.h>
#include <type_traits>
@@ -30,7 +31,15 @@
int main()
{
+// mbstate_t comes from the underlying C library; it is defined (in C99) as:
+// a complete object type other than an array type that can hold the conversion
+// state information necessary to convert between sequences of multibyte
+// characters and wide characters
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wmissing-braces"
mbstate_t mb = {0};
+#pragma clang diagnostic pop
+
size_t s = 0;
tm *tm = 0;
wint_t w = 0;
@@ -50,19 +59,13 @@ int main()
static_assert((std::is_same<decltype(vfwscanf(fp, L"", va)), int>::value), "");
static_assert((std::is_same<decltype(vswprintf(ws, s, L"", va)), int>::value), "");
static_assert((std::is_same<decltype(vswscanf(L"", L"", va)), int>::value), "");
- static_assert((std::is_same<decltype(vwprintf(L"", va)), int>::value), "");
- static_assert((std::is_same<decltype(vwscanf(L"", va)), int>::value), "");
- static_assert((std::is_same<decltype(wprintf(L"")), int>::value), "");
- static_assert((std::is_same<decltype(wscanf(L"")), int>::value), "");
static_assert((std::is_same<decltype(fgetwc(fp)), wint_t>::value), "");
static_assert((std::is_same<decltype(fgetws(ws, 0, fp)), wchar_t*>::value), "");
static_assert((std::is_same<decltype(fputwc(L' ', fp)), wint_t>::value), "");
static_assert((std::is_same<decltype(fputws(L"", fp)), int>::value), "");
static_assert((std::is_same<decltype(fwide(fp, 0)), int>::value), "");
static_assert((std::is_same<decltype(getwc(fp)), wint_t>::value), "");
- static_assert((std::is_same<decltype(getwchar()), wint_t>::value), "");
static_assert((std::is_same<decltype(putwc(L' ', fp)), wint_t>::value), "");
- static_assert((std::is_same<decltype(putwchar(L' ')), wint_t>::value), "");
static_assert((std::is_same<decltype(ungetwc(L' ', fp)), wint_t>::value), "");
static_assert((std::is_same<decltype(wcstod(L"", (wchar_t**)0)), double>::value), "");
static_assert((std::is_same<decltype(wcstof(L"", (wchar_t**)0)), float>::value), "");
@@ -79,14 +82,19 @@ int main()
static_assert((std::is_same<decltype(wcscoll(L"", L"")), int>::value), "");
static_assert((std::is_same<decltype(wcsncmp(L"", L"", s)), int>::value), "");
static_assert((std::is_same<decltype(wcsxfrm(ws, L"", s)), size_t>::value), "");
+ // const wchar_t* wcschr((const wchar_t*)0, L' ') - See below
static_assert((std::is_same<decltype(wcschr((wchar_t*)0, L' ')), wchar_t*>::value), "");
static_assert((std::is_same<decltype(wcscspn(L"", L"")), size_t>::value), "");
static_assert((std::is_same<decltype(wcslen(L"")), size_t>::value), "");
+ // const wchar_t* wcspbrk((const wchar_t*)0, L"") - See below
static_assert((std::is_same<decltype(wcspbrk((wchar_t*)0, L"")), wchar_t*>::value), "");
+ // const wchar_t* wcsrchr((const wchar_t*)0, L' ') - See below
static_assert((std::is_same<decltype(wcsrchr((wchar_t*)0, L' ')), wchar_t*>::value), "");
static_assert((std::is_same<decltype(wcsspn(L"", L"")), size_t>::value), "");
+ // const wchar_t* wcsstr((const wchar_t*)0, L"") - See below
static_assert((std::is_same<decltype(wcsstr((wchar_t*)0, L"")), wchar_t*>::value), "");
static_assert((std::is_same<decltype(wcstok(ws, L"", (wchar_t**)0)), wchar_t*>::value), "");
+ // const wchar_t* wmemchr((const wchar_t*)0, L' ', s) - See below
static_assert((std::is_same<decltype(wmemchr((wchar_t*)0, L' ', s)), wchar_t*>::value), "");
static_assert((std::is_same<decltype(wmemcmp(L"", L"", s)), int>::value), "");
static_assert((std::is_same<decltype(wmemcpy(ws, L"", s)), wchar_t*>::value), "");
@@ -101,4 +109,27 @@ int main()
static_assert((std::is_same<decltype(wcrtomb(ns, L' ', &mb)), size_t>::value), "");
static_assert((std::is_same<decltype(mbsrtowcs(ws, (const char**)0, s, &mb)), size_t>::value), "");
static_assert((std::is_same<decltype(wcsrtombs(ns, (const wchar_t**)0, s, &mb)), size_t>::value), "");
+
+// This test fails on systems whose C library doesn't provide a correct overload
+// set for wcschr, wcspbrk, wcsrchr, wcsstr, and wmemchr. There's no way for
+// libc++ to fix that on the C library's behalf.
+#ifndef __APPLE__
+ static_assert((std::is_same<decltype(wcschr((const wchar_t*)0, L' ')), const wchar_t*>::value), "");
+ static_assert((std::is_same<decltype(wcspbrk((const wchar_t*)0, L"")), const wchar_t*>::value), "");
+ static_assert((std::is_same<decltype(wcsrchr((const wchar_t*)0, L' ')), const wchar_t*>::value), "");
+ static_assert((std::is_same<decltype(wcsstr((const wchar_t*)0, L"")), const wchar_t*>::value), "");
+ static_assert((std::is_same<decltype(wmemchr((const wchar_t*)0, L' ', s)), const wchar_t*>::value), "");
+#endif
+
+#ifndef _LIBCPP_HAS_NO_STDIN
+ static_assert((std::is_same<decltype(getwchar()), wint_t>::value), "");
+ static_assert((std::is_same<decltype(vwscanf(L"", va)), int>::value), "");
+ static_assert((std::is_same<decltype(wscanf(L"")), int>::value), "");
+#endif
+
+#ifndef _LIBCPP_HAS_NO_STDOUT
+ static_assert((std::is_same<decltype(putwchar(L' ')), wint_t>::value), "");
+ static_assert((std::is_same<decltype(vwprintf(L"", va)), int>::value), "");
+ static_assert((std::is_same<decltype(wprintf(L"")), int>::value), "");
+#endif
}
diff --git a/test/std/depr/depr.ios.members/io_state.pass.cpp b/test/std/depr/depr.ios.members/io_state.pass.cpp
index 15bfbf197802..6b362d016036 100644
--- a/test/std/depr/depr.ios.members/io_state.pass.cpp
+++ b/test/std/depr/depr.ios.members/io_state.pass.cpp
@@ -15,11 +15,16 @@
// typedef T1 io_state;
// };
+// These members were removed for C++17
+
+#include "test_macros.h"
#include <strstream>
#include <cassert>
int main()
{
+#if TEST_STD_VER <= 14
std::strstream::io_state b = std::strstream::eofbit;
assert(b == std::ios::eofbit);
+#endif
}
diff --git a/test/std/depr/depr.ios.members/open_mode.pass.cpp b/test/std/depr/depr.ios.members/open_mode.pass.cpp
index 12a8e9458809..cf91e7c9d1d5 100644
--- a/test/std/depr/depr.ios.members/open_mode.pass.cpp
+++ b/test/std/depr/depr.ios.members/open_mode.pass.cpp
@@ -15,11 +15,16 @@
// typedef T2 open_mode;
// };
+// These members were removed for C++17
+
+#include "test_macros.h"
#include <strstream>
#include <cassert>
int main()
{
+#if TEST_STD_VER <= 14
std::strstream::open_mode b = std::strstream::app;
assert(b == std::ios::app);
+#endif
}
diff --git a/test/std/depr/depr.ios.members/seek_dir.pass.cpp b/test/std/depr/depr.ios.members/seek_dir.pass.cpp
index 891a7a345638..0dd70c101858 100644
--- a/test/std/depr/depr.ios.members/seek_dir.pass.cpp
+++ b/test/std/depr/depr.ios.members/seek_dir.pass.cpp
@@ -15,11 +15,16 @@
// typedef T3 seek_dir;
// };
+// These members were removed for C++17
+
+#include "test_macros.h"
#include <strstream>
#include <cassert>
int main()
{
+#if TEST_STD_VER <= 14
std::strstream::seek_dir b = std::strstream::cur;
assert(b == std::ios::cur);
+#endif
}
diff --git a/test/std/depr/depr.ios.members/streamoff.pass.cpp b/test/std/depr/depr.ios.members/streamoff.pass.cpp
index 4ccfd1f7d225..0c237b3547d6 100644
--- a/test/std/depr/depr.ios.members/streamoff.pass.cpp
+++ b/test/std/depr/depr.ios.members/streamoff.pass.cpp
@@ -15,11 +15,16 @@
// typedef OFF_T streamoff;
// };
+// These members were removed for C++17
+
+#include "test_macros.h"
#include <ios>
#include <type_traits>
int main()
{
+#if TEST_STD_VER <= 14
static_assert((std::is_integral<std::ios_base::streamoff>::value), "");
static_assert((std::is_signed<std::ios_base::streamoff>::value), "");
+#endif
}
diff --git a/test/std/depr/depr.ios.members/streampos.pass.cpp b/test/std/depr/depr.ios.members/streampos.pass.cpp
index 315118cb3e3d..863905f710eb 100644
--- a/test/std/depr/depr.ios.members/streampos.pass.cpp
+++ b/test/std/depr/depr.ios.members/streampos.pass.cpp
@@ -15,10 +15,15 @@
// typedef POS_T streampos;
// };
+// These members were removed for C++17
+
+#include "test_macros.h"
#include <ios>
#include <type_traits>
int main()
{
+#if TEST_STD_VER <= 14
static_assert((std::is_same<std::ios_base::streampos, std::streampos>::value), "");
+#endif
}
diff --git a/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp b/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp
index 7fab50081d2a..5879529317ef 100644
--- a/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp
+++ b/test/std/depr/exception.unexpected/unexpected.handler/unexpected_handler.pass.cpp
@@ -16,4 +16,5 @@ void f() {}
int main()
{
std::unexpected_handler p = f;
+ ((void)p);
}
diff --git a/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp b/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp
index 235305878390..79162ddaa8fd 100644
--- a/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp
+++ b/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp
@@ -16,4 +16,5 @@
int main()
{
std::error_category* p = 0;
+ ((void)p);
}
diff --git a/test/std/experimental/algorithms/alg.search/search.pass.cpp b/test/std/experimental/algorithms/alg.search/search.pass.cpp
new file mode 100644
index 000000000000..60a44e4c26a2
--- /dev/null
+++ b/test/std/experimental/algorithms/alg.search/search.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
+
+// <algorithm>
+
+// template<class ForwardIterator, class Searcher>
+// ForwardIterator search(ForwardIterator first, ForwardIterator last,
+// const Searcher& searcher);
+//
+// returns searcher.operator(first, last)
+//
+
+#include <experimental/algorithm>
+#include <cassert>
+
+#include "test_iterators.h"
+
+int searcher_called = 0;
+
+struct MySearcher {
+ template <typename Iterator>
+ Iterator operator() ( Iterator b, Iterator /*e*/) const
+ {
+ ++searcher_called;
+ return b;
+ }
+};
+
+
+int main() {
+ typedef int * RI;
+ static_assert((std::is_same<RI, decltype(std::experimental::search(RI(), RI(), MySearcher()))>::value), "" );
+
+ RI it(nullptr);
+ assert(it == std::experimental::search(it, it, MySearcher()));
+ assert(searcher_called == 1);
+}
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
new file mode 100644
index 000000000000..8ee575c408f9
--- /dev/null
+++ b/test/std/experimental/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
+
+// <experimental/any>
+
+// any& operator=(any const &);
+
+// Test copy assignment
+
+#include <experimental/any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::experimental::any;
+using std::experimental::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);
+ }
+ {
+ 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);
+ }
+ {
+ 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);
+ }
+#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/experimental/any/any.class/any.assign/move.pass.cpp b/test/std/experimental/any/any.class/any.assign/move.pass.cpp
new file mode 100644
index 000000000000..0a2d71967cd4
--- /dev/null
+++ b/test/std/experimental/any/any.class/any.assign/move.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
+
+// <experimental/any>
+
+// any& operator=(any &&);
+
+// Test move assignment.
+
+#include <experimental/any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "test_macros.h"
+
+using std::experimental::any;
+using std::experimental::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);
+
+ assertContains<RHS>(a, 2);
+ assertEmpty<RHS>(a2);
+ }
+ 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);
+
+ assertContains<LHS>(a, 1);
+ assertEmpty<LHS>(a2);
+ }
+ 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/experimental/any/any.class/any.assign/value.pass.cpp b/test/std/experimental/any/any.class/any.assign/value.pass.cpp
new file mode 100644
index 000000000000..8262990523c3
--- /dev/null
+++ b/test/std/experimental/any/any.class/any.assign/value.pass.cpp
@@ -0,0 +1,177 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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/any>
+
+// any& operator=(any const &);
+
+// Test value copy and move assignment.
+
+#include <experimental/any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::experimental::any;
+using std::experimental::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);
+
+ assertContains<RHS>(lhs, 2);
+ assertEmpty<RHS>(rhs);
+ }
+ 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
+}
+
+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>();
+} \ No newline at end of file
diff --git a/test/std/experimental/any/any.class/any.assign/value_non_copyable_assign.fail.cpp b/test/std/experimental/any/any.class/any.assign/value_non_copyable_assign.fail.cpp
new file mode 100644
index 000000000000..ce0d44f32d98
--- /dev/null
+++ b/test/std/experimental/any/any.class/any.assign/value_non_copyable_assign.fail.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
+
+// <experimental/any>
+
+// template <class Value>
+// any& operator=(Value &&);
+
+// Instantiate the value assignment operator with a non-copyable type.
+
+#include <experimental/any>
+
+class non_copyable
+{
+ non_copyable(non_copyable const &);
+
+public:
+ non_copyable() {}
+ non_copyable(non_copyable &&) {}
+};
+
+int main()
+{
+ using namespace std::experimental;
+ non_copyable nc;
+ any a;
+ a = static_cast<non_copyable &&>(nc); // expected-error@experimental/any:* 2 {{static_assert failed "_ValueType must be CopyConstructible."}}
+ // expected-error@experimental/any:* {{calling a private constructor of class 'non_copyable'}}
+
+}
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
new file mode 100644
index 000000000000..3d0b34b27406
--- /dev/null
+++ b/test/std/experimental/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
+
+// <experimental/any>
+
+// any(any const &);
+
+#include <experimental/any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::experimental::any;
+using std::experimental::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>(a, 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.clear();
+ 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/experimental/any/any.class/any.cons/default.pass.cpp b/test/std/experimental/any/any.class/any.cons/default.pass.cpp
new file mode 100644
index 000000000000..b52c83fc3881
--- /dev/null
+++ b/test/std/experimental/any/any.class/any.cons/default.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
+
+// <experimental/any>
+
+// any() noexcept;
+
+#include <experimental/any>
+#include <type_traits>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+
+
+int main()
+{
+ using std::experimental::any;
+ {
+ static_assert(
+ std::is_nothrow_default_constructible<any>::value
+ , "Must be default constructible"
+ );
+ }
+ {
+ DisableAllocationGuard g; ((void)g);
+ any const a;
+ assertEmpty(a);
+ }
+}
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
new file mode 100644
index 000000000000..40534cb55066
--- /dev/null
+++ b/test/std/experimental/any/any.class/any.cons/move.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
+
+// <experimental/any>
+
+// any(any &&) noexcept;
+
+#include <experimental/any>
+#include <utility>
+#include <type_traits>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::experimental::any;
+using std::experimental::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); // zero or more move operations can be performed.
+ assert(Type::copied == 0); // no copies can be performed.
+ assert(Type::count == 1);
+ assertEmpty(a); // Moves are always destructive.
+ assertContains<Type>(a2, 42);
+ }
+ 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/experimental/any/any.class/any.cons/non_copyable_value.fail.cpp b/test/std/experimental/any/any.class/any.cons/non_copyable_value.fail.cpp
new file mode 100644
index 000000000000..643b9621ca2f
--- /dev/null
+++ b/test/std/experimental/any/any.class/any.cons/non_copyable_value.fail.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.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <experimental/any>
+
+// any::any<Value>(Value &&)
+
+// Attempt to construct any with a non-copyable type.
+
+#include <experimental/any>
+
+class non_copyable
+{
+ non_copyable(non_copyable const &);
+
+public:
+ non_copyable() {}
+ non_copyable(non_copyable &&) {}
+};
+
+int main()
+{
+ using namespace std::experimental;
+ non_copyable nc;
+ any a(static_cast<non_copyable &&>(nc));
+ // expected-error@experimental/any:* 1 {{static_assert failed "_ValueType must be CopyConstructible."}}
+ // expected-error@experimental/any:* 1 {{calling a private constructor of class 'non_copyable'}}
+}
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
new file mode 100644
index 000000000000..7bb134efd28a
--- /dev/null
+++ b/test/std/experimental/any/any.class/any.cons/value.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
+
+// <experimental/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 <experimental/any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::experimental::any;
+using std::experimental::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);
+ }
+}
+
+
+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();
+} \ No newline at end of file
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
new file mode 100644
index 000000000000..603490cef43d
--- /dev/null
+++ b/test/std/experimental/any/any.class/any.modifiers/clear.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
+
+// <experimental/any>
+
+// any::clear() noexcept
+
+#include <experimental/any>
+#include <cassert>
+
+#include "any_helpers.h"
+
+int main()
+{
+ using std::experimental::any;
+ using std::experimental::any_cast;
+ // empty
+ {
+ any a;
+
+ // noexcept check
+ static_assert(
+ noexcept(a.clear())
+ , "any.clear() must be noexcept"
+ );
+
+ assertEmpty(a);
+
+ a.clear();
+
+ assertEmpty(a);
+ }
+ // small object
+ {
+ any a((small(1)));
+ assert(small::count == 1);
+ assertContains<small>(a, 1);
+
+ a.clear();
+
+ assertEmpty<small>(a);
+ assert(small::count == 0);
+ }
+ // large object
+ {
+ any a(large(1));
+ assert(large::count == 1);
+ assertContains<large>(a);
+
+ a.clear();
+
+ assertEmpty<large>(a);
+ assert(large::count == 0);
+ }
+}
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
new file mode 100644
index 000000000000..064935167eb5
--- /dev/null
+++ b/test/std/experimental/any/any.class/any.modifiers/swap.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, c++11
+
+// <experimental/any>
+
+// any::swap(any &) noexcept
+
+// Test swap(large, small) and swap(small, large)
+
+#include <experimental/any>
+#include <cassert>
+
+#include "any_helpers.h"
+
+using std::experimental::any;
+using std::experimental::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"
+ );
+}
+
+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>();
+}
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
new file mode 100644
index 000000000000..8c681f37017f
--- /dev/null
+++ b/test/std/experimental/any/any.class/any.observers/empty.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
+
+// <experimental/any>
+
+// any::empty() noexcept
+
+#include <experimental/any>
+#include <cassert>
+
+#include "any_helpers.h"
+
+int main()
+{
+ using std::experimental::any;
+ // noexcept test
+ {
+ any a;
+ static_assert(noexcept(a.empty()), "any::empty() must be noexcept");
+ }
+ // empty
+ {
+ any a;
+ assert(a.empty());
+
+ a.clear();
+ assert(a.empty());
+
+ a = 42;
+ assert(!a.empty());
+ }
+ // small object
+ {
+ small const s(1);
+ any a(s);
+ assert(!a.empty());
+
+ a.clear();
+ assert(a.empty());
+
+ a = s;
+ assert(!a.empty());
+ }
+ // large object
+ {
+ large const l(1);
+ any a(l);
+ assert(!a.empty());
+
+ a.clear();
+ assert(a.empty());
+
+ a = l;
+ assert(!a.empty());
+ }
+}
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
new file mode 100644
index 000000000000..682b73bc98c4
--- /dev/null
+++ b/test/std/experimental/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
+
+// XFAIL: libcpp-no-rtti
+
+// <experimental/any>
+
+// any::type() noexcept
+
+#include <experimental/any>
+#include <cassert>
+#include "any_helpers.h"
+
+int main()
+{
+ using std::experimental::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/experimental/any/any.class/nothing_to_do.pass.cpp b/test/std/experimental/any/any.class/nothing_to_do.pass.cpp
new file mode 100644
index 000000000000..c21f8a701685
--- /dev/null
+++ b/test/std/experimental/any/any.class/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 <experimental/string_view>
+
+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
new file mode 100644
index 000000000000..9d9a5cdb4726
--- /dev/null
+++ b/test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
@@ -0,0 +1,146 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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/any>
+
+// template <class ValueType>
+// ValueType const* any_cast(any const *) noexcept;
+//
+// template <class ValueType>
+// ValueType * any_cast(any *) noexcept;
+
+#include <experimental/any>
+#include <type_traits>
+#include <cassert>
+
+#include "any_helpers.h"
+
+using std::experimental::any;
+using std::experimental::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.clear();
+ 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);
+}
+
+int main() {
+ test_cast_is_noexcept();
+ test_cast_return_type();
+ test_cast_nullptr();
+ test_cast_empty();
+ test_cast<small>();
+ test_cast<large>();
+}
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
new file mode 100644
index 000000000000..e97560937fb0
--- /dev/null
+++ b/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
@@ -0,0 +1,309 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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/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 <experimental/any>
+#include <type_traits>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::experimental::any;
+using std::experimental::any_cast;
+using std::experimental::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 {
+ any_cast<Type>(static_cast<any&&>(a));
+ assert(false);
+ } catch (bad_any_cast const &) {
+ // do nothing
+ } catch (...) {
+ assert(false);
+ }
+#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 non-const rvalue
+ {
+ Type& v = any_cast<Type&>(std::move(a));
+ assert(v.value == 42);
+
+ Type const &cv = any_cast<Type const&>(std::move(a));
+ 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 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)));
+ 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);
+
+ 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 == 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 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::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 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 == 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 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);
+ }
+ // 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);
+}
+
+// Even though you can't get a non-copyable class into std::any
+// the standard requires that these overloads compile and function.
+void test_non_copyable_ref() {
+ struct no_copy
+ {
+ no_copy() {}
+ no_copy(no_copy &&) {}
+ private:
+ no_copy(no_copy const &);
+ };
+
+ any a;
+ checkThrows<no_copy &, no_copy const&>(a);
+ checkThrows<no_copy const&>(a);
+ assertEmpty(a);
+}
+
+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>();
+ test_non_copyable_ref();
+}
diff --git a/test/std/experimental/any/any.nonmembers/any.cast/const_correctness.fail.cpp b/test/std/experimental/any/any.nonmembers/any.cast/const_correctness.fail.cpp
new file mode 100644
index 000000000000..db5149265ccc
--- /dev/null
+++ b/test/std/experimental/any/any.nonmembers/any.cast/const_correctness.fail.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
+
+// <experimental/any>
+
+// template <class ValueType>
+// ValueType any_cast(any const &);
+
+// Try and cast away const.
+
+#include <experimental/any>
+
+struct TestType {};
+struct TestType2 {};
+
+int main()
+{
+ using std::experimental::any;
+ using std::experimental::any_cast;
+
+ any a;
+
+ // expected-error@experimental/any:* 2 {{binding value of type '_Tp' (aka 'const TestType') to reference to type 'TestType' drops 'const' qualifier}}
+ any_cast<TestType &>(static_cast<any const&>(a)); // expected-note {{requested here}}
+ any_cast<TestType &&>(static_cast<any const&>(a)); // expected-note {{requested here}}
+
+ // expected-error@experimental/any:* 2 {{binding value of type '_Tp' (aka 'const TestType2') to reference to type 'TestType2' drops 'const' qualifier}}
+ any_cast<TestType2 &>(static_cast<any const&&>(a)); // expected-note {{requested here}}
+ any_cast<TestType2 &&>(static_cast<any const&&>(a)); // expected-note {{requested here}}
+}
diff --git a/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp b/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
new file mode 100644
index 000000000000..c6cc68d72706
--- /dev/null
+++ b/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.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
+
+// <experimental/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 <experimental/any>
+
+using std::experimental::any;
+using std::experimental::any_cast;
+
+struct no_copy
+{
+ no_copy() {}
+ no_copy(no_copy &&) {}
+private:
+ no_copy(no_copy const &);
+};
+
+int main() {
+ any a;
+ any_cast<no_copy>(static_cast<any&>(a));
+ any_cast<no_copy>(static_cast<any const&>(a));
+ any_cast<no_copy>(static_cast<any &&>(a));
+ // expected-error@experimental/any:* 3 {{static_assert failed "_ValueType is required to be a reference or a CopyConstructible type."}}
+ // expected-error@experimental/any:* 3 {{calling a private constructor of class 'no_copy'}}
+} \ No newline at end of file
diff --git a/test/std/experimental/any/any.nonmembers/any.cast/reference_types.fail.cpp b/test/std/experimental/any/any.nonmembers/any.cast/reference_types.fail.cpp
new file mode 100644
index 000000000000..6c6ccc68787a
--- /dev/null
+++ b/test/std/experimental/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
+
+// <experimental/any>
+
+// template <class ValueType>
+// ValueType const* any_cast(any const *) noexcept;
+//
+// template <class ValueType>
+// ValueType * any_cast(any *) noexcept;
+
+#include <experimental/any>
+
+using std::experimental::any;
+using std::experimental::any_cast;
+
+int main()
+{
+ any a(1);
+ any_cast<int &>(&a); // expected-error@experimental/any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int &&>(&a); // expected-error@experimental/any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int const &>(&a); // expected-error@experimental/any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int const&&>(&a); // expected-error@experimental/any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any const& a2 = a;
+ any_cast<int &>(&a2); // expected-error@experimental/any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int &&>(&a2); // expected-error@experimental/any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int const &>(&a2); // expected-error@experimental/any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int const &&>(&a2); // expected-error@experimental/any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+}
diff --git a/test/std/experimental/any/any.nonmembers/swap.pass.cpp b/test/std/experimental/any/any.nonmembers/swap.pass.cpp
new file mode 100644
index 000000000000..a3fbd43d9247
--- /dev/null
+++ b/test/std/experimental/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
+
+// <experimental/any>
+
+// void swap(any &, any &) noexcept
+
+// swap(...) just wraps any::swap(...). That function is tested elsewhere.
+
+#include <experimental/any>
+#include <cassert>
+
+using std::experimental::any;
+using std::experimental::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/experimental/func/func.searchers/func.searchers.boyer_moore/default.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/default.pass.cpp
new file mode 100644
index 000000000000..7647b536aa95
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/default.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
+
+// <functional>
+
+// boyer_moore searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_searcher {
+// public:
+// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// RandomAccessIterator2
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+
+#include <experimental/algorithm>
+#include <experimental/functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) {
+ std::experimental::boyer_moore_searcher<Iter2> s{b2, e2};
+ assert(result == std::experimental::search(b1, e1, s));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ 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));
+ int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sj = sizeof(ij)/sizeof(ij[0]);
+ int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sk = sizeof(ik)/sizeof(ik[0]);
+ do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
+}
+
+template <class Iter1, class Iter2>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
+ char ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sj = sizeof(ij)/sizeof(ij[0]);
+ char ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sk = sizeof(ik)/sizeof(ik[0]);
+ do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
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
new file mode 100644
index 000000000000..1323044c8704
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp
@@ -0,0 +1,124 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// boyer_moore searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_searcher {
+// public:
+// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// RandomAccessIterator2
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+
+#include <experimental/algorithm>
+#include <experimental/functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename T> struct MyHash {
+ size_t operator () (T t) const { return static_cast<size_t>(t); }
+};
+
+template <typename Iter1, typename Iter2>
+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};
+ assert(result == std::experimental::search(b1, e1, s));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ 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>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
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
new file mode 100644
index 000000000000..8fd5b8c9f784
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp
@@ -0,0 +1,135 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// boyer_moore searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_searcher {
+// public:
+// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// RandomAccessIterator2
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+
+#include <experimental/algorithm>
+#include <experimental/functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename T> struct MyHash {
+ size_t operator () (T t) const { return static_cast<size_t>(t); }
+};
+
+struct count_equal
+{
+ static unsigned count;
+ template <class T>
+ bool operator()(const T& x, const T& y) const
+ {++count; return x == y;}
+};
+
+unsigned count_equal::count = 0;
+
+template <typename Iter1, typename Iter2>
+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>,
+ count_equal>
+ s{b2, e2};
+ assert(result == std::experimental::search(b1, e1, s));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ 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>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
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
new file mode 100644
index 000000000000..d0655c82febb
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.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
+
+// <functional>
+
+// boyer_moore searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_searcher {
+// public:
+// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// RandomAccessIterator2
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+
+#include <experimental/algorithm>
+#include <experimental/functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+struct count_equal
+{
+ static unsigned count;
+ template <class T>
+ bool operator()(const T& x, const T& y) const
+ {++count; return x == y;}
+};
+
+unsigned count_equal::count = 0;
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
+ std::experimental::boyer_moore_searcher<Iter2,
+ 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);
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ 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>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
diff --git a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/default.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/default.pass.cpp
new file mode 100644
index 000000000000..af3bbbafb24e
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/default.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
+
+// <functional>
+
+// boyer_moore_horspool searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_horspool_searcher {
+// public:
+// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// RandomAccessIterator2
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+
+#include <experimental/algorithm>
+#include <experimental/functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) {
+ std::experimental::boyer_moore_horspool_searcher<Iter2> s{b2, e2};
+ assert(result == std::experimental::search(b1, e1, s));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ 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));
+ int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sj = sizeof(ij)/sizeof(ij[0]);
+ int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sk = sizeof(ik)/sizeof(ik[0]);
+ do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
+}
+
+template <class Iter1, class Iter2>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3));
+ char ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sj = sizeof(ij)/sizeof(ij[0]);
+ char ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sk = sizeof(ik)/sizeof(ik[0]);
+ do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
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
new file mode 100644
index 000000000000..ff289f0edeb0
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp
@@ -0,0 +1,123 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// boyer_moore_horspool searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_horspool_searcher {
+// public:
+// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// RandomAccessIterator2
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+#include <experimental/algorithm>
+#include <experimental/functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename T> struct MyHash {
+ size_t operator () (T t) const { return static_cast<size_t>(t); }
+};
+
+template <typename Iter1, typename Iter2>
+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};
+ assert(result == std::experimental::search(b1, e1, s));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ 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>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
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
new file mode 100644
index 000000000000..1150210a978a
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.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
+
+// <functional>
+
+// boyer_moore_horspool searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_horspool_searcher {
+// public:
+// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// RandomAccessIterator2
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+#include <experimental/algorithm>
+#include <experimental/functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename T> struct MyHash {
+ size_t operator () (T t) const { return static_cast<size_t>(t); }
+};
+
+struct count_equal
+{
+ static unsigned count;
+ template <class T>
+ bool operator()(const T& x, const T& y) const
+ {++count; return x == y;}
+};
+
+unsigned count_equal::count = 0;
+
+template <typename Iter1, typename Iter2>
+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>,
+ count_equal>
+ s{b2, e2};
+ assert(result == std::experimental::search(b1, e1, s));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ 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>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
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
new file mode 100644
index 000000000000..55426874abe5
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp
@@ -0,0 +1,130 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// boyer_moore_horspool searcher
+// template<class RandomAccessIterator1,
+// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
+// class BinaryPredicate = equal_to<>>
+// class boyer_moore_horspool_searcher {
+// public:
+// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last,
+// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate());
+//
+// template<class RandomAccessIterator2>
+// RandomAccessIterator2
+// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const;
+//
+// private:
+// RandomAccessIterator1 pat_first_; // exposition only
+// RandomAccessIterator1 pat_last_; // exposition only
+// Hash hash_; // exposition only
+// BinaryPredicate pred_; // exposition only
+// };
+
+#include <experimental/algorithm>
+#include <experimental/functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+struct count_equal
+{
+ static unsigned count;
+ template <class T>
+ bool operator()(const T& x, const T& y) const
+ {++count; return x == y;}
+};
+
+unsigned count_equal::count = 0;
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
+ std::experimental::boyer_moore_horspool_searcher<Iter2,
+ 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);
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ 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>
+void
+test2()
+{
+ char ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ char id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ char ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ char ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ const unsigned sh = sizeof(ih)/sizeof(ih[0]);
+ char ii[] = {1, 1, 2};
+ do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+}
+
+int main() {
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+ test2<random_access_iterator<const char*>, random_access_iterator<const char*> >();
+}
diff --git a/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp
new file mode 100644
index 000000000000..446dcbde42be
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp
@@ -0,0 +1,95 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// default searcher
+// template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
+// class default_searcher {
+// public:
+// default_searcher(_ForwardIterator __f, _ForwardIterator __l,
+// _BinaryPredicate __p = _BinaryPredicate())
+// : __first_(__f), __last_(__l), __pred_(__p) {}
+//
+// template <typename _ForwardIterator2>
+// _ForwardIterator2 operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const {
+// return std::search(__f, __l, __first_, __last_, __pred_);
+// }
+//
+// private:
+// _ForwardIterator __first_;
+// _ForwardIterator __last_;
+// _BinaryPredicate __pred_;
+// };
+
+
+#include <experimental/algorithm>
+#include <experimental/functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) {
+ std::experimental::default_searcher<Iter2> s{b2, e2};
+ assert(result == std::experimental::search(b1, e1, s));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ 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));
+ int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sj = sizeof(ij)/sizeof(ij[0]);
+ int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sk = sizeof(ik)/sizeof(ik[0]);
+ do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
+}
+
+int main() {
+ test<forward_iterator<const int*>, forward_iterator<const int*> >();
+ test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<forward_iterator<const int*>, random_access_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
+ test<random_access_iterator<const int*>, forward_iterator<const int*> >();
+ test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+}
diff --git a/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp
new file mode 100644
index 000000000000..b65c500c3192
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// default searcher
+// template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
+// class default_searcher {
+// public:
+// default_searcher(_ForwardIterator __f, _ForwardIterator __l,
+// _BinaryPredicate __p = _BinaryPredicate())
+// : __first_(__f), __last_(__l), __pred_(__p) {}
+//
+// template <typename _ForwardIterator2>
+// _ForwardIterator2 operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const {
+// return std::search(__f, __l, __first_, __last_, __pred_);
+// }
+//
+// private:
+// _ForwardIterator __first_;
+// _ForwardIterator __last_;
+// _BinaryPredicate __pred_;
+// };
+
+
+#include <experimental/algorithm>
+#include <experimental/functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+struct count_equal
+{
+ static unsigned count;
+ template <class T>
+ bool operator()(const T& x, const T& y) const
+ {++count; return x == y;}
+};
+
+unsigned count_equal::count = 0;
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
+ std::experimental::default_searcher<Iter2, 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>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ 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);
+}
+
+int main() {
+ test<forward_iterator<const int*>, forward_iterator<const int*> >();
+ test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<forward_iterator<const int*>, random_access_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
+ test<random_access_iterator<const int*>, forward_iterator<const int*> >();
+ test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+}
diff --git a/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pass.cpp
new file mode 100644
index 000000000000..9528002d5f2d
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.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
+
+// <functional>
+
+// template<class ForwardIterator, class BinaryPredicate = equal_to<>>
+// default_searcher<ForwardIterator, BinaryPredicate>
+// make_default_searcher(ForwardIterator pat_first, ForwardIterator pat_last,
+// BinaryPredicate pred = BinaryPredicate());
+
+
+#include <experimental/algorithm>
+#include <experimental/functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) {
+ assert(result == std::experimental::search(b1, e1,
+ std::experimental::make_default_searcher(b2, e2)));
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2));
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3));
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia));
+ do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1));
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1));
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1));
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1));
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4));
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8));
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ 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));
+ int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sj = sizeof(ij)/sizeof(ij[0]);
+ int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0};
+ const unsigned sk = sizeof(ik)/sizeof(ik[0]);
+ do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6));
+}
+
+int main() {
+ test<forward_iterator<const int*>, forward_iterator<const int*> >();
+ test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<forward_iterator<const int*>, random_access_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
+ test<random_access_iterator<const int*>, forward_iterator<const int*> >();
+ test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+}
diff --git a/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pred.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pred.pass.cpp
new file mode 100644
index 000000000000..277020213149
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pred.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.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <functional>
+
+// template<class ForwardIterator, class BinaryPredicate = equal_to<>>
+// default_searcher<ForwardIterator, BinaryPredicate>
+// make_default_searcher(ForwardIterator pat_first, ForwardIterator pat_last,
+// BinaryPredicate pred = BinaryPredicate());
+
+
+#include <experimental/algorithm>
+#include <experimental/functional>
+#include <cassert>
+
+#include "test_iterators.h"
+
+struct count_equal
+{
+ static unsigned count;
+ template <class T>
+ bool operator()(const T& x, const T& y)
+ {++count; return x == y;}
+};
+
+unsigned count_equal::count = 0;
+
+template <typename Iter1, typename Iter2>
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
+ count_equal::count = 0;
+ assert(result == std::experimental::search(b1, e1,
+ std::experimental::make_default_searcher(b2, e2)));
+ assert(count_equal::count <= max_count);
+}
+
+template <class Iter1, class Iter2>
+void
+test()
+{
+ int ia[] = {0, 1, 2, 3, 4, 5};
+ const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa);
+ do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0);
+ do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa);
+ 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};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb);
+ int id[] = {1, 2};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2);
+ int ie[] = {1, 2, 3};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3);
+ int ig[] = {1, 2, 3, 4};
+ do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4);
+ int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4};
+ 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);
+}
+
+int main() {
+ test<forward_iterator<const int*>, forward_iterator<const int*> >();
+ test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<forward_iterator<const int*>, random_access_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
+ test<random_access_iterator<const int*>, forward_iterator<const int*> >();
+ test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
+ test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
+}
diff --git a/test/std/experimental/func/func.searchers/nothing_to_do.pass.cpp b/test/std/experimental/func/func.searchers/nothing_to_do.pass.cpp
new file mode 100644
index 000000000000..9a59227abdd9
--- /dev/null
+++ b/test/std/experimental/func/func.searchers/nothing_to_do.pass.cpp
@@ -0,0 +1,13 @@
+// -*- 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/experimental/func/header.functional.synop/includes.pass.cpp b/test/std/experimental/func/header.functional.synop/includes.pass.cpp
new file mode 100644
index 000000000000..1b72d4a7ad02
--- /dev/null
+++ b/test/std/experimental/func/header.functional.synop/includes.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
+
+// <experimental/functional>
+//
+// has to include <functional>
+
+#include <experimental/functional>
+
+int main()
+{
+ std::function<int(int)> x;
+}
diff --git a/test/std/experimental/func/nothing_to_do.pass.cpp b/test/std/experimental/func/nothing_to_do.pass.cpp
new file mode 100644
index 000000000000..9a59227abdd9
--- /dev/null
+++ b/test/std/experimental/func/nothing_to_do.pass.cpp
@@ -0,0 +1,13 @@
+// -*- 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/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp
index 81c3b4e6dfa2..999d03d3a885 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
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <optional>
// optional<T>& operator=(const optional<T>& rhs);
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 c4361ea5178d..ec98ef449153 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
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <optional>
// template <class... Args> void optional<T>::emplace(Args&&... args);
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 8d20be3de19a..aada0f4ec535 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
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <optional>
// template <class U, class... Args>
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 d27313dad42b..3e084e5b7dc2 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
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <optional>
// optional<T>& operator=(optional<T>&& rhs)
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 071f5943b972..9b6511a0006d 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
@@ -6,6 +6,9 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: libcpp-no-exceptions
// <optional>
@@ -15,8 +18,6 @@
#include <type_traits>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
using std::experimental::optional;
class X
@@ -39,18 +40,14 @@ public:
class Z
{
- int i_;
public:
- Z(int i) : i_(i) {}
+ Z(int) {}
Z(const Z&) {throw 6;}
};
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
{
typedef int T;
constexpr T t(5);
@@ -113,5 +110,4 @@ int main()
assert(i == 6);
}
}
-#endif // _LIBCPP_STD_VER > 11
}
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 8726f95a00c0..7d401de1d978 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
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <optional>
// optional(const optional<T>& 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 412c993ffbd7..014ee859e8a9 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
@@ -6,6 +6,9 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: libcpp-no-exceptions
// <optional>
@@ -16,7 +19,6 @@
#include <type_traits>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
using std::experimental::optional;
using std::experimental::in_place_t;
@@ -52,17 +54,13 @@ public:
class Z
{
- int i_;
public:
- Z(int i) : i_(i) {throw 6;}
+ Z(int i) {throw 6;}
};
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
{
constexpr optional<int> opt(in_place, 5);
static_assert(static_cast<bool>(opt) == true, "");
@@ -141,5 +139,4 @@ int main()
assert(i == 6);
}
}
-#endif // _LIBCPP_STD_VER > 11
}
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 98cb929dc51e..7a98e0bf31f3 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
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <optional>
// template <class U, class... Args>
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 b320c95c5827..40d55f918993 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
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <optional>
// optional(optional<T>&& rhs) noexcept(is_nothrow_move_constructible<T>::value);
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 ac52a42d5953..ef21fcdf9e6d 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
@@ -6,6 +6,9 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: libcpp-no-exceptions
// <optional>
@@ -15,8 +18,6 @@
#include <type_traits>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
using std::experimental::optional;
class X
@@ -41,17 +42,14 @@ public:
class Z
{
- int i_;
public:
- Z(int i) : i_(i) {}
+ Z(int) {}
Z(Z&&) {throw 6;}
};
-#endif // _LIBCPP_STD_VER > 11
int main()
{
-#if _LIBCPP_STD_VER > 11
{
typedef int T;
constexpr optional<T> opt(T(5));
@@ -106,5 +104,4 @@ int main()
assert(i == 6);
}
}
-#endif // _LIBCPP_STD_VER > 11
}
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 e91805e9c8e5..85f9be6998a0 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
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <optional>
// T& optional<T>::value();
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 39bf687ff3c5..c99baab8b6e4 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
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <optional>
// constexpr const T& optional<T>::value() const;
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 e0ecfdebb8cf..d24a2d06b9d5 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
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <optional>
// void swap(optional&)
diff --git a/test/std/experimental/optional/optional.specalg/swap.pass.cpp b/test/std/experimental/optional/optional.specalg/swap.pass.cpp
index e31d2173425b..6c5f7b0e860c 100644
--- a/test/std/experimental/optional/optional.specalg/swap.pass.cpp
+++ b/test/std/experimental/optional/optional.specalg/swap.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <optional>
// template <class T> void swap(optional<T>& x, optional<T>& y)
diff --git a/test/std/experimental/string.view/string.view.access/at.pass.cpp b/test/std/experimental/string.view/string.view.access/at.pass.cpp
index 3003ea835470..a3208c1645a2 100644
--- a/test/std/experimental/string.view/string.view.access/at.pass.cpp
+++ b/test/std/experimental/string.view/string.view.access/at.pass.cpp
@@ -10,6 +10,7 @@
// 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
+// XFAIL: libcpp-no-exceptions
// <string_view>
diff --git a/test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp
index 6b20639f7752..7ccbd528c7fc 100644
--- a/test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string_view>
// constexpr int compare(size_type pos1, size_type n1, const charT* s) const;
diff --git a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp
index 2047862b0002..244de9eb5104 100644
--- a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp
+++ b/test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string_view>
// constexpr int compare(size_type pos1, size_type n1, basic_string_view str) const;
diff --git a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
index acb48f5fb6cc..1c3bc089a656 100644
--- a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string_view>
// constexpr int compare(size_type pos1, size_type n1,
diff --git a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
index 33407ef0747e..c7a6f1e1eb66 100644
--- a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string_view>
// constexpr int compare(size_type pos1, size_type n1, basic_string_view str,
diff --git a/test/std/experimental/string.view/string.view.ops/copy.pass.cpp b/test/std/experimental/string.view/string.view.ops/copy.pass.cpp
index 96246d2732c7..0e4eb9e50bb0 100644
--- a/test/std/experimental/string.view/string.view.ops/copy.pass.cpp
+++ b/test/std/experimental/string.view/string.view.ops/copy.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string_view>
// size_type copy(charT* s, size_type n, size_type pos = 0) const;
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 123646240f2e..c80e90a04788 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
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string_view>
// constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;
diff --git a/test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp
index 56dc3c6aaa25..cb44707fa7e7 100644
--- a/test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp
+++ b/test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp
@@ -20,6 +20,11 @@
#include <utility>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
+
namespace ex = std::experimental;
int call_with_value(int x, int y) { return (x + y); }
diff --git a/test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp
index 322554925d3f..0c5170f29cea 100644
--- a/test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp
+++ b/test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp
@@ -22,6 +22,10 @@
#include <utility>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
int count = 0;
struct A_int_0
diff --git a/test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp
index 5d3d564c26fb..52eec276394a 100644
--- a/test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp
+++ b/test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp
@@ -20,6 +20,10 @@
#include <utility>
#include <cassert>
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
namespace ex = std::experimental;
int count = 0;
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 ec4ad8a3bbca..a06f0443d701 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
@@ -80,6 +80,7 @@
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-zero-length"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
int main()
{
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
index e6f4e1e4c19e..dc4e0ba0de20 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
@@ -63,4 +63,13 @@ int main()
is.seekg(-1);
assert(is.fail());
}
+ {
+ testbuf<char> sb(" 123456789");
+ std::istream is(&sb);
+ is.setstate(std::ios_base::eofbit);
+ assert(is.eof());
+ is.seekg(5);
+ assert(is.good());
+ assert(!is.eof());
+ }
}
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
index 73f3da1c6bd1..3cedf9192808 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
@@ -71,4 +71,13 @@ int main()
assert(is.fail());
assert(seekoff_called == 4);
}
+ {
+ testbuf<char> sb(" 123456789");
+ std::istream is(&sb);
+ is.setstate(std::ios_base::eofbit);
+ assert(is.eof());
+ is.seekg(5, std::ios_base::beg);
+ assert(is.good());
+ assert(!is.eof());
+ }
}
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 112928ca0ce6..a8ef34e49278 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <ostream>
// template <class charT, class traits = char_traits<charT> >
diff --git a/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp b/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp
index 5c9abbe53793..a9c5f30f37ae 100644
--- a/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp
+++ b/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp
@@ -19,6 +19,9 @@
int main()
{
+ // LWG2462 std::ios_base::failure is overspecified
+ static_assert((std::is_base_of<std::system_error, std::ios_base::failure>::value), "");
+
{
std::string what_arg("io test message");
std::ios_base::failure se(what_arg, make_error_code(std::errc::is_a_directory));
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 c46e2c054e8f..acefb8d16176 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
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 2d4beee37ec2..1c40a81aa069 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <ios>
// template <class charT, class traits> class basic_ios
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 0c2e8f0860ce..c4aad797801d 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <ios>
// template <class charT, class traits> class basic_ios
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 a0013eabdac6..9347644b12b1 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <ios>
// template <class charT, class traits> class basic_ios
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 b3c66c487e9f..41cb61db194d 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <ios>
// template <class charT, class traits> class basic_ios
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 3abf9423a12e..67363b559d99 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
@@ -29,7 +29,7 @@ struct testbuf
: base(str, which) {}
typename base::int_type
- overflow(typename base::int_type c = base::type_traits::eof())
+ overflow(typename base::int_type c = base::traits_type::eof())
{++overflow_called; return base::overflow(c);}
void pbump(int n) {base::pbump(n);}
@@ -37,6 +37,10 @@ struct testbuf
int main()
{
+ { // sanity check
+ testbuf<char> tb("");;
+ tb.overflow();
+ }
{
testbuf<char> sb("abc");
assert(sb.sputc('1') == '1');
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 4af0e63029a7..a0509008d50b 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
@@ -27,7 +27,7 @@ struct testbuf
: base(str, which) {}
typename base::int_type
- pbackfail(typename base::int_type c = base::type_traits::eof())
+ pbackfail(typename base::int_type c = base::traits_type::eof())
{return base::pbackfail(c);}
void pbump(int n) {base::pbump(n);}
@@ -35,6 +35,10 @@ struct testbuf
int main()
{
+ { // sanity check
+ testbuf<char> tb("");;
+ tb.pbackfail();
+ }
{
testbuf<char> sb("123", std::ios_base::in);
assert(sb.sgetc() == '1');
diff --git a/test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp b/test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp
index f584110499b8..0952588b0cb1 100644
--- a/test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp
+++ b/test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp
@@ -12,6 +12,8 @@
// template <InputIterator Iter>
// Iter next(Iter x, Iter::difference_type n = 1);
+// LWG #2353 relaxed the requirement on next from ForwardIterator to InputIterator
+
#include <iterator>
#include <cassert>
@@ -34,11 +36,13 @@ test(It i, It x)
int main()
{
const char* s = "1234567890";
+ test(input_iterator<const char*>(s), 10, input_iterator<const char*>(s+10));
test(forward_iterator<const char*>(s), 10, forward_iterator<const char*>(s+10));
test(bidirectional_iterator<const char*>(s), 10, bidirectional_iterator<const char*>(s+10));
test(random_access_iterator<const char*>(s), 10, random_access_iterator<const char*>(s+10));
test(s, 10, s+10);
+ test(input_iterator<const char*>(s), input_iterator<const char*>(s+1));
test(forward_iterator<const char*>(s), forward_iterator<const char*>(s+1));
test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s+1));
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1));
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 02ef571a06f9..932ef25b784c 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
@@ -17,6 +17,10 @@
#include <sstream>
#include <cassert>
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wliteral-conversion"
+#endif
+
int main()
{
{
diff --git a/test/std/language.support/support.dynamic/alloc.errors/new.handler/new_handler.pass.cpp b/test/std/language.support/support.dynamic/alloc.errors/new.handler/new_handler.pass.cpp
index 6b799a3e83d8..0d4524cacb38 100644
--- a/test/std/language.support/support.dynamic/alloc.errors/new.handler/new_handler.pass.cpp
+++ b/test/std/language.support/support.dynamic/alloc.errors/new.handler/new_handler.pass.cpp
@@ -10,10 +10,14 @@
// test new_handler
#include <new>
+#include <type_traits>
+#include <cassert>
void f() {}
int main()
{
+ static_assert((std::is_same<std::new_handler, void(*)()>::value), "");
std::new_handler p = f;
+ assert(p == &f);
}
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 5a87c0738784..55a3200a13b7 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// test operator new[]
// NOTE: asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete
@@ -38,7 +39,8 @@ int main()
std::set_new_handler(new_handler);
try
{
- void*volatile vp = operator new[] (std::numeric_limits<std::size_t>::max());
+ void* volatile vp = operator new[] (std::numeric_limits<std::size_t>::max());
+ ((void)vp);
assert(false);
}
catch (std::bad_alloc&)
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 b0db4a8e57e2..9531b1c37480 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// test operator new [] (nothrow)
// NOTE: asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete
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 6447e29726c1..0e2cc6d8da4e 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
@@ -11,11 +11,10 @@
// UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11
-// TODO: Clang does not enable sized-deallocation in c++14 and behond by
+// NOTE: Clang does not enable sized-deallocation in c++14 and beyond by
// default. It is only enabled when -fsized-deallocation is given.
-// (except clang-3.6 which temporarly enabled sized-deallocation)
-// XFAIL: clang-3.4, clang-3.5, clang-3.7
-// XFAIL: apple-clang
+// (except clang-3.6 which temporarily enabled sized-deallocation)
+// UNSUPPORTED: clang, apple-clang
// NOTE: GCC 4.9.1 does not support sized-deallocation in c++14. However
// GCC 5.1 does.
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 58aa3f2d529c..57ce28752208 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// test operator new
// asan and msan will not call the new handler.
@@ -39,6 +40,7 @@ int main()
try
{
void* vp = operator new (std::numeric_limits<std::size_t>::max());
+ ((void)vp);
assert(false);
}
catch (std::bad_alloc&)
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 8c095ad32db4..c2f5830495d2 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// test operator new (nothrow)
// asan and msan will not call the new handler.
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 3c7f54fef726..5d9ddd4f0526 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
@@ -11,11 +11,10 @@
// UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11
-// TODO: Clang does not enable sized-deallocation in c++14 and behond by
+// NOTE: Clang does not enable sized-deallocation in c++14 and beyond by
// default. It is only enabled when -fsized-deallocation is given.
-// (except clang-3.6 which temporarly enabled sized-deallocation)
-// XFAIL: clang-3.4, clang-3.5, clang-3.7
-// XFAIL: apple-clang
+// (except clang-3.6 which temporarily enabled sized-deallocation)
+// UNSUPPORTED: clang, apple-clang
// NOTE: GCC 4.9.1 does not support sized-deallocation in c++14. However
// GCC 5.1 does.
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 cbe303c570d6..a5508d1436fa 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;
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 bfa13707a971..f9f293300e62 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;
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 1422f770eca8..67766aa2c461 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;
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 567ed579eb7b..a8b6e15feab8 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;
@@ -36,6 +37,13 @@ public:
B(const B& b) : A(b) {}
};
+class C
+{
+public:
+ virtual ~C() {}
+ C * operator&() const { assert(false); } // should not be called
+};
+
int main()
{
{
@@ -78,7 +86,7 @@ int main()
{
try
{
- std::rethrow_if_nested(1);
+ std::rethrow_if_nested(C());
assert(true);
}
catch (...)
@@ -86,4 +94,5 @@ int main()
assert(false);
}
}
+
}
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 b07269061b4b..13c1dfe59311 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: 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 dad0df248076..98006bb1e3a0 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;
diff --git a/test/std/language.support/support.exception/exception.terminate/terminate.handler/terminate_handler.pass.cpp b/test/std/language.support/support.exception/exception.terminate/terminate.handler/terminate_handler.pass.cpp
index 232ce0a5a888..e477f5298e89 100644
--- a/test/std/language.support/support.exception/exception.terminate/terminate.handler/terminate_handler.pass.cpp
+++ b/test/std/language.support/support.exception/exception.terminate/terminate.handler/terminate_handler.pass.cpp
@@ -10,10 +10,14 @@
// test terminate_handler
#include <exception>
+#include <type_traits>
+#include <cassert>
void f() {}
int main()
{
+ static_assert((std::is_same<std::terminate_handler, void(*)()>::value), "");
std::terminate_handler p = f;
+ assert(p == &f);
}
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 9ff0d6e2ce4d..09adf580bddf 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: 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 89c9f85d3810..6e4c0a98b09f 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: 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 e47a5989d41c..c28c901bdd73 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: 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 22d8d8e982ae..573d85bd242c 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: 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 1adc904fd5d2..b35ad7313bcc 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// test uncaught_exceptions
#include <exception>
diff --git a/test/std/language.support/support.runtime/csignal.pass.cpp b/test/std/language.support/support.runtime/csignal.pass.cpp
index 717347df7f00..a42363f8b27f 100644
--- a/test/std/language.support/support.runtime/csignal.pass.cpp
+++ b/test/std/language.support/support.runtime/csignal.pass.cpp
@@ -50,7 +50,8 @@
int main()
{
- std::sig_atomic_t sig;
+ std::sig_atomic_t sig = 0;
+ ((void)sig);
typedef void (*func)(int);
static_assert((std::is_same<decltype(std::signal(0, (func)0)), func>::value), "");
static_assert((std::is_same<decltype(std::raise(0)), int>::value), "");
diff --git a/test/std/language.support/support.runtime/cstdarg.pass.cpp b/test/std/language.support/support.runtime/cstdarg.pass.cpp
index 059ad2f4ff91..9d6f610a943e 100644
--- a/test/std/language.support/support.runtime/cstdarg.pass.cpp
+++ b/test/std/language.support/support.runtime/cstdarg.pass.cpp
@@ -32,4 +32,5 @@
int main()
{
std::va_list va;
+ ((void)va);
}
diff --git a/test/std/language.support/support.runtime/cstdlib.pass.cpp b/test/std/language.support/support.runtime/cstdlib.pass.cpp
index 073949122b01..d8f88cf58d9d 100644
--- a/test/std/language.support/support.runtime/cstdlib.pass.cpp
+++ b/test/std/language.support/support.runtime/cstdlib.pass.cpp
@@ -11,6 +11,13 @@
#include <cstdlib>
#include <type_traits>
+#include <cassert>
+
+// As of 1/10/2015 clang emits a -Wnonnull warnings even if the warning occurs
+// in an unevaluated context. For this reason we manually suppress the warning.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wnonnull"
+#endif
#ifndef EXIT_FAILURE
#error EXIT_FAILURE not defined
@@ -32,12 +39,23 @@
#error RAND_MAX not defined
#endif
+template <class TestType, class IntType>
+void test_div_struct() {
+ TestType obj;
+ static_assert(sizeof(obj) >= sizeof(IntType) * 2, ""); // >= to account for alignment.
+ static_assert((std::is_same<decltype(obj.quot), IntType>::value), "");
+ static_assert((std::is_same<decltype(obj.rem), IntType>::value), "");
+ ((void) obj);
+};
+
int main()
{
std::size_t s = 0;
- std::div_t d;
- std::ldiv_t ld;
- std::lldiv_t lld;
+ ((void)s);
+ static_assert((std::is_same<std::size_t, decltype(sizeof(int))>::value), "");
+ test_div_struct<std::div_t, int>();
+ test_div_struct<std::ldiv_t, long>();
+ test_div_struct<std::lldiv_t, long long>();
char** endptr = 0;
static_assert((std::is_same<decltype(std::atof("")), double>::value), "");
static_assert((std::is_same<decltype(std::atoi("")), int>::value), "");
diff --git a/test/std/language.support/support.runtime/ctime.pass.cpp b/test/std/language.support/support.runtime/ctime.pass.cpp
index 8c5d2811d8a9..03a0aa4d6966 100644
--- a/test/std/language.support/support.runtime/ctime.pass.cpp
+++ b/test/std/language.support/support.runtime/ctime.pass.cpp
@@ -23,6 +23,7 @@
int main()
{
std::clock_t c = 0;
+ ((void)c);
std::size_t s = 0;
std::time_t t = 0;
std::tm tm = {0};
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 4d7c8b0bc0a6..1cc2aa62032e 100644
--- a/test/std/language.support/support.types/nullptr_t.pass.cpp
+++ b/test/std/language.support/support.types/nullptr_t.pass.cpp
@@ -52,6 +52,24 @@ void test_comparisons()
assert(!(nullptr > p));
}
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnull-conversion"
+#endif
+void test_nullptr_conversions() {
+ {
+ bool b = nullptr;
+ assert(!b);
+ }
+ {
+ bool b(nullptr);
+ assert(!b);
+ }
+}
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
int main()
{
@@ -72,8 +90,5 @@ int main()
test_comparisons<A*>();
test_comparisons<void(*)()>();
}
- {
- bool b = nullptr;
- assert(!b);
- }
+ test_nullptr_conversions();
}
diff --git a/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp b/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp
index 897141235cf2..04cc060ad985 100644
--- a/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp
+++ b/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp
@@ -26,7 +26,7 @@
int main()
{
// Ensure that the default locale is not C. If it is, the second tests will fail.
- putenv(const_cast<char*>("LANG=" LOCALE_en_US_UTF_8));
+ putenv(const_cast<char*>("LC_COLLATE=" LOCALE_en_US_UTF_8));
{
std::locale l(LOCALE_en_US_UTF_8);
{
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp
index 331f4ba222dd..41c26508e22e 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp
@@ -28,7 +28,7 @@ int main()
const char from[] = "some text";
F::intern_type to[9];
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const char* from_next = 0;
F::intern_type* to_next = 0;
assert(f.in(mbs, from, from + 9, from_next,
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp
index 34ab2178327e..bd3482974a53 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp
@@ -22,7 +22,7 @@ int main()
{
std::locale l = std::locale::classic();
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const char from[] = "some text";
assert(f.length(mbs, from, from+10, 0) == 0);
assert(f.length(mbs, from, from+10, 8) == 8);
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp
index 0f65f13242c2..18997714fda6 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp
@@ -31,7 +31,7 @@ int main()
{
F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'};
char to[9] = {0};
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const F::intern_type* from_next = 0;
char* to_next = 0;
F::result r = f.out(mbs, from, from + 9, from_next,
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp
index c21303070717..9b91a03d493a 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp
@@ -26,7 +26,7 @@ int main()
std::locale l = std::locale::classic();
std::vector<char> to(3);
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
char* to_next = 0;
assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
assert(to_next == to.data());
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 8fb28f0a26ac..8f9d1e6cd1f0 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
@@ -28,7 +28,7 @@ int main()
const char from[] = "some text";
F::intern_type to[9];
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const char* from_next = 0;
F::intern_type* to_next = 0;
assert(f.in(mbs, from, from + 9, from_next,
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp
index d8555d188566..4455b9f55fbb 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp
@@ -22,7 +22,7 @@ int main()
{
std::locale l = std::locale::classic();
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const char from[] = "some text";
assert(f.length(mbs, from, from+10, 0) == 0);
assert(f.length(mbs, from, from+10, 8) == 8);
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 a1d11f748d9f..4e0f600097a0 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
@@ -31,7 +31,7 @@ int main()
{
F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'};
char to[9] = {0};
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const F::intern_type* from_next = 0;
char* to_next = 0;
F::result r = f.out(mbs, from, from + 9, from_next,
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp
index 1bd45e0370d9..0a4aa20039c5 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp
@@ -26,7 +26,7 @@ int main()
std::locale l = std::locale::classic();
std::vector<char> to(3);
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
char* to_next = 0;
assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
assert(to_next == to.data());
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp
index 4d2f6f260dfc..10c9fcdc03fe 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp
@@ -28,7 +28,7 @@ int main()
const std::basic_string<F::intern_type> from("some text");
std::vector<char> to(from.size());
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const char* from_next = 0;
char* to_next = 0;
assert(f.in(mbs, from.data(), from.data() + from.size(), from_next,
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp
index df33b182a07a..c5897c86bb8f 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp
@@ -22,7 +22,7 @@ int main()
{
std::locale l = std::locale::classic();
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const char from[10]= {0};
assert(f.length(mbs, from, from+10, 0) == 0);
assert(f.length(mbs, from, from+10, 9) == 9);
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp
index de7f024fd467..17bde6cecc2f 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp
@@ -28,7 +28,7 @@ int main()
const std::basic_string<F::intern_type> from("some text");
std::vector<char> to(from.size());
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const char* from_next = 0;
char* to_next = 0;
assert(f.out(mbs, from.data(), from.data() + from.size(), from_next,
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp
index 830bc43e9ead..834fa0f2724e 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp
@@ -26,7 +26,7 @@ int main()
std::locale l = std::locale::classic();
std::vector<char> to(3);
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
char* to_next = 0;
assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
assert(to_next == to.data());
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp
index 2505582c2613..c256078786d7 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp
@@ -30,7 +30,7 @@ int main()
const F32_8& f32_8 = std::use_facet<F32_8>(std::locale::classic());
const F32_16& f32_16 = std::use_facet<F32_16>(l);
const F16_8& f16_8 = std::use_facet<F16_8>(std::locale::classic());
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
F32_8::intern_type* c32p;
F16_8::intern_type* c16p;
F32_8::extern_type* c8p;
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 e98097ba889c..a4ff61bcff65 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
@@ -29,7 +29,7 @@ int main()
const std::basic_string<F::intern_type> expected(from.begin(), from.end());
std::basic_string<F::intern_type> to(from.size(), F::intern_type());
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const F::extern_type* from_next = 0;
F::intern_type* to_next = 0;
F::result r = f.in(mbs, from.data(), from.data() + from.size(), from_next,
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp
index f97f2b4a324d..69037aad733d 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp
@@ -22,7 +22,7 @@ int main()
{
std::locale l = std::locale::classic();
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const char* from = "123467890";
assert(f.length(mbs, from, from+10, 0) == 0);
assert(f.length(mbs, from, from+10, 9) == 9);
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 dce2d38c8279..6f025e3ff094 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
@@ -29,7 +29,7 @@ int main()
{
const std::basic_string<F::intern_type> from(L"some text");
std::vector<char> to(from.size()+1);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const F::intern_type* from_next = 0;
char* to_next = 0;
F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
@@ -43,7 +43,7 @@ int main()
std::basic_string<F::intern_type> from(L"some text");
from[4] = '\0';
std::vector<char> to(from.size()+1);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const F::intern_type* from_next = 0;
char* to_next = 0;
F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
@@ -56,7 +56,7 @@ int main()
{
std::basic_string<F::intern_type> from(L"some text");
std::vector<char> to(from.size()-1);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
const F::intern_type* from_next = 0;
char* to_next = 0;
F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp
index 4d8895cf1a7e..10ab7a2b89f4 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp
@@ -28,7 +28,7 @@ int main()
std::locale l = std::locale::classic();
std::vector<F::extern_type> to(3);
const F& f = std::use_facet<F>(l);
- std::mbstate_t mbs = {0};
+ std::mbstate_t mbs = {};
F::extern_type* to_next = 0;
assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::ok);
assert(to_next == to.data());
diff --git a/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp b/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp
index a442ae577b47..7ad431652a89 100644
--- a/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp
+++ b/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
-// NOTE: debian and opensuse use old locale data for ru_RU.UTF-8 abreviated
+// NOTE: debian and opensuse use old locale data for ru_RU.UTF-8 abbreviated
// months. This locale data was changed in glibc 2.14.
// Debian uses glibc 2.13 as of 20/11/2014
// OpenSuse uses glibc 2.19 with old locale data as of 20/11/2014
diff --git a/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp b/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp
index 631a500362da..631a6de03d82 100644
--- a/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp
+++ b/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp
@@ -12,7 +12,7 @@
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
-// NOTE: debian and opensuse use bad locale data for ru_RU.UTF-8 abreviated
+// NOTE: debian and opensuse use bad locale data for ru_RU.UTF-8 abbreviated
// months. This locale data was fixed in glibc 2.14.
// Debian uses glibc 2.13 as of 20/11/2014
// OpenSuse uses glibc 2.19 with old locale data as of 20/11/2014
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 27a3da76270f..5a58b06cc2d7 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <locale>
// wstring_convert<Codecvt, Elem, Wide_alloc, Byte_alloc>
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 a40a2d2d8833..303fd790566c 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <locale>
// template <class Facet> const Facet& use_facet(const locale& loc);
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 3567bf56c55a..b808a7650c47 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// UNSUPPORTED: sanitizer-new-delete
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 e956102c08fc..4573a4b01f47 100644
--- a/test/std/localization/locales/locale/locale.members/combine.pass.cpp
+++ b/test/std/localization/locales/locale/locale.members/combine.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <locale>
// template <class Facet> locale combine(const locale& other) const;
diff --git a/test/std/numerics/rand/rand.device/ctor.pass.cpp b/test/std/numerics/rand/rand.device/ctor.pass.cpp
index 97f46b26aa27..a7b5a7c9c348 100644
--- a/test/std/numerics/rand/rand.device/ctor.pass.cpp
+++ b/test/std/numerics/rand/rand.device/ctor.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <random>
// class random_device;
diff --git a/test/std/numerics/rand/rand.device/eval.pass.cpp b/test/std/numerics/rand/rand.device/eval.pass.cpp
index 72aff076a5df..ed5361fbde75 100644
--- a/test/std/numerics/rand/rand.device/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.device/eval.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <random>
// class random_device;
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 113243ecd349..9d74c2417d2d 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <regex>
// template <class BidirectionalIterator, class Allocator, class charT, class traits>
@@ -19,8 +20,34 @@
#include <regex>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
+extern "C" void LLVMFuzzerTestOneInput(const char *data)
+{
+ size_t size = strlen(data);
+ if (size > 0)
+ {
+ try
+ {
+ std::regex::flag_type flag = std::regex_constants::grep;
+ std::string s((const char *)data, size);
+ std::regex re(s, flag);
+ std::regex_match(s, re);
+ }
+ catch (std::regex_error &ex) {}
+ }
+}
+
+
+void fuzz_tests() // patterns that the fuzzer has found
+{
+// Raw string literals are a C++11 feature.
+#if TEST_STD_VER >= 11
+ LLVMFuzzerTestOneInput(R"XX(Õ)_%()()((\8'_%()_%()_%()_%(()_%()_%()_%(.t;)()¥f()_%()(.)_%;)()!¥f(((()()XX");
+#endif
+}
+
int main()
{
{
@@ -55,4 +82,5 @@ int main()
assert(m.position(0) == 0);
assert(m.str(0) == "");
}
+ fuzz_tests();
}
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 8bf98268c493..9c5f834b9452 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: 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_escape.pass.cpp b/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp
index 9455527412bb..4da4d957a88a 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <regex>
// template <class charT, class traits = regex_traits<charT>> class basic_regex;
@@ -22,7 +23,7 @@ static bool error_escape_thrown(const char *pat)
bool result = false;
try {
std::regex re(pat);
- } catch (std::regex_error &ex) {
+ } catch (const std::regex_error &ex) {
result = (ex.code() == std::regex_constants::error_escape);
}
return result;
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
new file mode 100644
index 000000000000..c21672f02c98
--- /dev/null
+++ b/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL: 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>
+
+static bool error_badrepeat_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_badrepeat);
+ }
+ return result;
+}
+
+int main()
+{
+ assert(error_badrepeat_thrown("?a"));
+ assert(error_badrepeat_thrown("*a"));
+ assert(error_badrepeat_thrown("+a"));
+ assert(error_badrepeat_thrown("{a"));
+
+ assert(error_badrepeat_thrown("?(a+)"));
+ assert(error_badrepeat_thrown("*(a+)"));
+ assert(error_badrepeat_thrown("+(a+)"));
+ assert(error_badrepeat_thrown("{(a+)"));
+}
diff --git a/test/std/strings/basic.string/allocator_mismatch.fail.cpp b/test/std/strings/basic.string/allocator_mismatch.fail.cpp
new file mode 100644
index 000000000000..644137ec2576
--- /dev/null
+++ b/test/std/strings/basic.string/allocator_mismatch.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+// The container's value type must be the same as the allocator's value type
+
+#include <string>
+
+int main()
+{
+ std::basic_string<char, std::char_traits<char>, std::allocator<int> > s;
+}
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 8fada8fb1eea..87998e18c581 100644
--- a/test/std/strings/basic.string/string.access/at.pass.cpp
+++ b/test/std/strings/basic.string/string.access/at.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// const_reference at(size_type pos) const;
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 bae762155527..c05346a633e9 100644
--- a/test/std/strings/basic.string/string.capacity/capacity.pass.cpp
+++ b/test/std/strings/basic.string/string.capacity/capacity.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// size_type capacity() const;
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 e4ff556d9e3f..d857be28a6c9 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: 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 bbadb9ccc5a8..9c8f67950fb4 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: 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 a155825be752..569ca760c7ce 100644
--- a/test/std/strings/basic.string/string.capacity/reserve.pass.cpp
+++ b/test/std/strings/basic.string/string.capacity/reserve.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// void reserve(size_type res_arg=0);
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 14fe209fd59a..16eca38e8012 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// void resize(size_type n);
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 f293df971f21..cb01be01f34b 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// void resize(size_type n, charT c);
diff --git a/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp b/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
index 32c9514a9154..d7bd5e06bbe9 100644
--- a/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp
@@ -11,14 +11,18 @@
// basic_string& operator=(basic_string&& c)
// noexcept(
-// allocator_type::propagate_on_container_move_assignment::value &&
-// is_nothrow_move_assignable<allocator_type>::value);
-
-// This tests a conforming extension
+// allocator_traits<allocator_type>::propagate_on_container_move_assignment::value ||
+// allocator_traits<allocator_type>::is_always_equal::value); // C++17
+//
+// before C++17, we use the conforming extension
+// noexcept(
+// allocator_type::propagate_on_container_move_assignment::value &&
+// is_nothrow_move_assignable<allocator_type>::value);
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
template <class T>
@@ -28,6 +32,32 @@ struct some_alloc
some_alloc(const some_alloc&);
};
+template <class T>
+struct some_alloc2
+{
+ typedef T value_type;
+
+ some_alloc2() {}
+ some_alloc2(const some_alloc2&);
+ void deallocate(void*, unsigned) {}
+
+ typedef std::false_type propagate_on_container_move_assignment;
+ typedef std::true_type is_always_equal;
+};
+
+template <class T>
+struct some_alloc3
+{
+ typedef T value_type;
+
+ some_alloc3() {}
+ some_alloc3(const some_alloc3&);
+ void deallocate(void*, unsigned) {}
+
+ typedef std::false_type propagate_on_container_move_assignment;
+ typedef std::false_type is_always_equal;
+};
+
int main()
{
#if __has_feature(cxx_noexcept)
@@ -41,7 +71,25 @@ int main()
}
{
typedef std::basic_string<char, std::char_traits<char>, some_alloc<char>> C;
+#if TEST_STD_VER > 14
+ // if the allocators are always equal, then the move assignment can be noexcept
+ static_assert( std::is_nothrow_move_assignable<C>::value, "");
+#else
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+#endif
+ }
+#if TEST_STD_VER > 14
+ {
+ // POCMA is false, always equal
+ typedef std::basic_string<char, std::char_traits<char>, some_alloc2<char>> C;
+ static_assert( std::is_nothrow_move_assignable<C>::value, "");
}
+ {
+ // POCMA is false, not always equal
+ typedef std::basic_string<char, std::char_traits<char>, some_alloc3<char>> C;
+ static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+ }
+#endif
+
#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 2a9bf2ac88bb..2e42be13a842 100644
--- a/test/std/strings/basic.string/string.cons/substr.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/substr.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string(const basic_string<charT,traits,Allocator>& str,
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 e8f54f475240..1d409b0932da 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
diff --git a/test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp
index d7ddb77b8e0f..99b53155d37e 100644
--- a/test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp
@@ -76,4 +76,10 @@ int main()
S("12345678901234567890"));
}
#endif
+#if __cplusplus > 201402L
+ {
+ typedef std::string S;
+ static_assert(noexcept(S().assign(S())), ""); // LWG#2063
+ }
+#endif
}
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 5f5983e76c94..db9e9a3271c6 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
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 33801352816f..69f001cf4f00 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// size_type copy(charT* s, size_type n, size_type pos = 0) const;
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 bc9ec1cf8255..11015cb973ed 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
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 734dd8dffb78..8277f88d99cd 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
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 29b00ec55b9f..4df5a14cbc0e 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
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 fd85696704cd..20e030273962 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
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 8c18941cf46a..016dcaf396fe 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
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 51c9e72fc56f..3c4c818e0396 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
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 914081bbc456..18f32bfe222a 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
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 d98704287327..fc7ee98f9e34 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
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 33f57fd3b86c..cda4112257b0 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
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 c130780dc9d1..59e4d5c28096 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
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 ef0de8975eda..f5ac2e8b6023 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
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 9ed58a3e9bbc..2fef19a24df9 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// int compare(size_type pos, size_type n1, const charT *s) const;
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 ee804d9cc6e5..cc61a2e453c4 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// int compare(size_type pos, size_type n1, const charT *s, size_type n2) const;
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 3deb617e8d84..66417482fb58 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// int compare(size_type pos1, size_type n1, const basic_string& str) const;
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 122e6e9c487a..f5c067699233 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// int compare(size_type pos1, size_type n1, const basic_string& str,
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 a73f70cd4b89..dc01f4f47747 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// basic_string substr(size_type pos = 0, size_type n = npos) const;
diff --git a/test/std/strings/c.strings/cctype.pass.cpp b/test/std/strings/c.strings/cctype.pass.cpp
index 867338fb09c2..027fbcd469d5 100644
--- a/test/std/strings/c.strings/cctype.pass.cpp
+++ b/test/std/strings/c.strings/cctype.pass.cpp
@@ -86,18 +86,18 @@ int main()
static_assert((std::is_same<decltype(std::tolower(0)), int>::value), "");
static_assert((std::is_same<decltype(std::toupper(0)), int>::value), "");
- assert(isalnum('a'));
- assert(isalpha('a'));
- assert(isblank(' '));
- assert(!iscntrl(' '));
- assert(!isdigit('a'));
- assert(isgraph('a'));
- assert(islower('a'));
- assert(isprint('a'));
- assert(!ispunct('a'));
- assert(!isspace('a'));
- assert(!isupper('a'));
- assert(isxdigit('a'));
- assert(tolower('A') == 'a');
- assert(toupper('a') == 'A');
+ assert(std::isalnum('a'));
+ assert(std::isalpha('a'));
+ assert(std::isblank(' '));
+ assert(!std::iscntrl(' '));
+ assert(!std::isdigit('a'));
+ assert(std::isgraph('a'));
+ assert(std::islower('a'));
+ assert(std::isprint('a'));
+ assert(!std::ispunct('a'));
+ assert(!std::isspace('a'));
+ assert(!std::isupper('a'));
+ assert(std::isxdigit('a'));
+ assert(std::tolower('A') == 'a');
+ assert(std::toupper('a') == 'A');
}
diff --git a/test/std/strings/c.strings/cwchar.pass.cpp b/test/std/strings/c.strings/cwchar.pass.cpp
index c3d868fbc3b7..93d2bb1efa50 100644
--- a/test/std/strings/c.strings/cwchar.pass.cpp
+++ b/test/std/strings/c.strings/cwchar.pass.cpp
@@ -30,7 +30,7 @@
int main()
{
- std::mbstate_t mb = {0};
+ std::mbstate_t mb = {};
std::size_t s = 0;
std::tm *tm = 0;
std::wint_t w = 0;
diff --git a/test/std/strings/string.conversions/stod.pass.cpp b/test/std/strings/string.conversions/stod.pass.cpp
index 026d2301e071..27d5e5cbd19b 100644
--- a/test/std/strings/string.conversions/stod.pass.cpp
+++ b/test/std/strings/string.conversions/stod.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// double stod(const string& str, size_t *idx = 0);
diff --git a/test/std/strings/string.conversions/stof.pass.cpp b/test/std/strings/string.conversions/stof.pass.cpp
index 3e9b681ddeb1..38519a2feba0 100644
--- a/test/std/strings/string.conversions/stof.pass.cpp
+++ b/test/std/strings/string.conversions/stof.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
diff --git a/test/std/strings/string.conversions/stoi.pass.cpp b/test/std/strings/string.conversions/stoi.pass.cpp
index c2fc2103579d..238072740703 100644
--- a/test/std/strings/string.conversions/stoi.pass.cpp
+++ b/test/std/strings/string.conversions/stoi.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// int stoi(const string& str, size_t *idx = 0, int base = 10);
diff --git a/test/std/strings/string.conversions/stol.pass.cpp b/test/std/strings/string.conversions/stol.pass.cpp
index dbbccc92799c..2ca2c01cfb8c 100644
--- a/test/std/strings/string.conversions/stol.pass.cpp
+++ b/test/std/strings/string.conversions/stol.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
diff --git a/test/std/strings/string.conversions/stold.pass.cpp b/test/std/strings/string.conversions/stold.pass.cpp
index 93c59fe09a11..f489df2f124d 100644
--- a/test/std/strings/string.conversions/stold.pass.cpp
+++ b/test/std/strings/string.conversions/stold.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <string>
// long double stold(const string& str, size_t *idx = 0);
diff --git a/test/std/strings/string.conversions/stoll.pass.cpp b/test/std/strings/string.conversions/stoll.pass.cpp
index f68490ed13ae..d41db4284acd 100644
--- a/test/std/strings/string.conversions/stoll.pass.cpp
+++ b/test/std/strings/string.conversions/stoll.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
diff --git a/test/std/strings/string.conversions/stoul.pass.cpp b/test/std/strings/string.conversions/stoul.pass.cpp
index 37d33c4a9091..9dbd952434a9 100644
--- a/test/std/strings/string.conversions/stoul.pass.cpp
+++ b/test/std/strings/string.conversions/stoul.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
diff --git a/test/std/strings/string.conversions/stoull.pass.cpp b/test/std/strings/string.conversions/stoull.pass.cpp
index c0667edb385e..837ca3120100 100644
--- a/test/std/strings/string.conversions/stoull.pass.cpp
+++ b/test/std/strings/string.conversions/stoull.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
diff --git a/test/std/thread/futures/futures.async/async.pass.cpp b/test/std/thread/futures/futures.async/async.pass.cpp
index c8a742566d8f..2c1313b7a2f0 100644
--- a/test/std/thread/futures/futures.async/async.pass.cpp
+++ b/test/std/thread/futures/futures.async/async.pass.cpp
@@ -7,7 +7,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.async/async_race.pass.cpp b/test/std/thread/futures/futures.async/async_race.pass.cpp
index 325a027132de..9acdd1abc485 100644
--- a/test/std/thread/futures/futures.async/async_race.pass.cpp
+++ b/test/std/thread/futures/futures.async/async_race.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.promise/alloc_ctor.pass.cpp b/test/std/thread/futures/futures.promise/alloc_ctor.pass.cpp
index 70a4e00b0d6a..c0fe2ef881e8 100644
--- a/test/std/thread/futures/futures.promise/alloc_ctor.pass.cpp
+++ b/test/std/thread/futures/futures.promise/alloc_ctor.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
@@ -19,36 +20,36 @@
#include <future>
#include <cassert>
-#include "../test_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
int main()
{
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
- std::promise<int> p(std::allocator_arg, test_allocator<int>());
- assert(test_alloc_base::count == 1);
+ std::promise<int> p(std::allocator_arg, test_allocator<int>(42));
+ assert(test_alloc_base::alloc_count == 1);
std::future<int> f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
- std::promise<int&> p(std::allocator_arg, test_allocator<int>());
- assert(test_alloc_base::count == 1);
+ std::promise<int&> p(std::allocator_arg, test_allocator<int>(42));
+ assert(test_alloc_base::alloc_count == 1);
std::future<int&> f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
- std::promise<void> p(std::allocator_arg, test_allocator<void>());
- assert(test_alloc_base::count == 1);
+ std::promise<void> p(std::allocator_arg, test_allocator<void>(42));
+ assert(test_alloc_base::alloc_count == 1);
std::future<void> f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
// Test with a minimal allocator
{
std::promise<int> p(std::allocator_arg, bare_allocator<void>());
diff --git a/test/std/thread/futures/futures.promise/copy_assign.fail.cpp b/test/std/thread/futures/futures.promise/copy_assign.fail.cpp
index c08278122225..e150ba0df65a 100644
--- a/test/std/thread/futures/futures.promise/copy_assign.fail.cpp
+++ b/test/std/thread/futures/futures.promise/copy_assign.fail.cpp
@@ -14,74 +14,36 @@
// promise& operator=(const promise& rhs) = delete;
#include <future>
-#include <cassert>
-#include "../test_allocator.h"
+#include "test_macros.h"
int main()
{
- assert(test_alloc_base::count == 0);
+#if TEST_STD_VER >= 11
{
- std::promise<int> p0(std::allocator_arg, test_allocator<int>());
- std::promise<int> p(std::allocator_arg, test_allocator<int>());
- assert(test_alloc_base::count == 2);
- p = p0;
- assert(test_alloc_base::count == 1);
- std::future<int> f = p.get_future();
- assert(test_alloc_base::count == 1);
- assert(f.valid());
- try
- {
- f = p0.get_future();
- assert(false);
- }
- catch (const std::future_error& e)
- {
- assert(e.code() == make_error_code(std::future_errc::no_state));
- }
- assert(test_alloc_base::count == 1);
+ std::promise<int> p0, p;
+ p = p0; // expected-error {{overload resolution selected deleted operator '='}}
}
- assert(test_alloc_base::count == 0);
{
- std::promise<int&> p0(std::allocator_arg, test_allocator<int>());
- std::promise<int&> p(std::allocator_arg, test_allocator<int>());
- assert(test_alloc_base::count == 2);
- p = p0;
- assert(test_alloc_base::count == 1);
- std::future<int&> f = p.get_future();
- assert(test_alloc_base::count == 1);
- assert(f.valid());
- try
- {
- f = p0.get_future();
- assert(false);
- }
- catch (const std::future_error& e)
- {
- assert(e.code() == make_error_code(std::future_errc::no_state));
- }
- assert(test_alloc_base::count == 1);
+ std::promise<int&> p0, p;
+ p = p0; // expected-error {{overload resolution selected deleted operator '='}}
}
- assert(test_alloc_base::count == 0);
{
- std::promise<void> p0(std::allocator_arg, test_allocator<void>());
- std::promise<void> p(std::allocator_arg, test_allocator<void>());
- assert(test_alloc_base::count == 2);
- p = p0;
- assert(test_alloc_base::count == 1);
- std::future<void> f = p.get_future();
- assert(test_alloc_base::count == 1);
- assert(f.valid());
- try
- {
- f = p0.get_future();
- assert(false);
- }
- catch (const std::future_error& e)
- {
- assert(e.code() == make_error_code(std::future_errc::no_state));
- }
- assert(test_alloc_base::count == 1);
+ std::promise<void> p0, p;
+ p = p0; // expected-error {{overload resolution selected deleted operator '='}}
}
- assert(test_alloc_base::count == 0);
+#else
+ {
+ std::promise<int> p0, p;
+ p = p0; // expected-error {{'operator=' is a private member of 'std::__1::promise<int>'}}
+ }
+ {
+ std::promise<int&> p0, p;
+ p = p0; // expected-error {{'operator=' is a private member of 'std::__1::promise<int &>'}}
+ }
+ {
+ std::promise<void> p0, p;
+ p = p0; // expected-error {{'operator=' is a private member of 'std::__1::promise<void>'}}
+ }
+#endif
}
diff --git a/test/std/thread/futures/futures.promise/copy_ctor.fail.cpp b/test/std/thread/futures/futures.promise/copy_ctor.fail.cpp
index 36a3555aed46..34becbc1259b 100644
--- a/test/std/thread/futures/futures.promise/copy_ctor.fail.cpp
+++ b/test/std/thread/futures/futures.promise/copy_ctor.fail.cpp
@@ -14,68 +14,36 @@
// promise(const promise&) = delete;
#include <future>
-#include <cassert>
-#include "../test_allocator.h"
+#include "test_macros.h"
int main()
{
- assert(test_alloc_base::count == 0);
+#if TEST_STD_VER >= 11
{
- std::promise<int> p0(std::allocator_arg, test_allocator<int>());
- std::promise<int> p(p0);
- assert(test_alloc_base::count == 1);
- std::future<int> f = p.get_future();
- assert(test_alloc_base::count == 1);
- assert(f.valid());
- try
- {
- f = p0.get_future();
- assert(false);
- }
- catch (const std::future_error& e)
- {
- assert(e.code() == make_error_code(std::future_errc::no_state));
- }
- assert(test_alloc_base::count == 1);
+ std::promise<int> p0;
+ std::promise<int> p(p0); // expected-error {{call to deleted constructor of 'std::promise<int>'}}
}
- assert(test_alloc_base::count == 0);
{
- std::promise<int&> p0(std::allocator_arg, test_allocator<int>());
- std::promise<int&> p(p0);
- assert(test_alloc_base::count == 1);
- std::future<int&> f = p.get_future();
- assert(test_alloc_base::count == 1);
- assert(f.valid());
- try
- {
- f = p0.get_future();
- assert(false);
- }
- catch (const std::future_error& e)
- {
- assert(e.code() == make_error_code(std::future_errc::no_state));
- }
- assert(test_alloc_base::count == 1);
+ std::promise<int &> p0;
+ std::promise<int &> p(p0); // expected-error {{call to deleted constructor of 'std::promise<int &>'}}
}
- assert(test_alloc_base::count == 0);
{
- std::promise<void> p0(std::allocator_arg, test_allocator<void>());
- std::promise<void> p(p0);
- assert(test_alloc_base::count == 1);
- std::future<void> f = p.get_future();
- assert(test_alloc_base::count == 1);
- assert(f.valid());
- try
- {
- f = p0.get_future();
- assert(false);
- }
- catch (const std::future_error& e)
- {
- assert(e.code() == make_error_code(std::future_errc::no_state));
- }
- assert(test_alloc_base::count == 1);
+ std::promise<void> p0;
+ std::promise<void> p(p0); // expected-error {{call to deleted constructor of 'std::promise<void>'}}
}
- assert(test_alloc_base::count == 0);
+#else
+ {
+ std::promise<int> p0;
+ std::promise<int> p(p0); // expected-error {{calling a private constructor of class 'std::__1::promise<int>'}}
+ }
+ {
+ std::promise<int &> p0;
+ std::promise<int &> p(p0); // expected-error {{calling a private constructor of class 'std::__1::promise<int &>'}}
+ }
+ {
+ std::promise<void> p0;
+ std::promise<void> p(p0); // expected-error {{calling a private constructor of class 'std::__1::promise<void>'}}
+ }
+#endif
}
diff --git a/test/std/thread/futures/futures.promise/default.pass.cpp b/test/std/thread/futures/futures.promise/default.pass.cpp
index 95c9657c633e..d108b42756e2 100644
--- a/test/std/thread/futures/futures.promise/default.pass.cpp
+++ b/test/std/thread/futures/futures.promise/default.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.promise/dtor.pass.cpp b/test/std/thread/futures/futures.promise/dtor.pass.cpp
index 78912f12adb9..e3151ab38322 100644
--- a/test/std/thread/futures/futures.promise/dtor.pass.cpp
+++ b/test/std/thread/futures/futures.promise/dtor.pass.cpp
@@ -7,7 +7,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
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 a7d084ee7873..bc45e28a9f96 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
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 c3097df74990..9dd8a9daef80 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
@@ -18,20 +20,19 @@
#include <future>
#include <cassert>
-#include "../test_allocator.h"
+#include "test_allocator.h"
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
std::promise<int> p0(std::allocator_arg, test_allocator<int>());
std::promise<int> p(std::allocator_arg, test_allocator<int>());
- assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::alloc_count == 2);
p = std::move(p0);
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
std::future<int> f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
try
{
@@ -42,17 +43,17 @@ int main()
{
assert(e.code() == make_error_code(std::future_errc::no_state));
}
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
std::promise<int&> p0(std::allocator_arg, test_allocator<int>());
std::promise<int&> p(std::allocator_arg, test_allocator<int>());
- assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::alloc_count == 2);
p = std::move(p0);
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
std::future<int&> f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
try
{
@@ -63,17 +64,17 @@ int main()
{
assert(e.code() == make_error_code(std::future_errc::no_state));
}
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
std::promise<void> p0(std::allocator_arg, test_allocator<void>());
std::promise<void> p(std::allocator_arg, test_allocator<void>());
- assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::alloc_count == 2);
p = std::move(p0);
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
std::future<void> f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
try
{
@@ -84,8 +85,7 @@ int main()
{
assert(e.code() == make_error_code(std::future_errc::no_state));
}
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
}
- assert(test_alloc_base::count == 0);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ 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 eeec4fb15b95..9a68b5c1b4e1 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
@@ -18,18 +20,17 @@
#include <future>
#include <cassert>
-#include "../test_allocator.h"
+#include "test_allocator.h"
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
std::promise<int> p0(std::allocator_arg, test_allocator<int>());
std::promise<int> p(std::move(p0));
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
std::future<int> f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
try
{
@@ -40,15 +41,15 @@ int main()
{
assert(e.code() == make_error_code(std::future_errc::no_state));
}
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
std::promise<int&> p0(std::allocator_arg, test_allocator<int>());
std::promise<int&> p(std::move(p0));
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
std::future<int&> f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
try
{
@@ -59,15 +60,15 @@ int main()
{
assert(e.code() == make_error_code(std::future_errc::no_state));
}
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
std::promise<void> p0(std::allocator_arg, test_allocator<void>());
std::promise<void> p(std::move(p0));
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
std::future<void> f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
try
{
@@ -78,8 +79,7 @@ int main()
{
assert(e.code() == make_error_code(std::future_errc::no_state));
}
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
}
- assert(test_alloc_base::count == 0);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ 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 51c05eb803cb..6ef41af94545 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
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 5e57692563d8..f54d7cd16bdb 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
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 cdc37775012c..98394871e703 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.promise/set_lvalue_at_thread_exit.pass.cpp b/test/std/thread/futures/futures.promise/set_lvalue_at_thread_exit.pass.cpp
index 18f87c596a00..e127d2c37faf 100644
--- a/test/std/thread/futures/futures.promise/set_lvalue_at_thread_exit.pass.cpp
+++ b/test/std/thread/futures/futures.promise/set_lvalue_at_thread_exit.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.promise/set_rvalue.pass.cpp b/test/std/thread/futures/futures.promise/set_rvalue.pass.cpp
index dab4bf7e9c83..9cce3f59550a 100644
--- a/test/std/thread/futures/futures.promise/set_rvalue.pass.cpp
+++ b/test/std/thread/futures/futures.promise/set_rvalue.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <future>
diff --git a/test/std/thread/futures/futures.promise/set_value_at_thread_exit_const.pass.cpp b/test/std/thread/futures/futures.promise/set_value_at_thread_exit_const.pass.cpp
index ec50cc310298..79137488e606 100644
--- a/test/std/thread/futures/futures.promise/set_value_at_thread_exit_const.pass.cpp
+++ b/test/std/thread/futures/futures.promise/set_value_at_thread_exit_const.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.promise/set_value_at_thread_exit_void.pass.cpp b/test/std/thread/futures/futures.promise/set_value_at_thread_exit_void.pass.cpp
index 8c092084668d..6a0ce36326eb 100644
--- a/test/std/thread/futures/futures.promise/set_value_at_thread_exit_void.pass.cpp
+++ b/test/std/thread/futures/futures.promise/set_value_at_thread_exit_void.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
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 6673f6307579..db7465ceab85 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
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 5012e0bfe5fd..87be8cd60a5e 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.promise/swap.pass.cpp b/test/std/thread/futures/futures.promise/swap.pass.cpp
index 1ed3e646813c..21c946981a28 100644
--- a/test/std/thread/futures/futures.promise/swap.pass.cpp
+++ b/test/std/thread/futures/futures.promise/swap.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
@@ -20,65 +21,65 @@
#include <future>
#include <cassert>
-#include "../test_allocator.h"
+#include "test_allocator.h"
int main()
{
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
std::promise<int> p0(std::allocator_arg, test_allocator<int>());
std::promise<int> p(std::allocator_arg, test_allocator<int>());
- assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::alloc_count == 2);
p.swap(p0);
- assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::alloc_count == 2);
std::future<int> f = p.get_future();
- assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::alloc_count == 2);
assert(f.valid());
f = p0.get_future();
assert(f.valid());
- assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::alloc_count == 2);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
std::promise<int> p0(std::allocator_arg, test_allocator<int>());
std::promise<int> p(std::allocator_arg, test_allocator<int>());
- assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::alloc_count == 2);
swap(p, p0);
- assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::alloc_count == 2);
std::future<int> f = p.get_future();
- assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::alloc_count == 2);
assert(f.valid());
f = p0.get_future();
assert(f.valid());
- assert(test_alloc_base::count == 2);
+ assert(test_alloc_base::alloc_count == 2);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
std::promise<int> p0(std::allocator_arg, test_allocator<int>());
std::promise<int> p;
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
p.swap(p0);
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
std::future<int> f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
f = p0.get_future();
assert(f.valid());
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
std::promise<int> p0(std::allocator_arg, test_allocator<int>());
std::promise<int> p;
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
swap(p, p0);
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
std::future<int> f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
f = p0.get_future();
assert(f.valid());
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
}
diff --git a/test/std/thread/futures/futures.promise/uses_allocator.pass.cpp b/test/std/thread/futures/futures.promise/uses_allocator.pass.cpp
index 458826e956e1..9a1d41cc0cb6 100644
--- a/test/std/thread/futures/futures.promise/uses_allocator.pass.cpp
+++ b/test/std/thread/futures/futures.promise/uses_allocator.pass.cpp
@@ -18,7 +18,7 @@
// : true_type { };
#include <future>
-#include "../test_allocator.h"
+#include "test_allocator.h"
int main()
{
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 b23ba196ec30..3f9e945dddaf 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
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
@@ -20,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef int T;
std::promise<T> p;
@@ -72,5 +72,4 @@ int main()
assert(!f0.valid());
assert(!f.valid());
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
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 425d1f9be96f..1da08808db2e 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
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.shared_future/ctor_future.pass.cpp b/test/std/thread/futures/futures.shared_future/ctor_future.pass.cpp
index 3a78b80f0634..1590efd7b634 100644
--- a/test/std/thread/futures/futures.shared_future/ctor_future.pass.cpp
+++ b/test/std/thread/futures/futures.shared_future/ctor_future.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.shared_future/dtor.pass.cpp b/test/std/thread/futures/futures.shared_future/dtor.pass.cpp
index baa89cb12b1c..af061268410d 100644
--- a/test/std/thread/futures/futures.shared_future/dtor.pass.cpp
+++ b/test/std/thread/futures/futures.shared_future/dtor.pass.cpp
@@ -7,7 +7,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
@@ -18,51 +20,51 @@
#include <future>
#include <cassert>
-#include "../test_allocator.h"
+#include "test_allocator.h"
int main()
{
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
typedef int T;
std::shared_future<T> f;
{
std::promise<T> p(std::allocator_arg, test_allocator<T>());
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
typedef int& T;
std::shared_future<T> f;
{
std::promise<T> p(std::allocator_arg, test_allocator<int>());
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
typedef void T;
std::shared_future<T> f;
{
std::promise<T> p(std::allocator_arg, test_allocator<T>());
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
}
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 c5ee234b127f..6eea1d889b6d 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.shared_future/move_assign.pass.cpp b/test/std/thread/futures/futures.shared_future/move_assign.pass.cpp
index 6b58f41c9085..3a1ef7a6849c 100644
--- a/test/std/thread/futures/futures.shared_future/move_assign.pass.cpp
+++ b/test/std/thread/futures/futures.shared_future/move_assign.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
@@ -20,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef int T;
std::promise<T> p;
@@ -72,5 +72,4 @@ int main()
assert(!f0.valid());
assert(!f.valid());
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/thread/futures/futures.shared_future/move_ctor.pass.cpp b/test/std/thread/futures/futures.shared_future/move_ctor.pass.cpp
index 32b8fd77c672..15323d678e3c 100644
--- a/test/std/thread/futures/futures.shared_future/move_ctor.pass.cpp
+++ b/test/std/thread/futures/futures.shared_future/move_ctor.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.shared_future/wait.pass.cpp b/test/std/thread/futures/futures.shared_future/wait.pass.cpp
index 4293fcab3564..6ff74f6c6b90 100644
--- a/test/std/thread/futures/futures.shared_future/wait.pass.cpp
+++ b/test/std/thread/futures/futures.shared_future/wait.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.shared_future/wait_for.pass.cpp b/test/std/thread/futures/futures.shared_future/wait_for.pass.cpp
index e5a4754e38ad..1ec086266b0d 100644
--- a/test/std/thread/futures/futures.shared_future/wait_for.pass.cpp
+++ b/test/std/thread/futures/futures.shared_future/wait_for.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.shared_future/wait_until.pass.cpp b/test/std/thread/futures/futures.shared_future/wait_until.pass.cpp
index 6a6aeba7759e..9cdc2e431f45 100644
--- a/test/std/thread/futures/futures.shared_future/wait_until.pass.cpp
+++ b/test/std/thread/futures/futures.shared_future/wait_until.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+ // UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp b/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp
index 70ea0ad31fed..6c6418594d00 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <future>
// class packaged_task<R(ArgTypes...)>
@@ -14,35 +16,11 @@
// packaged_task& operator=(packaged_task&) = delete;
#include <future>
-#include <cassert>
-
-class A
-{
- long data_;
-
-public:
- explicit A(long i) : data_(i) {}
-
- long operator()(long i, long j) const {return data_ + i + j;}
-};
int main()
{
{
- std::packaged_task<double(int, char)> p0(A(5));
- std::packaged_task<double(int, char)> p;
- p = p0;
- assert(!p0.valid());
- assert(p.valid());
- std::future<double> f = p.get_future();
- p(3, 'a');
- assert(f.get() == 105.0);
- }
- {
- std::packaged_task<double(int, char)> p0;
- std::packaged_task<double(int, char)> p;
- p = p0;
- assert(!p0.valid());
- assert(!p.valid());
+ std::packaged_task<double(int, char)> p0, p;
+ p = p0; // expected-error {{overload resolution selected deleted operator '='}}
}
}
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp
index 18786f4eb7a2..3f11d670bede 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp b/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp
index 45048b747f7a..7097d428962a 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <future>
// class packaged_task<R(ArgTypes...)>
@@ -25,5 +27,6 @@ typedef volatile std::packaged_task<A(int, char)> VPT;
int main()
{
- PT p { VPT{} };
+ 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'}}
}
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp b/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp
index e4df4ec225e7..feb7657bed37 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <future>
// class packaged_task<R(ArgTypes...)>
@@ -18,7 +20,7 @@
#include <future>
#include <cassert>
-#include "../../test_allocator.h"
+#include "test_allocator.h"
struct A {};
typedef std::packaged_task<A(int, char)> PT;
@@ -26,5 +28,6 @@ typedef volatile std::packaged_task<A(int, char)> VPT;
int main()
{
- PT p { std::allocator_arg_t{}, test_allocator<A>{}, VPT {}};
+ PT p { std::allocator_arg_t{}, test_allocator<A>{}, 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'}}
}
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp b/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp
index 9884c49a6dc7..97624f90f3df 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <future>
// class packaged_task<R(ArgTypes...)>
@@ -14,33 +16,12 @@
// packaged_task(packaged_task&) = delete;
#include <future>
-#include <cassert>
-
-class A
-{
- long data_;
-public:
- explicit A(long i) : data_(i) {}
-
- long operator()(long i, long j) const {return data_ + i + j;}
-};
int main()
{
{
- std::packaged_task<double(int, char)> p0(A(5));
- std::packaged_task<double(int, char)> p(p0);
- assert(!p0.valid());
- assert(p.valid());
- std::future<double> f = p.get_future();
- p(3, 'a');
- assert(f.get() == 105.0);
- }
- {
std::packaged_task<double(int, char)> p0;
- std::packaged_task<double(int, char)> p(p0);
- assert(!p0.valid());
- assert(!p.valid());
+ std::packaged_task<double(int, char)> p(p0); // expected-error {{call to deleted constructor of 'std::packaged_task<double (int, char)>'}}
}
}
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp
index 76904962a778..ed147d74895b 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp
index 2eee2cbc2d50..14ac7614bb8e 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp
index 3aac2b26bfc1..39784876b8c3 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
@@ -19,7 +20,7 @@
#include <future>
#include <cassert>
-#include "../../test_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
class A
@@ -47,7 +48,7 @@ int main()
{
std::packaged_task<double(int, char)> p(std::allocator_arg,
test_allocator<A>(), A(5));
- assert(test_alloc_base::count > 0);
+ assert(test_alloc_base::alloc_count > 0);
assert(p.valid());
std::future<double> f = p.get_future();
p(3, 'a');
@@ -55,14 +56,14 @@ int main()
assert(A::n_copies == 0);
assert(A::n_moves > 0);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
A::n_copies = 0;
A::n_moves = 0;
{
A a(5);
std::packaged_task<double(int, char)> p(std::allocator_arg,
test_allocator<A>(), a);
- assert(test_alloc_base::count > 0);
+ assert(test_alloc_base::alloc_count > 0);
assert(p.valid());
std::future<double> f = p.get_future();
p(3, 'a');
@@ -70,31 +71,31 @@ int main()
assert(A::n_copies > 0);
assert(A::n_moves > 0);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
A::n_copies = 0;
A::n_moves = 0;
{
A a(5);
std::packaged_task<int(int)> p(std::allocator_arg, test_allocator<A>(), &func);
- assert(test_alloc_base::count > 0);
+ assert(test_alloc_base::alloc_count > 0);
assert(p.valid());
std::future<int> f = p.get_future();
p(4);
assert(f.get() == 4);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
A::n_copies = 0;
A::n_moves = 0;
{
A a(5);
std::packaged_task<int(int)> p(std::allocator_arg, test_allocator<A>(), func);
- assert(test_alloc_base::count > 0);
+ assert(test_alloc_base::alloc_count > 0);
assert(p.valid());
std::future<int> f = p.get_future();
p(4);
assert(f.get() == 4);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
A::n_copies = 0;
A::n_moves = 0;
{
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp
index 88f072281750..d9951dca585a 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp
index e24232d1b227..7fafd1005649 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp
@@ -7,7 +7,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp
index 13b5db110668..c8e5d6efd6b4 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp
@@ -7,7 +7,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp
index 61a6a4f87965..54ac64458248 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp
@@ -7,7 +7,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp
index 2a09353b1e63..9ad1509517f6 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp
@@ -7,7 +7,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp
index 9d38d9b409c0..02a567500ee2 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp
@@ -7,7 +7,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp
index 33763bef0d0f..eb0091c8e817 100644
--- a/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp
index 668732b9b24a..d90d593a75bd 100644
--- a/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp b/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp
index 986f71e29a46..bbe75de7f8a9 100644
--- a/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp
+++ b/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp
@@ -9,6 +9,12 @@
//
// UNSUPPORTED: libcpp-has-no-threads
+// This test is marked XFAIL and not UNSUPPORTED because the non-variadic
+// declaration of packaged_task is available in C++03. Therefore the test
+// should fail because the static_assert fires and not because std::packaged_task
+// in undefined.
+// XFAIL: c++98, c++03
+
// <future>
// class packaged_task<R(ArgTypes...)>
@@ -18,7 +24,7 @@
// : true_type { };
#include <future>
-#include "../../test_allocator.h"
+#include "test_allocator.h"
int main()
{
diff --git a/test/std/thread/futures/futures.tas/types.pass.cpp b/test/std/thread/futures/futures.tas/types.pass.cpp
index dd1724ddbda5..f7c9b223add1 100644
--- a/test/std/thread/futures/futures.tas/types.pass.cpp
+++ b/test/std/thread/futures/futures.tas/types.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.unique_future/copy_assign.fail.cpp b/test/std/thread/futures/futures.unique_future/copy_assign.fail.cpp
index ebdcbf98d996..781c9c9d6199 100644
--- a/test/std/thread/futures/futures.unique_future/copy_assign.fail.cpp
+++ b/test/std/thread/futures/futures.unique_future/copy_assign.fail.cpp
@@ -14,61 +14,36 @@
// future& operator=(const future&) = delete;
#include <future>
-#include <cassert>
+
+#include "test_macros.h"
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
- typedef int T;
- std::promise<T> p;
- std::future<T> f0 = p.get_future();
- std::future<T> f;
- f = f0;
- assert(!f0.valid());
- assert(f.valid());
+ std::future<int> f0, f;
+ f = f0; // expected-error {{overload resolution selected deleted operator '='}}
}
{
- typedef int T;
- std::future<T> f0;
- std::future<T> f;
- f = f0;
- assert(!f0.valid());
- assert(!f.valid());
+ std::future<int &> f0, f;
+ f = f0; // expected-error {{overload resolution selected deleted operator '='}}
}
{
- typedef int& T;
- std::promise<T> p;
- std::future<T> f0 = p.get_future();
- std::future<T> f;
- f = f0;
- assert(!f0.valid());
- assert(f.valid());
+ std::future<void> f0, f;
+ f = f0; // expected-error {{overload resolution selected deleted operator '='}}
}
+#else
{
- typedef int& T;
- std::future<T> f0;
- std::future<T> f;
- f = f0;
- assert(!f0.valid());
- assert(!f.valid());
+ std::future<int> f0, f;
+ f = f0; // expected-error {{'operator=' is a private member of 'std::__1::future<int>'}}
}
{
- typedef void T;
- std::promise<T> p;
- std::future<T> f0 = p.get_future();
- std::future<T> f;
- f = f0;
- assert(!f0.valid());
- assert(f.valid());
+ std::future<int &> f0, f;
+ f = f0; // expected-error {{'operator=' is a private member of 'std::__1::future<int &>'}}
}
{
- typedef void T;
- std::future<T> f0;
- std::future<T> f;
- f = f0;
- assert(!f0.valid());
- assert(!f.valid());
+ std::future<void> f0, f;
+ f = f0; // expected-error {{'operator=' is a private member of 'std::__1::future<void>'}}
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/test/std/thread/futures/futures.unique_future/copy_ctor.fail.cpp b/test/std/thread/futures/futures.unique_future/copy_ctor.fail.cpp
index 8d43294edc26..0d7b5f5074d3 100644
--- a/test/std/thread/futures/futures.unique_future/copy_ctor.fail.cpp
+++ b/test/std/thread/futures/futures.unique_future/copy_ctor.fail.cpp
@@ -14,53 +14,36 @@
// future(const future&) = delete;
#include <future>
-#include <cassert>
+
+#include "test_macros.h"
int main()
{
+#if TEST_STD_VER >= 11
{
- typedef int T;
- std::promise<T> p;
- std::future<T> f0 = p.get_future();
- std::future<T> f = f0;
- assert(!f0.valid());
- assert(f.valid());
+ std::future<int> f0;
+ std::future<int> f = f0; // expected-error {{call to deleted constructor of 'std::future<int>'}}
}
{
- typedef int T;
- std::future<T> f0;
- std::future<T> f = f0;
- assert(!f0.valid());
- assert(!f.valid());
+ std::future<int &> f0;
+ std::future<int &> f = f0; // expected-error {{call to deleted constructor of 'std::future<int &>'}}
}
{
- typedef int& T;
- std::promise<T> p;
- std::future<T> f0 = p.get_future();
- std::future<T> f = f0;
- assert(!f0.valid());
- assert(f.valid());
+ std::future<void> f0;
+ std::future<void> f = f0; // expected-error {{call to deleted constructor of 'std::future<void>'}}
}
+#else
{
- typedef int& T;
- std::future<T> f0;
- std::future<T> f = std::move(f0);
- assert(!f0.valid());
- assert(!f.valid());
+ std::future<int> f0;
+ std::future<int> f = f0; // expected-error {{calling a private constructor of class 'std::__1::future<int>'}}
}
{
- typedef void T;
- std::promise<T> p;
- std::future<T> f0 = p.get_future();
- std::future<T> f = f0;
- assert(!f0.valid());
- assert(f.valid());
+ std::future<int &> f0;
+ std::future<int &> f = f0; // expected-error {{calling a private constructor of class 'std::__1::future<int &>'}}
}
{
- typedef void T;
- std::future<T> f0;
- std::future<T> f = f0;
- assert(!f0.valid());
- assert(!f.valid());
+ std::future<void> f0;
+ std::future<void> f = f0; // expected-error {{calling a private constructor of class 'std::__1::future<void>'}}
}
+#endif
}
diff --git a/test/std/thread/futures/futures.unique_future/dtor.pass.cpp b/test/std/thread/futures/futures.unique_future/dtor.pass.cpp
index 5e9697bb939b..03d7c915cb61 100644
--- a/test/std/thread/futures/futures.unique_future/dtor.pass.cpp
+++ b/test/std/thread/futures/futures.unique_future/dtor.pass.cpp
@@ -7,7 +7,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
@@ -18,51 +20,51 @@
#include <future>
#include <cassert>
-#include "../test_allocator.h"
+#include "test_allocator.h"
int main()
{
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
typedef int T;
std::future<T> f;
{
std::promise<T> p(std::allocator_arg, test_allocator<T>());
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
typedef int& T;
std::future<T> f;
{
std::promise<T> p(std::allocator_arg, test_allocator<int>());
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
{
typedef void T;
std::future<T> f;
{
std::promise<T> p(std::allocator_arg, test_allocator<T>());
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
f = p.get_future();
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 1);
+ assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
}
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 758e38a7dae9..67b1052c175d 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.unique_future/share.pass.cpp b/test/std/thread/futures/futures.unique_future/share.pass.cpp
index 794b5ce38feb..ef011d8df752 100644
--- a/test/std/thread/futures/futures.unique_future/share.pass.cpp
+++ b/test/std/thread/futures/futures.unique_future/share.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.unique_future/wait.pass.cpp b/test/std/thread/futures/futures.unique_future/wait.pass.cpp
index e10d37cf8064..f6de983f3057 100644
--- a/test/std/thread/futures/futures.unique_future/wait.pass.cpp
+++ b/test/std/thread/futures/futures.unique_future/wait.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.unique_future/wait_for.pass.cpp b/test/std/thread/futures/futures.unique_future/wait_for.pass.cpp
index 0a381d9ca2f0..c4f358268432 100644
--- a/test/std/thread/futures/futures.unique_future/wait_for.pass.cpp
+++ b/test/std/thread/futures/futures.unique_future/wait_for.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
diff --git a/test/std/thread/futures/futures.unique_future/wait_until.pass.cpp b/test/std/thread/futures/futures.unique_future/wait_until.pass.cpp
index d5865b9b9dcf..541c00860752 100644
--- a/test/std/thread/futures/futures.unique_future/wait_until.pass.cpp
+++ b/test/std/thread/futures/futures.unique_future/wait_until.pass.cpp
@@ -1,129 +1,130 @@
- //===----------------------------------------------------------------------===//
- //
- // The 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
-
- // <future>
-
- // class future<R>
-
- // template <class Clock, class Duration>
- // future_status
- // wait_until(const chrono::time_point<Clock, Duration>& abs_time) const;
-
- #include <future>
- #include <atomic>
- #include <cassert>
-
- enum class WorkerThreadState { Uninitialized, AllowedToRun, Exiting };
- typedef std::chrono::milliseconds ms;
-
- std::atomic<WorkerThreadState> thread_state(WorkerThreadState::Uninitialized);
-
- void set_worker_thread_state(WorkerThreadState state)
- {
- thread_state.store(state, std::memory_order_relaxed);
- }
-
- void wait_for_worker_thread_state(WorkerThreadState state)
- {
- while (thread_state.load(std::memory_order_relaxed) != state);
- }
-
- void func1(std::promise<int> p)
- {
- wait_for_worker_thread_state(WorkerThreadState::AllowedToRun);
- p.set_value(3);
- set_worker_thread_state(WorkerThreadState::Exiting);
- }
-
- int j = 0;
-
- void func3(std::promise<int&> p)
- {
- wait_for_worker_thread_state(WorkerThreadState::AllowedToRun);
- j = 5;
- p.set_value(j);
- set_worker_thread_state(WorkerThreadState::Exiting);
- }
-
- void func5(std::promise<void> p)
- {
- wait_for_worker_thread_state(WorkerThreadState::AllowedToRun);
- p.set_value();
- set_worker_thread_state(WorkerThreadState::Exiting);
- }
-
- int main()
- {
- typedef std::chrono::high_resolution_clock Clock;
- {
- typedef int T;
- std::promise<T> p;
- std::future<T> f = p.get_future();
- std::thread(func1, std::move(p)).detach();
- assert(f.valid());
- assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::timeout);
- assert(f.valid());
-
- // allow the worker thread to produce the result and wait until the worker is done
- set_worker_thread_state(WorkerThreadState::AllowedToRun);
- wait_for_worker_thread_state(WorkerThreadState::Exiting);
-
- assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::ready);
- assert(f.valid());
- Clock::time_point t0 = Clock::now();
- f.wait();
- Clock::time_point t1 = Clock::now();
- assert(f.valid());
- assert(t1-t0 < ms(5));
- }
- {
- typedef int& T;
- std::promise<T> p;
- std::future<T> f = p.get_future();
- std::thread(func3, std::move(p)).detach();
- assert(f.valid());
- assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::timeout);
- assert(f.valid());
-
- // allow the worker thread to produce the result and wait until the worker is done
- set_worker_thread_state(WorkerThreadState::AllowedToRun);
- wait_for_worker_thread_state(WorkerThreadState::Exiting);
-
- assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::ready);
- assert(f.valid());
- Clock::time_point t0 = Clock::now();
- f.wait();
- Clock::time_point t1 = Clock::now();
- assert(f.valid());
- assert(t1-t0 < ms(5));
- }
- {
- typedef void T;
- std::promise<T> p;
- std::future<T> f = p.get_future();
- std::thread(func5, std::move(p)).detach();
- assert(f.valid());
- assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::timeout);
- assert(f.valid());
-
- // allow the worker thread to produce the result and wait until the worker is done
- set_worker_thread_state(WorkerThreadState::AllowedToRun);
- wait_for_worker_thread_state(WorkerThreadState::Exiting);
-
- assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::ready);
- assert(f.valid());
- Clock::time_point t0 = Clock::now();
- f.wait();
- Clock::time_point t1 = Clock::now();
- assert(f.valid());
- assert(t1-t0 < ms(5));
- }
- }
+//===----------------------------------------------------------------------===//
+//
+// The 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
+// UNSUPPORTED: c++98, c++03
+
+// <future>
+
+// class future<R>
+
+// template <class Clock, class Duration>
+// future_status
+// wait_until(const chrono::time_point<Clock, Duration>& abs_time) const;
+
+#include <future>
+#include <atomic>
+#include <cassert>
+
+enum class WorkerThreadState { Uninitialized, AllowedToRun, Exiting };
+typedef std::chrono::milliseconds ms;
+
+std::atomic<WorkerThreadState> thread_state(WorkerThreadState::Uninitialized);
+
+void set_worker_thread_state(WorkerThreadState state)
+{
+ thread_state.store(state, std::memory_order_relaxed);
+}
+
+void wait_for_worker_thread_state(WorkerThreadState state)
+{
+ while (thread_state.load(std::memory_order_relaxed) != state);
+}
+
+void func1(std::promise<int> p)
+{
+ wait_for_worker_thread_state(WorkerThreadState::AllowedToRun);
+ p.set_value(3);
+ set_worker_thread_state(WorkerThreadState::Exiting);
+}
+
+int j = 0;
+
+void func3(std::promise<int&> p)
+{
+ wait_for_worker_thread_state(WorkerThreadState::AllowedToRun);
+ j = 5;
+ p.set_value(j);
+ set_worker_thread_state(WorkerThreadState::Exiting);
+}
+
+void func5(std::promise<void> p)
+{
+ wait_for_worker_thread_state(WorkerThreadState::AllowedToRun);
+ p.set_value();
+ set_worker_thread_state(WorkerThreadState::Exiting);
+}
+
+int main()
+{
+ typedef std::chrono::high_resolution_clock Clock;
+ {
+ typedef int T;
+ std::promise<T> p;
+ std::future<T> f = p.get_future();
+ std::thread(func1, std::move(p)).detach();
+ assert(f.valid());
+ assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::timeout);
+ assert(f.valid());
+
+ // allow the worker thread to produce the result and wait until the worker is done
+ set_worker_thread_state(WorkerThreadState::AllowedToRun);
+ wait_for_worker_thread_state(WorkerThreadState::Exiting);
+
+ assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::ready);
+ assert(f.valid());
+ Clock::time_point t0 = Clock::now();
+ f.wait();
+ Clock::time_point t1 = Clock::now();
+ assert(f.valid());
+ assert(t1-t0 < ms(5));
+ }
+ {
+ typedef int& T;
+ std::promise<T> p;
+ std::future<T> f = p.get_future();
+ std::thread(func3, std::move(p)).detach();
+ assert(f.valid());
+ assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::timeout);
+ assert(f.valid());
+
+ // allow the worker thread to produce the result and wait until the worker is done
+ set_worker_thread_state(WorkerThreadState::AllowedToRun);
+ wait_for_worker_thread_state(WorkerThreadState::Exiting);
+
+ assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::ready);
+ assert(f.valid());
+ Clock::time_point t0 = Clock::now();
+ f.wait();
+ Clock::time_point t1 = Clock::now();
+ assert(f.valid());
+ assert(t1-t0 < ms(5));
+ }
+ {
+ typedef void T;
+ std::promise<T> p;
+ std::future<T> f = p.get_future();
+ std::thread(func5, std::move(p)).detach();
+ assert(f.valid());
+ assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::timeout);
+ assert(f.valid());
+
+ // allow the worker thread to produce the result and wait until the worker is done
+ set_worker_thread_state(WorkerThreadState::AllowedToRun);
+ wait_for_worker_thread_state(WorkerThreadState::Exiting);
+
+ assert(f.wait_until(Clock::now() + ms(10)) == std::future_status::ready);
+ assert(f.valid());
+ Clock::time_point t0 = Clock::now();
+ f.wait();
+ Clock::time_point t1 = Clock::now();
+ assert(f.valid());
+ assert(t1-t0 < ms(5));
+ }
+}
diff --git a/test/std/thread/futures/test_allocator.h b/test/std/thread/futures/test_allocator.h
deleted file mode 100644
index 50072909fa4e..000000000000
--- a/test/std/thread/futures/test_allocator.h
+++ /dev/null
@@ -1,158 +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 TEST_ALLOCATOR_H
-#define TEST_ALLOCATOR_H
-
-#include <cstddef>
-#include <type_traits>
-#include <utility>
-#include <cstdlib>
-#include <new>
-#include <climits>
-
-class test_alloc_base
-{
-public:
- static int count;
-public:
- static int throw_after;
-};
-
-int test_alloc_base::count = 0;
-int test_alloc_base::throw_after = INT_MAX;
-
-template <class T>
-class test_allocator
- : public test_alloc_base
-{
- int data_;
-
- template <class U> friend class test_allocator;
-public:
-
- typedef unsigned size_type;
- typedef int difference_type;
- typedef T value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef typename std::add_lvalue_reference<value_type>::type reference;
- typedef typename std::add_lvalue_reference<const value_type>::type const_reference;
-
- template <class U> struct rebind {typedef test_allocator<U> other;};
-
- test_allocator() throw() : data_(-1) {}
- 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_ = 0;}
- pointer address(reference x) const {return &x;}
- const_pointer address(const_reference x) const {return &x;}
- pointer allocate(size_type n, const void* = 0)
- {
- if (count >= throw_after) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw std::bad_alloc();
-#else
- std::terminate();
-#endif
- }
- ++count;
- return (pointer)std::malloc(n * sizeof(T));
- }
- void deallocate(pointer p, size_type n)
- {--count; std::free(p);}
- size_type max_size() const throw()
- {return UINT_MAX / sizeof(T);}
- void construct(pointer p, const T& val)
- {::new(p) T(val);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- void construct(pointer p, T&& val)
- {::new(p) T(std::move(val));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- void destroy(pointer p) {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);}
-};
-
-template <>
-class test_allocator<void>
- : public test_alloc_base
-{
- int data_;
-
- template <class U> friend class test_allocator;
-public:
-
- typedef unsigned size_type;
- typedef int difference_type;
- typedef void value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
-
- template <class U> struct rebind {typedef test_allocator<U> other;};
-
- test_allocator() throw() : data_(-1) {}
- 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_ = 0;}
-
- 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);}
-};
-
-template <class T>
-class other_allocator
-{
- int data_;
-
- template <class U> friend class other_allocator;
-
-public:
- typedef T value_type;
-
- other_allocator() : data_(-1) {}
- explicit other_allocator(int i) : data_(i) {}
- template <class U> other_allocator(const other_allocator<U>& a)
- : data_(a.data_) {}
- T* allocate(std::size_t n)
- {return (T*)std::malloc(n * sizeof(T));}
- void deallocate(T* p, std::size_t n)
- {std::free(p);}
-
- other_allocator select_on_container_copy_construction() const
- {return other_allocator(-2);}
-
- friend bool operator==(const other_allocator& x, const other_allocator& y)
- {return x.data_ == y.data_;}
- friend bool operator!=(const other_allocator& x, const other_allocator& y)
- {return !(x == y);}
-
- typedef std::true_type propagate_on_container_copy_assignment;
- typedef std::true_type propagate_on_container_move_assignment;
- typedef std::true_type propagate_on_container_swap;
-
-#ifdef _LIBCPP_HAS_NO_ADVANCED_SFINAE
- std::size_t max_size() const
- {return UINT_MAX / sizeof(T);}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-
-};
-
-#endif // TEST_ALLOCATOR_H
diff --git a/test/std/thread/thread.condition/notify_all_at_thread_exit.pass.cpp b/test/std/thread/thread.condition/notify_all_at_thread_exit.pass.cpp
index 2b8772f92ed2..02da345cb7d1 100644
--- a/test/std/thread/thread.condition/notify_all_at_thread_exit.pass.cpp
+++ b/test/std/thread/thread.condition/notify_all_at_thread_exit.pass.cpp
@@ -9,6 +9,10 @@
//
// 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
@@ -36,9 +40,10 @@ void func()
int main()
{
std::unique_lock<std::mutex> lk(mut);
- std::thread(func).detach();
+ std::thread t(func);
Clock::time_point t0 = Clock::now();
cv.wait(lk);
Clock::time_point t1 = Clock::now();
assert(t1-t0 > ms(250));
+ t.join();
}
diff --git a/test/std/thread/thread.condition/thread.condition.condvar/notify_one.pass.cpp b/test/std/thread/thread.condition/thread.condition.condvar/notify_one.pass.cpp
index 6236a13df80e..e99ebee9c8e0 100644
--- a/test/std/thread/thread.condition/thread.condition.condvar/notify_one.pass.cpp
+++ b/test/std/thread/thread.condition/thread.condition.condvar/notify_one.pass.cpp
@@ -16,16 +16,17 @@
// void notify_one();
#include <condition_variable>
+#include <atomic>
#include <mutex>
#include <thread>
#include <cassert>
+
std::condition_variable cv;
std::mutex mut;
-int test0 = 0;
-int test1 = 0;
-int test2 = 0;
+std::atomic_int test1(0);
+std::atomic_int test2(0);
void f1()
{
@@ -64,11 +65,13 @@ int main()
}
if (test1 == 2)
{
+ assert(test2 == 1);
t1.join();
test1 = 0;
}
else if (test2 == 2)
{
+ assert(test1 == 1);
t2.join();
test2 = 0;
}
@@ -81,11 +84,13 @@ int main()
}
if (test1 == 2)
{
+ assert(test2 == 0);
t1.join();
test1 = 0;
}
else if (test2 == 2)
{
+ assert(test1 == 0);
t2.join();
test2 = 0;
}
diff --git a/test/std/thread/thread.condition/thread.condition.condvarany/wait.exception.pass.cpp b/test/std/thread/thread.condition/thread.condition.condvarany/wait.exception.pass.cpp
deleted file mode 100644
index 522c61b02d17..000000000000
--- a/test/std/thread/thread.condition/thread.condition.condvarany/wait.exception.pass.cpp
+++ /dev/null
@@ -1,63 +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: libcpp-has-no-threads
-
-#include <thread>
-#include <condition_variable>
-#include <mutex>
-#include <chrono>
-#include <iostream>
-#include <cassert>
-
-void f1()
-{
- std::exit(0);
-}
-
-struct Mutex
-{
- unsigned state = 0;
- Mutex() = default;
- ~Mutex() = default;
- Mutex(const Mutex&) = delete;
- Mutex& operator=(const Mutex&) = delete;
-
- void lock()
- {
- if (++state == 2)
- throw 1; // this throw should end up calling terminate()
- }
-
- void unlock() {}
-};
-
-Mutex mut;
-std::condition_variable_any cv;
-
-void
-signal_me()
-{
- std::this_thread::sleep_for(std::chrono::milliseconds(500));
- cv.notify_one();
-}
-
-int
-main()
-{
- std::set_terminate(f1);
- try
- {
- std::thread(signal_me).detach();
- mut.lock();
- cv.wait(mut);
- }
- catch (...) {}
- assert(false);
-}
diff --git a/test/std/thread/thread.condition/thread.condition.condvarany/wait_for.exception.pass.cpp b/test/std/thread/thread.condition/thread.condition.condvarany/wait_for.exception.pass.cpp
deleted file mode 100644
index 1906b5892506..000000000000
--- a/test/std/thread/thread.condition/thread.condition.condvarany/wait_for.exception.pass.cpp
+++ /dev/null
@@ -1,63 +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: libcpp-has-no-threads
-
-#include <thread>
-#include <condition_variable>
-#include <mutex>
-#include <chrono>
-#include <iostream>
-#include <cassert>
-
-void f1()
-{
- std::exit(0);
-}
-
-struct Mutex
-{
- unsigned state = 0;
- Mutex() = default;
- ~Mutex() = default;
- Mutex(const Mutex&) = delete;
- Mutex& operator=(const Mutex&) = delete;
-
- void lock()
- {
- if (++state == 2)
- throw 1; // this throw should end up calling terminate()
- }
-
- void unlock() {}
-};
-
-Mutex mut;
-std::condition_variable_any cv;
-
-void
-signal_me()
-{
- std::this_thread::sleep_for(std::chrono::milliseconds(500));
- cv.notify_one();
-}
-
-int
-main()
-{
- std::set_terminate(f1);
- try
- {
- std::thread(signal_me).detach();
- mut.lock();
- cv.wait_for(mut, std::chrono::milliseconds(250));
- }
- catch (...) {}
- assert(false);
-}
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
new file mode 100644
index 000000000000..f9a35cc905c7
--- /dev/null
+++ b/test/std/thread/thread.condition/thread.condition.condvarany/wait_terminates.sh.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.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-has-no-threads
+
+// <condition_variable>
+
+// class condition_variable_any;
+
+// RUN: %build
+// RUN: %run 1
+// RUN: %run 2
+// RUN: %run 3
+// RUN: %run 4
+// RUN: %run 5
+// RUN: %run 6
+
+// -----------------------------------------------------------------------------
+// Overview
+// Check that std::terminate is called if wait(...) fails to meet it's post
+// conditions. This can happens when reacquiring the mutex throws
+// an exception.
+//
+// The following methods are tested within this file
+// 1. void wait(Lock& lock);
+// 2. void wait(Lock& lock, Pred);
+// 3. void wait_for(Lock& lock, Duration);
+// 4. void wait_for(Lock& lock, Duration, Pred);
+// 5. void wait_until(Lock& lock, TimePoint);
+// 6. void wait_until(Lock& lock, TimePoint, Pred);
+//
+// Plan
+// 1 Create a mutex type, 'ThrowingMutex', that throws when the lock is aquired
+// for the *second* time.
+//
+// 2 Replace the terminate handler with one that exits with a '0' exit code.
+//
+// 3 Create a 'condition_variable_any' object 'cv' and a 'ThrowingMutex'
+// object 'm' and lock 'm'.
+//
+// 4 Start a thread 'T2' that will notify 'cv' once 'm' has been unlocked.
+//
+// 5 From the main thread call the specified wait method on 'cv' with 'm'.
+// When 'T2' notifies 'cv' and the wait method attempts to re-lock
+// 'm' an exception will be thrown from 'm.lock()'.
+//
+// 6 Check that control flow does not return from the wait method and that
+// terminate is called (If the program exits with a 0 exit code we know
+// that terminate has been called)
+
+
+#include <condition_variable>
+#include <atomic>
+#include <thread>
+#include <chrono>
+#include <string>
+#include <cstdlib>
+#include <cassert>
+
+void my_terminate() {
+ std::_Exit(0); // Use _Exit to prevent cleanup from taking place.
+}
+
+// The predicate used in the cv.wait calls.
+bool pred = false;
+bool pred_function() {
+ return pred == true;
+}
+
+class ThrowingMutex
+{
+ std::atomic_bool locked;
+ unsigned state = 0;
+ ThrowingMutex(const ThrowingMutex&) = delete;
+ ThrowingMutex& operator=(const ThrowingMutex&) = delete;
+public:
+ ThrowingMutex() {
+ locked = false;
+ }
+ ~ThrowingMutex() = default;
+
+ void lock() {
+ locked = true;
+ if (++state == 2) {
+ assert(pred); // Check that we actually waited until we were signaled.
+ throw 1; // this throw should end up calling terminate()
+ }
+ }
+
+ void unlock() { locked = false; }
+ bool isLocked() const { return locked == true; }
+};
+
+ThrowingMutex mut;
+std::condition_variable_any cv;
+
+void signal_me() {
+ while (mut.isLocked()) {} // wait until T1 releases mut inside the cv.wait call.
+ pred = true;
+ cv.notify_one();
+}
+
+typedef std::chrono::system_clock Clock;
+typedef std::chrono::milliseconds MS;
+
+int main(int argc, char** argv) {
+ assert(argc == 2);
+ int id = std::stoi(argv[1]);
+ assert(id >= 1 && id <= 6);
+ std::set_terminate(my_terminate); // set terminate after std::stoi because it can throw.
+ MS wait(250);
+ try {
+ mut.lock();
+ assert(pred == false);
+ std::thread(signal_me).detach();
+ switch (id) {
+ case 1: cv.wait(mut); break;
+ case 2: cv.wait(mut, pred_function); break;
+ case 3: cv.wait_for(mut, wait); break;
+ case 4: cv.wait_for(mut, wait, pred_function); break;
+ case 5: cv.wait_until(mut, Clock::now() + wait); break;
+ case 6: cv.wait_until(mut, Clock::now() + wait, pred_function); break;
+ default: assert(false);
+ }
+ } catch (...) {}
+ assert(false);
+}
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 f67ca2169825..eac7600b5d11 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
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 f0c54b71883f..8889408be2d7 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp
index 2c1c665fdeda..f7cf49c81f3f 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -20,9 +21,7 @@
int main()
{
-#if _LIBCPP_STD_VER > 11
std::shared_lock<std::shared_timed_mutex> ul;
assert(!ul.owns_lock());
assert(ul.mutex() == nullptr);
-#endif // _LIBCPP_STD_VER > 11
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp
index 8676f2ca0472..15c193c60b5d 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -18,16 +19,11 @@
#include <shared_mutex>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
std::shared_timed_mutex m0;
std::shared_timed_mutex m1;
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
std::shared_lock<std::shared_timed_mutex> lk0(m0);
std::shared_lock<std::shared_timed_mutex> lk1(m1);
lk1 = std::move(lk0);
@@ -35,5 +31,4 @@ int main()
assert(lk1.owns_lock() == true);
assert(lk0.mutex() == nullptr);
assert(lk0.owns_lock() == false);
-#endif // _LIBCPP_STD_VER > 11
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp
index f59d2e826980..4f4f6a5e9fbd 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -18,18 +19,13 @@
#include <shared_mutex>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-std::shared_timed_mutex m;
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
+ std::shared_timed_mutex m;
std::shared_lock<std::shared_timed_mutex> lk0(m);
std::shared_lock<std::shared_timed_mutex> lk = std::move(lk0);
assert(lk.mutex() == &m);
assert(lk.owns_lock() == true);
assert(lk0.mutex() == nullptr);
assert(lk0.owns_lock() == false);
-#endif // _LIBCPP_STD_VER > 11
}
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 c8a0287314bf..12bef34cf87b 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
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -21,9 +22,7 @@
#include <cstdlib>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
-std::shared_timed_mutex m;
+#include "test_macros.h"
typedef std::chrono::system_clock Clock;
typedef Clock::time_point time_point;
@@ -31,6 +30,19 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+ms WaitTime = ms(250);
+
+// Thread sanitizer causes more overhead and will sometimes cause this test
+// to fail. To prevent this we give Thread sanitizer more time to complete the
+// test.
+#if !defined(TEST_HAS_SANITIZERS)
+ms Tolerance = ms(50);
+#else
+ms Tolerance = ms(50 * 5);
+#endif
+
+std::shared_timed_mutex m;
+
void f()
{
time_point t0 = Clock::now();
@@ -39,8 +51,8 @@ void f()
std::shared_lock<std::shared_timed_mutex> ul(m);
t1 = Clock::now();
}
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within tolerance
}
void g()
@@ -52,30 +64,30 @@ void g()
t1 = Clock::now();
}
ns d = t1 - t0;
- assert(d < ms(50)); // within 50ms
+ assert(d < Tolerance); // within tolerance
}
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
- m.lock();
std::vector<std::thread> v;
- for (int i = 0; i < 5; ++i)
- v.push_back(std::thread(f));
- std::this_thread::sleep_for(ms(250));
- m.unlock();
- for (auto& t : v)
- t.join();
- m.lock_shared();
- for (auto& t : v)
- t = std::thread(g);
- std::thread q(f);
- std::this_thread::sleep_for(ms(250));
- m.unlock_shared();
- for (auto& t : v)
- t.join();
- q.join();
-#endif // _LIBCPP_STD_VER > 11
+ {
+ m.lock();
+ for (int i = 0; i < 5; ++i)
+ v.push_back(std::thread(f));
+ std::this_thread::sleep_for(WaitTime);
+ m.unlock();
+ for (auto& t : v)
+ t.join();
+ }
+ {
+ m.lock_shared();
+ for (auto& t : v)
+ t = std::thread(g);
+ std::thread q(f);
+ std::this_thread::sleep_for(WaitTime);
+ m.unlock_shared();
+ for (auto& t : v)
+ t.join();
+ q.join();
+ }
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
index 3b49b3029052..995210221065 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -20,11 +21,9 @@
int main()
{
-#if _LIBCPP_STD_VER > 11
std::shared_timed_mutex m;
m.lock_shared();
std::shared_lock<std::shared_timed_mutex> lk(m, std::adopt_lock);
assert(lk.mutex() == &m);
assert(lk.owns_lock() == true);
-#endif // _LIBCPP_STD_VER > 11
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
index bbc38fcadb10..d81796b95bf3 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -20,10 +21,8 @@
int main()
{
-#if _LIBCPP_STD_VER > 11
std::shared_timed_mutex m;
std::shared_lock<std::shared_timed_mutex> lk(m, std::defer_lock);
assert(lk.mutex() == &m);
assert(lk.owns_lock() == false);
-#endif // _LIBCPP_STD_VER > 11
}
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 9816e57f692a..84f868d6810b 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
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -22,7 +23,7 @@
#include <cstdlib>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
+#include "test_macros.h"
std::shared_timed_mutex m;
@@ -32,37 +33,46 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+ms WaitTime = ms(250);
+
+// Thread sanitizer causes more overhead and will sometimes cause this test
+// to fail. To prevent this we give Thread sanitizer more time to complete the
+// test.
+#if !defined(TEST_HAS_SANITIZERS)
+ms Tolerance = ms(50);
+#else
+ms Tolerance = ms(50 * 5);
+#endif
+
+
void f1()
{
time_point t0 = Clock::now();
- std::shared_lock<std::shared_timed_mutex> lk(m, ms(300));
+ std::shared_lock<std::shared_timed_mutex> lk(m, WaitTime + Tolerance);
assert(lk.owns_lock() == true);
time_point t1 = Clock::now();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within 50ms
}
void f2()
{
time_point t0 = Clock::now();
- std::shared_lock<std::shared_timed_mutex> lk(m, ms(250));
+ std::shared_lock<std::shared_timed_mutex> lk(m, WaitTime);
assert(lk.owns_lock() == false);
time_point t1 = Clock::now();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within 50ms
}
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
{
m.lock();
std::vector<std::thread> v;
for (int i = 0; i < 5; ++i)
v.push_back(std::thread(f1));
- std::this_thread::sleep_for(ms(250));
+ std::this_thread::sleep_for(WaitTime);
m.unlock();
for (auto& t : v)
t.join();
@@ -72,10 +82,9 @@ int main()
std::vector<std::thread> v;
for (int i = 0; i < 5; ++i)
v.push_back(std::thread(f2));
- std::this_thread::sleep_for(ms(300));
+ std::this_thread::sleep_for(WaitTime + Tolerance);
m.unlock();
for (auto& t : v)
t.join();
}
-#endif // _LIBCPP_STD_VER > 11
}
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 5d188ab06737..9359731486dd 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
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -22,7 +23,7 @@
#include <cstdlib>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
+#include "test_macros.h"
std::shared_timed_mutex m;
@@ -32,37 +33,45 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+ms WaitTime = ms(250);
+
+// Thread sanitizer causes more overhead and will sometimes cause this test
+// to fail. To prevent this we give Thread sanitizer more time to complete the
+// test.
+#if !defined(TEST_HAS_SANITIZERS)
+ms Tolerance = ms(50);
+#else
+ms Tolerance = ms(50 * 5);
+#endif
+
void f1()
{
time_point t0 = Clock::now();
- std::shared_lock<std::shared_timed_mutex> lk(m, Clock::now() + ms(300));
+ std::shared_lock<std::shared_timed_mutex> lk(m, Clock::now() + WaitTime + Tolerance);
assert(lk.owns_lock() == true);
time_point t1 = Clock::now();
- ns d = t1 - t0 - ms(250);
- assert(d < ns(50000000)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within 50ms
}
void f2()
{
time_point t0 = Clock::now();
- std::shared_lock<std::shared_timed_mutex> lk(m, Clock::now() + ms(250));
+ std::shared_lock<std::shared_timed_mutex> lk(m, Clock::now() + WaitTime);
assert(lk.owns_lock() == false);
time_point t1 = Clock::now();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within 50ms
}
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
{
m.lock();
std::vector<std::thread> v;
for (int i = 0; i < 5; ++i)
v.push_back(std::thread(f1));
- std::this_thread::sleep_for(ms(250));
+ std::this_thread::sleep_for(WaitTime);
m.unlock();
for (auto& t : v)
t.join();
@@ -72,10 +81,9 @@ int main()
std::vector<std::thread> v;
for (int i = 0; i < 5; ++i)
v.push_back(std::thread(f2));
- std::this_thread::sleep_for(ms(300));
+ std::this_thread::sleep_for(WaitTime + Tolerance);
m.unlock();
for (auto& t : v)
t.join();
}
-#endif // _LIBCPP_STD_VER > 11
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp
index f2d4e0deb73f..7f89f0af801f 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -21,8 +22,6 @@
#include <cstdlib>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
std::shared_timed_mutex m;
typedef std::chrono::system_clock Clock;
@@ -57,11 +56,8 @@ void f()
assert(d < ms(200)); // within 200ms
}
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
m.lock();
std::vector<std::thread> v;
for (int i = 0; i < 5; ++i)
@@ -70,5 +66,4 @@ int main()
m.unlock();
for (auto& t : v)
t.join();
-#endif // _LIBCPP_STD_VER > 11
}
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 f1500652badd..5c3513c98e03 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -21,7 +23,7 @@
#include <cstdlib>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
+#include "test_macros.h"
std::shared_timed_mutex m;
@@ -31,6 +33,18 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+ms WaitTime = ms(250);
+
+// Thread sanitizer causes more overhead and will sometimes cause this test
+// to fail. To prevent this we give Thread sanitizer more time to complete the
+// test.
+#if !defined(TEST_HAS_SANITIZERS)
+ms Tolerance = ms(25);
+#else
+ms Tolerance = ms(25 * 5);
+#endif
+
+
void f()
{
std::shared_lock<std::shared_timed_mutex> lk(m, std::defer_lock);
@@ -38,8 +52,8 @@ void f()
lk.lock();
time_point t1 = Clock::now();
assert(lk.owns_lock() == true);
- ns d = t1 - t0 - ms(250);
- assert(d < ms(25)); // within 25ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within tolerance
try
{
lk.lock();
@@ -62,18 +76,14 @@ void f()
}
}
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
m.lock();
std::vector<std::thread> v;
for (int i = 0; i < 5; ++i)
v.push_back(std::thread(f));
- std::this_thread::sleep_for(ms(250));
+ std::this_thread::sleep_for(WaitTime);
m.unlock();
for (auto& t : v)
t.join();
-#endif // _LIBCPP_STD_VER > 11
}
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 82b1ff865053..01693c77ea39 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -18,8 +20,6 @@
#include <shared_mutex>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
bool try_lock_called = false;
struct mutex
@@ -34,11 +34,9 @@ struct mutex
mutex m;
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
+
std::shared_lock<mutex> lk(m, std::defer_lock);
assert(lk.try_lock() == true);
assert(try_lock_called == true);
@@ -66,5 +64,4 @@ int main()
{
assert(e.code().value() == EPERM);
}
-#endif // _LIBCPP_STD_VER > 11
}
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 5867465a6626..852a94eb65ec 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -19,8 +21,6 @@
#include <shared_mutex>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
bool try_lock_for_called = false;
typedef std::chrono::milliseconds ms;
@@ -39,11 +39,8 @@ struct mutex
mutex m;
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
std::shared_lock<mutex> lk(m, std::defer_lock);
assert(lk.try_lock_for(ms(5)) == true);
assert(try_lock_for_called == true);
@@ -71,5 +68,4 @@ int main()
{
assert(e.code().value() == EPERM);
}
-#endif // _LIBCPP_STD_VER > 11
}
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 9d38983be724..31574afd7d8f 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -19,8 +21,6 @@
#include <shared_mutex>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
bool try_lock_until_called = false;
struct mutex
@@ -38,11 +38,8 @@ struct mutex
mutex m;
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
typedef std::chrono::steady_clock Clock;
std::shared_lock<mutex> lk(m, std::defer_lock);
assert(lk.try_lock_until(Clock::now()) == true);
@@ -71,5 +68,4 @@ int main()
{
assert(e.code().value() == EPERM);
}
-#endif // _LIBCPP_STD_VER > 11
}
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 eb08a45cde6e..6a7385ed42a6 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,9 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -18,8 +20,6 @@
#include <shared_mutex>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
bool unlock_called = false;
struct mutex
@@ -30,11 +30,8 @@ struct mutex
mutex m;
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
std::shared_lock<mutex> lk(m);
lk.unlock();
assert(unlock_called == true);
@@ -58,5 +55,4 @@ int main()
{
assert(e.code().value() == EPERM);
}
-#endif // _LIBCPP_STD_VER > 11
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/member_swap.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/member_swap.pass.cpp
index 8505763e44bc..23a0c7030d76 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/member_swap.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/member_swap.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -18,8 +19,6 @@
#include <shared_mutex>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
struct mutex
{
void lock_shared() {}
@@ -28,11 +27,8 @@ struct mutex
mutex m;
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
std::shared_lock<mutex> lk1(m);
std::shared_lock<mutex> lk2;
lk1.swap(lk2);
@@ -41,5 +37,4 @@ int main()
assert(lk2.mutex() == &m);
assert(lk2.owns_lock() == true);
static_assert(noexcept(lk1.swap(lk2)), "member swap must be noexcept");
-#endif // _LIBCPP_STD_VER > 11
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/nonmember_swap.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/nonmember_swap.pass.cpp
index 057dbc4cd3b7..0f19174d51f0 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/nonmember_swap.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/nonmember_swap.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -19,8 +20,6 @@
#include <shared_mutex>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
struct mutex
{
void lock_shared() {}
@@ -29,11 +28,8 @@ struct mutex
mutex m;
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
std::shared_lock<mutex> lk1(m);
std::shared_lock<mutex> lk2;
swap(lk1, lk2);
@@ -42,5 +38,4 @@ int main()
assert(lk2.mutex() == &m);
assert(lk2.owns_lock() == true);
static_assert(noexcept(swap(lk1, lk2)), "non-member swap must be noexcept");
-#endif // _LIBCPP_STD_VER > 11
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/release.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/release.pass.cpp
index 65ddca624725..2b5f8c1f1658 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/release.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/release.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -18,8 +19,6 @@
#include <shared_mutex>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
struct mutex
{
static int lock_count;
@@ -33,11 +32,8 @@ int mutex::unlock_count = 0;
mutex m;
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
std::shared_lock<mutex> lk(m);
assert(lk.mutex() == &m);
assert(lk.owns_lock() == true);
@@ -49,5 +45,4 @@ int main()
assert(mutex::lock_count == 1);
assert(mutex::unlock_count == 0);
static_assert(noexcept(lk.release()), "release must be noexcept");
-#endif // _LIBCPP_STD_VER > 11
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp
index 4eb75d8f050e..711ab7c6fca0 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -18,15 +19,10 @@
#include <shared_mutex>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
std::shared_timed_mutex m;
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
std::shared_lock<std::shared_timed_mutex> lk0;
assert(lk0.mutex() == nullptr);
std::shared_lock<std::shared_timed_mutex> lk1(m);
@@ -34,5 +30,4 @@ int main()
lk1.unlock();
assert(lk1.mutex() == &m);
static_assert(noexcept(lk0.mutex()), "mutex() must be noexcept");
-#endif // _LIBCPP_STD_VER > 11
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp
index d079d2d8b03a..3f6ad2b555a3 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -18,15 +19,10 @@
#include <shared_mutex>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
std::shared_timed_mutex m;
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
std::shared_lock<std::shared_timed_mutex> lk0;
assert(static_cast<bool>(lk0) == false);
std::shared_lock<std::shared_timed_mutex> lk1(m);
@@ -34,5 +30,4 @@ int main()
lk1.unlock();
assert(static_cast<bool>(lk1) == false);
static_assert(noexcept(static_cast<bool>(lk0)), "explicit operator bool() must be noexcept");
-#endif // _LIBCPP_STD_VER > 11
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp
index d64b0aa6a736..5ab3ac009fe1 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
@@ -18,15 +19,10 @@
#include <shared_mutex>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
std::shared_timed_mutex m;
-#endif // _LIBCPP_STD_VER > 11
-
int main()
{
-#if _LIBCPP_STD_VER > 11
std::shared_lock<std::shared_timed_mutex> lk0;
assert(lk0.owns_lock() == false);
std::shared_lock<std::shared_timed_mutex> lk1(m);
@@ -34,5 +30,4 @@ int main()
lk1.unlock();
assert(lk1.owns_lock() == false);
static_assert(noexcept(lk0.owns_lock()), "owns_lock must be noexcept");
-#endif // _LIBCPP_STD_VER > 11
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/types.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/types.pass.cpp
index c153b455f404..f555d3de5ee0 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/types.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/types.pass.cpp
@@ -8,6 +8,8 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
+
// <shared_mutex>
@@ -24,8 +26,6 @@
int main()
{
-#if _LIBCPP_STD_VER > 11
static_assert((std::is_same<std::shared_lock<std::mutex>::mutex_type,
std::mutex>::value), "");
-#endif // _LIBCPP_STD_VER > 11
}
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 f5408df98199..6ce33761068f 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
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 bd88577f0a22..27d0562de31f 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
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 558f079463a4..6f0a7219d2d8 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
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 24e4d109a097..b7e87249b596 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
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 bbabfc41df11..62497c9ec45a 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/assign.fail.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/assign.fail.cpp
index 7bcb2d61379a..5c67a34ab52b 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/assign.fail.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/assign.fail.cpp
@@ -6,6 +6,8 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
// <shared_mutex>
@@ -15,15 +17,9 @@
#include <shared_mutex>
-#include "test_macros.h"
-
int main()
{
-#if TEST_STD_VER > 14
std::shared_mutex m0;
std::shared_mutex m1;
- m1 = m0;
-#else
-# error
-#endif
+ m1 = m0; // expected-error {{overload resolution selected deleted operator '='}}
}
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/copy.fail.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/copy.fail.cpp
index af064aeee26c..c7cac6041c82 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/copy.fail.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/copy.fail.cpp
@@ -6,6 +6,8 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
// <shared_mutex>
@@ -15,14 +17,8 @@
#include <shared_mutex>
-#include "test_macros.h"
-
int main()
{
-#if TEST_STD_VER > 14
std::shared_mutex m0;
- std::shared_mutex m1(m0);
-#else
-# error
-#endif
+ std::shared_mutex m1(m0); // expected-error {{call to deleted constructor of 'std::shared_mutex'}}
}
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 9bf7a79e3400..75ddebff0ed9 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
@@ -21,6 +21,7 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
std::shared_mutex m;
@@ -30,21 +31,32 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+ms WaitTime = ms(250);
+
+// Thread sanitizer causes more overhead and will sometimes cause this test
+// to fail. To prevent this we give Thread sanitizer more time to complete the
+// test.
+#if !defined(TEST_HAS_SANITIZERS)
+ms Tolerance = ms(50);
+#else
+ms Tolerance = ms(50 * 5);
+#endif
+
void f()
{
time_point t0 = Clock::now();
m.lock();
time_point t1 = Clock::now();
m.unlock();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within tolerance
}
int main()
{
m.lock();
std::thread t(f);
- std::this_thread::sleep_for(ms(250));
+ std::this_thread::sleep_for(WaitTime);
m.unlock();
t.join();
}
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 3ffa9e2d0065..6b5089d38859 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
@@ -22,6 +22,8 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
std::shared_mutex m;
typedef std::chrono::system_clock Clock;
@@ -30,14 +32,25 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+ms WaitTime = ms(250);
+
+// Thread sanitizer causes more overhead and will sometimes cause this test
+// to fail. To prevent this we give Thread sanitizer more time to complete the
+// test.
+#if !defined(TEST_HAS_SANITIZERS)
+ms Tolerance = ms(50);
+#else
+ms Tolerance = ms(50 * 5);
+#endif
+
void f()
{
time_point t0 = Clock::now();
m.lock_shared();
time_point t1 = Clock::now();
m.unlock_shared();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within tolerance
}
void g()
@@ -47,7 +60,7 @@ void g()
time_point t1 = Clock::now();
m.unlock_shared();
ns d = t1 - t0;
- assert(d < ms(50)); // within 50ms
+ assert(d < Tolerance); // within tolerance
}
@@ -57,7 +70,7 @@ int main()
std::vector<std::thread> v;
for (int i = 0; i < 5; ++i)
v.push_back(std::thread(f));
- std::this_thread::sleep_for(ms(250));
+ std::this_thread::sleep_for(WaitTime);
m.unlock();
for (auto& t : v)
t.join();
@@ -65,7 +78,7 @@ int main()
for (auto& t : v)
t = std::thread(g);
std::thread q(f);
- std::this_thread::sleep_for(ms(250));
+ std::this_thread::sleep_for(WaitTime);
m.unlock_shared();
for (auto& t : v)
t.join();
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 62bb736837ea..2818bd617542 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
@@ -21,6 +21,8 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
std::shared_timed_mutex m;
typedef std::chrono::system_clock Clock;
@@ -29,6 +31,19 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+
+ms WaitTime = ms(250);
+
+// Thread sanitizer causes more overhead and will sometimes cause this test
+// to fail. To prevent this we give Thread sanitizer more time to complete the
+// test.
+#if !TEST_HAS_FEATURE(thread_sanitizer)
+ms Tolerance = ms(50);
+#else
+ms Tolerance = ms(100);
+#endif
+
+
void f()
{
time_point t0 = Clock::now();
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 8fc6299f1b8f..77a9107de923 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
@@ -22,6 +22,8 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
std::shared_timed_mutex m;
typedef std::chrono::system_clock Clock;
@@ -30,14 +32,27 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+
+ms WaitTime = ms(250);
+
+// Thread sanitizer causes more overhead and will sometimes cause this test
+// to fail. To prevent this we give Thread sanitizer more time to complete the
+// test.
+#if !defined(TEST_HAS_SANITIZERS)
+ms Tolerance = ms(50);
+#else
+ms Tolerance = ms(50 * 5);
+#endif
+
+
void f()
{
time_point t0 = Clock::now();
m.lock_shared();
time_point t1 = Clock::now();
m.unlock_shared();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within tolerance
}
void g()
@@ -47,7 +62,7 @@ void g()
time_point t1 = Clock::now();
m.unlock_shared();
ns d = t1 - t0;
- assert(d < ms(50)); // within 50ms
+ assert(d < Tolerance); // within tolerance
}
@@ -57,7 +72,7 @@ int main()
std::vector<std::thread> v;
for (int i = 0; i < 5; ++i)
v.push_back(std::thread(f));
- std::this_thread::sleep_for(ms(250));
+ std::this_thread::sleep_for(WaitTime);
m.unlock();
for (auto& t : v)
t.join();
@@ -65,7 +80,7 @@ int main()
for (auto& t : v)
t = std::thread(g);
std::thread q(f);
- std::this_thread::sleep_for(ms(250));
+ std::this_thread::sleep_for(WaitTime);
m.unlock_shared();
for (auto& t : v)
t.join();
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 ab20241895ba..320a268ae77d 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
@@ -22,6 +22,8 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
std::shared_timed_mutex m;
typedef std::chrono::steady_clock Clock;
@@ -30,23 +32,35 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+
+ms WaitTime = ms(250);
+
+// Thread sanitizer causes more overhead and will sometimes cause this test
+// to fail. To prevent this we give Thread sanitizer more time to complete the
+// test.
+#if !defined(TEST_HAS_SANITIZERS)
+ms Tolerance = ms(50);
+#else
+ms Tolerance = ms(50 * 5);
+#endif
+
void f1()
{
time_point t0 = Clock::now();
- assert(m.try_lock_for(ms(300)) == true);
+ assert(m.try_lock_for(WaitTime + Tolerance) == true);
time_point t1 = Clock::now();
m.unlock();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within tolerance
}
void f2()
{
time_point t0 = Clock::now();
- assert(m.try_lock_for(ms(250)) == false);
+ assert(m.try_lock_for(WaitTime) == false);
time_point t1 = Clock::now();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within tolerance
}
int main()
@@ -54,14 +68,14 @@ int main()
{
m.lock();
std::thread t(f1);
- std::this_thread::sleep_for(ms(250));
+ std::this_thread::sleep_for(WaitTime);
m.unlock();
t.join();
}
{
m.lock();
std::thread t(f2);
- std::this_thread::sleep_for(ms(300));
+ std::this_thread::sleep_for(WaitTime + Tolerance);
m.unlock();
t.join();
}
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 9c2d8c9c8e5c..3d5604d886cb 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
@@ -22,6 +22,8 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
std::shared_timed_mutex m;
typedef std::chrono::system_clock Clock;
@@ -30,6 +32,13 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+
+#if !defined(TEST_HAS_SANITIZERS)
+ms Tolerance = ms(200);
+#else
+ms Tolerance = ms(200 * 5);
+#endif
+
void f()
{
time_point t0 = Clock::now();
@@ -41,7 +50,7 @@ void f()
time_point t1 = Clock::now();
m.unlock_shared();
ns d = t1 - t0 - ms(250);
- assert(d < ms(200)); // within 200ms
+ assert(d < Tolerance); // within tolerance
}
int main()
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 35444112a5da..4cdb5873f9a1 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
@@ -23,6 +23,8 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
std::shared_timed_mutex m;
typedef std::chrono::steady_clock Clock;
@@ -31,23 +33,34 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+ms WaitTime = ms(250);
+
+// Thread sanitizer causes more overhead and will sometimes cause this test
+// to fail. To prevent this we give Thread sanitizer more time to complete the
+// test.
+#if !defined(TEST_HAS_SANITIZERS)
+ms Tolerance = ms(50);
+#else
+ms Tolerance = ms(50 * 5);
+#endif
+
void f1()
{
time_point t0 = Clock::now();
- assert(m.try_lock_shared_for(ms(300)) == true);
+ assert(m.try_lock_shared_for(WaitTime + Tolerance) == true);
time_point t1 = Clock::now();
m.unlock_shared();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within 50ms
}
void f2()
{
time_point t0 = Clock::now();
- assert(m.try_lock_shared_for(ms(250)) == false);
+ assert(m.try_lock_shared_for(WaitTime) == false);
time_point t1 = Clock::now();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within 50ms
}
int main()
@@ -57,7 +70,7 @@ int main()
std::vector<std::thread> v;
for (int i = 0; i < 5; ++i)
v.push_back(std::thread(f1));
- std::this_thread::sleep_for(ms(250));
+ std::this_thread::sleep_for(WaitTime);
m.unlock();
for (auto& t : v)
t.join();
@@ -67,7 +80,7 @@ int main()
std::vector<std::thread> v;
for (int i = 0; i < 5; ++i)
v.push_back(std::thread(f2));
- std::this_thread::sleep_for(ms(300));
+ std::this_thread::sleep_for(WaitTime + Tolerance);
m.unlock();
for (auto& t : v)
t.join();
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 4e0f19de07ce..f7ddbaeef498 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
@@ -23,6 +23,8 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
std::shared_timed_mutex m;
typedef std::chrono::steady_clock Clock;
@@ -31,23 +33,34 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+ms WaitTime = ms(250);
+
+// Thread sanitizer causes more overhead and will sometimes cause this test
+// to fail. To prevent this we give Thread sanitizer more time to complete the
+// test.
+#if !defined(TEST_HAS_SANITIZERS)
+ms Tolerance = ms(50);
+#else
+ms Tolerance = ms(50 * 5);
+#endif
+
void f1()
{
time_point t0 = Clock::now();
- assert(m.try_lock_shared_until(Clock::now() + ms(300)) == true);
+ assert(m.try_lock_shared_until(Clock::now() + WaitTime + Tolerance) == true);
time_point t1 = Clock::now();
m.unlock_shared();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within 50ms
}
void f2()
{
time_point t0 = Clock::now();
- assert(m.try_lock_shared_until(Clock::now() + ms(250)) == false);
+ assert(m.try_lock_shared_until(Clock::now() + WaitTime) == false);
time_point t1 = Clock::now();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within tolerance
}
int main()
@@ -57,7 +70,7 @@ int main()
std::vector<std::thread> v;
for (int i = 0; i < 5; ++i)
v.push_back(std::thread(f1));
- std::this_thread::sleep_for(ms(250));
+ std::this_thread::sleep_for(WaitTime);
m.unlock();
for (auto& t : v)
t.join();
@@ -67,7 +80,7 @@ int main()
std::vector<std::thread> v;
for (int i = 0; i < 5; ++i)
v.push_back(std::thread(f2));
- std::this_thread::sleep_for(ms(300));
+ std::this_thread::sleep_for(WaitTime + Tolerance);
m.unlock();
for (auto& t : v)
t.join();
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 aa90cf71502f..1560af2c9ecc 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
@@ -32,23 +32,35 @@ typedef Clock::duration duration;
typedef std::chrono::milliseconds ms;
typedef std::chrono::nanoseconds ns;
+
+ms WaitTime = ms(250);
+
+// Thread sanitizer causes more overhead and will sometimes cause this test
+// to fail. To prevent this we give Thread sanitizer more time to complete the
+// test.
+#if !defined(TEST_HAS_SANITIZERS)
+ms Tolerance = ms(50);
+#else
+ms Tolerance = ms(50 * 5);
+#endif
+
void f1()
{
time_point t0 = Clock::now();
- assert(m.try_lock_until(Clock::now() + ms(300)) == true);
+ assert(m.try_lock_until(Clock::now() + WaitTime + Tolerance) == true);
time_point t1 = Clock::now();
m.unlock();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within tolerance
}
void f2()
{
time_point t0 = Clock::now();
- assert(m.try_lock_until(Clock::now() + ms(250)) == false);
+ assert(m.try_lock_until(Clock::now() + WaitTime) == false);
time_point t1 = Clock::now();
- ns d = t1 - t0 - ms(250);
- assert(d < ms(50)); // within 50ms
+ ns d = t1 - t0 - WaitTime;
+ assert(d < Tolerance); // within tolerance
}
int main()
@@ -56,14 +68,14 @@ int main()
{
m.lock();
std::thread t(f1);
- std::this_thread::sleep_for(ms(250));
+ std::this_thread::sleep_for(WaitTime);
m.unlock();
t.join();
}
{
m.lock();
std::thread t(f2);
- std::this_thread::sleep_for(ms(300));
+ std::this_thread::sleep_for(WaitTime + Tolerance);
m.unlock();
t.join();
}
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 89b99348459b..afc318cc3d7a 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
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 7198d226960a..6c31df593c0e 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
@@ -8,13 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
-
-// NOTE: std::terminate is called so the destructors are not invoked and the
-// memory is not freed. This will cause ASAN to fail.
-// XFAIL: asan
-
-// NOTE: TSAN will report this test as leaking a thread.
-// XFAIL: tsan
+// UNSUPPORTED: c++98, c++03
// <thread>
@@ -38,12 +32,7 @@ public:
G(const G& g) : alive_(g.alive_) {++n_alive;}
~G() {alive_ = 0; --n_alive;}
- void operator()()
- {
- assert(alive_ == 1);
- assert(n_alive >= 1);
- op_run = true;
- }
+
void operator()(int i, double j)
{
@@ -60,7 +49,7 @@ bool G::op_run = false;
void f1()
{
- std::exit(0);
+ std::_Exit(0);
}
int main()
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 a8b4be16e631..3de15af8929b 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
+// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <thread>
@@ -22,6 +23,8 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
unsigned throw_one = 0xFFFF;
void* operator new(std::size_t s) throw(std::bad_alloc)
@@ -75,7 +78,7 @@ public:
int G::n_alive = 0;
bool G::op_run = false;
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#if TEST_STD_VER >= 11
class MoveOnly
{
@@ -137,7 +140,7 @@ int main()
assert(!G::op_run);
}
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#if TEST_STD_VER >= 11
{
assert(G::n_alive == 0);
assert(!G::op_run);
@@ -150,5 +153,5 @@ int main()
std::thread t = std::thread(MoveOnly(), MoveOnly());
t.join();
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif
}
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp
index ddf96d095730..0efb7713e985 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp
@@ -9,8 +9,6 @@
//
// UNSUPPORTED: libcpp-has-no-threads
-// NOTE: TSAN will report this test as leaking a thread.
-// XFAIL: tsan
// <thread>
@@ -47,7 +45,7 @@ bool G::op_run = false;
void f1()
{
- std::exit(0);
+ std::_Exit(0);
}
int main()
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp
index f4a4d1f777f1..726395d99044 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp
@@ -19,7 +19,7 @@
#include <atomic>
#include <cassert>
-std::atomic_bool done = ATOMIC_VAR_INIT(false);
+std::atomic_bool done(false);
class G
{
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
new file mode 100644
index 000000000000..72f0e867b1d2
--- /dev/null
+++ b/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/copy_assign.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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class OuterAlloc, class... InnerAllocs>
+// class scoped_allocator_adaptor
+
+// scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor& other);
+
+
+#include <scoped_allocator>
+#include <cassert>
+
+#include "allocators.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a1(A1<int>(3));
+ A aN;
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ aN = a1;
+ assert(A1<int>::copy_called == true);
+ assert(A1<int>::move_called == false);
+ assert(aN == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a1(A1<int>(4), A2<int>(5));
+ A aN;
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ aN = a1;
+ assert(A1<int>::copy_called == true);
+ assert(A1<int>::move_called == false);
+ assert(A2<int>::copy_called == true);
+ assert(A2<int>::move_called == false);
+ assert(aN == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a1(A1<int>(4), A2<int>(5), A3<int>(6));
+ A aN;
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ A3<int>::copy_called = false;
+ A3<int>::move_called = false;
+ aN = a1;
+ assert(A1<int>::copy_called == true);
+ assert(A1<int>::move_called == false);
+ assert(A2<int>::copy_called == true);
+ assert(A2<int>::move_called == false);
+ assert(A3<int>::copy_called == true);
+ 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/move_assign.pass.cpp b/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.pass.cpp
new file mode 100644
index 000000000000..0dc479c246c9
--- /dev/null
+++ b/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <class OuterAlloc, class... InnerAllocs>
+// class scoped_allocator_adaptor
+
+// scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor&& other);
+
+
+#include <scoped_allocator>
+#include <cassert>
+
+#include "allocators.h"
+
+int main()
+{
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a1(A1<int>(3));
+ A aN;
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ aN = std::move(a1);
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == true);
+ assert(aN == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a1(A1<int>(4), A2<int>(5));
+ A aN;
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ aN = std::move(a1);
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == true);
+ assert(A2<int>::copy_called == false);
+ assert(A2<int>::move_called == true);
+ assert(aN == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a1(A1<int>(4), A2<int>(5), A3<int>(6));
+ A aN;
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ A3<int>::copy_called = false;
+ A3<int>::move_called = false;
+ aN = std::move(a1);
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == true);
+ assert(A2<int>::copy_called == false);
+ assert(A2<int>::move_called == true);
+ assert(A3<int>::copy_called == false);
+ assert(A3<int>::move_called == true);
+ assert(aN == a1);
+ }
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+}
diff --git a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/copy.pass.cpp b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/copy.pass.cpp
index 6315598125c9..ad03e8fb6bb2 100644
--- a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/copy.pass.cpp
+++ b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/copy.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <functional>
// template<CopyConstructible Fn, CopyConstructible... Types>
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 33bf01855908..4577d0bf4d54 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
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <functional>
// template<CopyConstructible Fn, CopyConstructible... Types>
diff --git a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp
index ab4dd59534d5..815096f6b157 100644
--- a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp
+++ b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <functional>
// template<CopyConstructible Fn, CopyConstructible... Types>
diff --git a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
index af5efe464d5d..f69afbf57667 100644
--- a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
+++ b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <functional>
// template<CopyConstructible Fn, CopyConstructible... Types>
diff --git a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp
index 4913a510c36e..a1137ee388c1 100644
--- a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp
+++ b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <functional>
// template<CopyConstructible Fn, CopyConstructible... Types>
diff --git a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp
index b7874b77cf03..73f26e4b585a 100644
--- a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp
+++ b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <functional>
// template<CopyConstructible Fn, CopyConstructible... Types>
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 12720f7b550a..f61d93aefd89 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
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <functional>
// template<CopyConstructible Fn, CopyConstructible... Types>
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 7f8dd4a98d2b..83fa452fecb3 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
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <functional>
// template<class T> struct is_bind_expression
diff --git a/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression_03.pass.cpp b/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression_03.pass.cpp
new file mode 100644
index 000000000000..12a78dbc7548
--- /dev/null
+++ b/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression_03.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>
+
+//-----------------------------------------------------------------------------
+// TESTING template<class T> struct is_bind_expression
+//
+// bind is not implemented in C++03 so nothing is a bind expression. However
+// for compatibility reasons the trait is_bind_expression should be available
+// in C++03 and it should always return false.
+
+#include <functional>
+
+template <class T>
+void test() {
+ static_assert(!std::is_bind_expression<T>::value, "");
+}
+
+struct C {};
+
+int main() {
+ test<int>();
+ test<void>();
+ test<C>();
+ test<C&>();
+ test<C const&>();
+ test<C*>();
+ test<void()>();
+ test<int(*)()>();
+ test<int (C::*)()>();
+ test<decltype(std::placeholders::_2)>();
+}
diff --git a/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp b/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp
index 4b9cc76f7e4f..97b0b4d158a0 100644
--- a/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp
+++ b/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp
@@ -40,6 +40,7 @@
#include <functional>
#include <type_traits>
+#include <utility> // for std::move
#include <cassert>
struct NonCopyable {
diff --git a/test/std/utilities/function.objects/func.memfn/member_function.pass.cpp b/test/std/utilities/function.objects/func.memfn/member_function.pass.cpp
index 4096bd814421..f371223ee84c 100644
--- a/test/std/utilities/function.objects/func.memfn/member_function.pass.cpp
+++ b/test/std/utilities/function.objects/func.memfn/member_function.pass.cpp
@@ -69,4 +69,7 @@ int main()
test0(std::mem_fn(&A::test0));
test1(std::mem_fn(&A::test1));
test2(std::mem_fn(&A::test2));
+#if __has_feature(cxx_noexcept)
+ static_assert((noexcept(std::mem_fn(&A::test0))), ""); // LWG#2489
+#endif
}
diff --git a/test/std/utilities/function.objects/func.require/bullet_1_and_2.pass.cpp b/test/std/utilities/function.objects/func.require/bullet_1_and_2.pass.cpp
new file mode 100644
index 000000000000..e579f207a33f
--- /dev/null
+++ b/test/std/utilities/function.objects/func.require/bullet_1_and_2.pass.cpp
@@ -0,0 +1,318 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// INVOKE (f, t1, t2, ..., tN)
+
+//------------------------------------------------------------------------------
+// TESTING INVOKE(f, t1, t2, ..., tN)
+// - Bullet 1 -- (t1.*f)(t2, ..., tN)
+// - Bullet 2 -- ((*t1).*f)(t2, ..., tN)
+//
+// Overview:
+// Bullets 1 and 2 handle the case where 'f' is a pointer to member function.
+// Bullet 1 only handles the cases where t1 is an object of type T or a
+// type derived from 'T'. Bullet 2 handles all other cases.
+//
+// Concerns:
+// 1) cv-qualified member function signatures are accepted.
+// 2) reference qualified member function signatures are accepted.
+// 3) member functions with varargs at the end are accepted.
+// 4) The arguments are perfect forwarded to the member function call.
+// 5) Classes that are publicly derived from 'T' are accepted as the call object
+// 6) All types that dereference to T or a type derived from T can be used
+// as the call object.
+// 7) Pointers to T or a type derived from T can be used as the call object.
+// 8) Reference return types are properly deduced.
+//
+//
+// Plan:
+// 1) Create a class that contains a set, 'S', of non-static functions.
+// 'S' should include functions that cover every single combination
+// of qualifiers and varargs for arities of 0, 1 and 2 (C-1,2,3).
+// The argument types used in the functions should be non-copyable (C-4).
+// The functions should return 'MethodID::setUncheckedCall()'.
+//
+// 2) Create a set of supported call object, 'Objs', of different types
+// and behaviors. (C-5,6,7)
+//
+// 3) Attempt to call each function, 'f', in 'S' with each call object, 'c',
+// in 'Objs'. After every attempted call to 'f' check that 'f' was
+// actually called using 'MethodID::checkCalled(<return-value>)'
+//
+// 3b) If 'f' is reference qualified call 'f' with the properly qualified
+// call object. Otherwise call 'f' with lvalue call objects.
+//
+// 3a) If 'f' is const, volatile, or cv qualified then call it with call
+// objects that are equally or less cv-qualified.
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "invoke_helpers.h"
+
+//==============================================================================
+// MemFun03 - C++03 compatible set of test member functions.
+struct MemFun03 {
+ typedef void*& R;
+#define F(...) \
+ R f(__VA_ARGS__) { return MethodID<R(MemFun03::*)(__VA_ARGS__)>::setUncheckedCall(); } \
+ R f(__VA_ARGS__) const { return MethodID<R(MemFun03::*)(__VA_ARGS__) const>::setUncheckedCall(); } \
+ R f(__VA_ARGS__) volatile { return MethodID<R(MemFun03::*)(__VA_ARGS__) volatile>::setUncheckedCall(); } \
+ R f(__VA_ARGS__) const volatile { return MethodID<R(MemFun03::*)(__VA_ARGS__) const volatile>::setUncheckedCall(); }
+#
+ F()
+ F(...)
+ F(ArgType&)
+ F(ArgType&, ...)
+ F(ArgType&, ArgType&)
+ F(ArgType&, ArgType&, ...)
+ F(ArgType&, ArgType&, ArgType&)
+ F(ArgType&, ArgType&, ArgType&, ...)
+#undef F
+public:
+ MemFun03() {}
+private:
+ MemFun03(MemFun03 const&);
+ MemFun03& operator=(MemFun03 const&);
+};
+
+
+#if TEST_STD_VER >= 11
+
+//==============================================================================
+// MemFun11 - C++11 reference qualified test member functions.
+struct MemFun11 {
+ typedef void*& R;
+ typedef MemFun11 C;
+#define F(...) \
+ R f(__VA_ARGS__) & { return MethodID<R(C::*)(__VA_ARGS__) &>::setUncheckedCall(); } \
+ R f(__VA_ARGS__) const & { return MethodID<R(C::*)(__VA_ARGS__) const &>::setUncheckedCall(); } \
+ R f(__VA_ARGS__) volatile & { return MethodID<R(C::*)(__VA_ARGS__) volatile &>::setUncheckedCall(); } \
+ R f(__VA_ARGS__) const volatile & { return MethodID<R(C::*)(__VA_ARGS__) const volatile &>::setUncheckedCall(); } \
+ R f(__VA_ARGS__) && { return MethodID<R(C::*)(__VA_ARGS__) &&>::setUncheckedCall(); } \
+ R f(__VA_ARGS__) const && { return MethodID<R(C::*)(__VA_ARGS__) const &&>::setUncheckedCall(); } \
+ R f(__VA_ARGS__) volatile && { return MethodID<R(C::*)(__VA_ARGS__) volatile &&>::setUncheckedCall(); } \
+ R f(__VA_ARGS__) const volatile && { return MethodID<R(C::*)(__VA_ARGS__) const volatile &&>::setUncheckedCall(); }
+#
+ F()
+ F(...)
+ F(ArgType&&)
+ F(ArgType&&, ...)
+ F(ArgType&&, ArgType&&)
+ F(ArgType&&, ArgType&&, ...)
+ F(ArgType&&, ArgType&&, ArgType&&)
+ F(ArgType&&, ArgType&&, ArgType&&, ...)
+#undef F
+public:
+ MemFun11() {}
+private:
+ MemFun11(MemFun11 const&);
+ MemFun11& operator=(MemFun11 const&);
+};
+
+#endif // TEST_STD_VER >= 11
+
+
+//==============================================================================
+// TestCase - A test case for a single member function.
+// ClassType - The type of the class being tested.
+// CallSig - The function signature of the method being tested.
+// Arity - the arity of 'CallSig'
+// CV - the cv qualifiers of 'CallSig' represented as a type tag.
+// RValue - The method is RValue qualified.
+// ArgRValue - Call the method with RValue arguments.
+template <class ClassType, class CallSig, int Arity, class CV,
+ bool RValue = false, bool ArgRValue = false>
+struct TestCaseImp {
+public:
+
+ static void run() { TestCaseImp().doTest(); }
+
+private:
+ //==========================================================================
+ // TEST DISPATCH
+ void doTest() {
+ // (Plan-2) Create test call objects.
+ typedef ClassType T;
+ typedef DerivedFromType<T> D;
+ T obj;
+ T* obj_ptr = &obj;
+ D der;
+ D* der_ptr = &der;
+ DerefToType<T> dref;
+ DerefPropType<T> dref2;
+
+ // (Plan-3) Dispatch based on the CV tags.
+ CV tag;
+ Bool<!RValue> NotRValue;
+ runTestDispatch(tag, obj);
+ runTestDispatch(tag, der);
+ runTestDispatch(tag, dref2);
+ runTestDispatchIf(NotRValue, tag, dref);
+ runTestDispatchIf(NotRValue, tag, obj_ptr);
+ runTestDispatchIf(NotRValue, tag, der_ptr);
+ }
+
+ template <class QT, class Tp>
+ void runTestDispatchIf(Bool<true>, QT q, Tp& v) {
+ runTestDispatch(q, v);
+ }
+
+ template <class QT, class Tp>
+ void runTestDispatchIf(Bool<false>, QT, Tp&) {
+ }
+
+ template <class Tp>
+ void runTestDispatch(Q_None, Tp& v) {
+ runTest(v);
+ }
+
+ template <class Tp>
+ void runTestDispatch(Q_Const, Tp& v) {
+ Tp const& cv = v;
+ runTest(v);
+ runTest(cv);
+ }
+
+ template <class Tp>
+ void runTestDispatch(Q_Volatile, Tp& v) {
+ Tp volatile& vv = v;
+ runTest(v);
+ runTest(vv);
+ }
+
+ template <class Tp>
+ void runTestDispatch(Q_CV, Tp& v) {
+ Tp const& cv = v;
+ Tp volatile& vv = v;
+ Tp const volatile& cvv = v;
+ runTest(v);
+ runTest(cv);
+ runTest(vv);
+ runTest(cvv);
+ }
+
+ template <class Obj>
+ void runTest(Obj& obj) {
+ typedef Caster<Q_None, RValue> SCast;
+ typedef Caster<Q_None, ArgRValue> ACast;
+ typedef CallSig (ClassType::*MemPtr);
+ // Delegate test to logic in invoke_helpers.h
+ BasicTest<MethodID<MemPtr>, Arity, SCast, ACast> b;
+ b.runTest( (MemPtr)&ClassType::f, obj);
+ }
+};
+
+template <class Sig, int Arity, class CV>
+struct TestCase : public TestCaseImp<MemFun03, Sig, Arity, CV> {};
+
+#if TEST_STD_VER >= 11
+template <class Sig, int Arity, class CV, bool RValue = false>
+struct TestCase11 : public TestCaseImp<MemFun11, Sig, Arity, CV, RValue, true> {};
+#endif
+
+int main() {
+ typedef void*& R;
+ typedef ArgType A;
+ TestCase<R(), 0, Q_None>::run();
+ TestCase<R() const, 0, Q_Const>::run();
+ TestCase<R() volatile, 0, Q_Volatile>::run();
+ TestCase<R() const volatile, 0, Q_CV>::run();
+ TestCase<R(...), 0, Q_None>::run();
+ TestCase<R(...) const, 0, Q_Const>::run();
+ TestCase<R(...) volatile, 0, Q_Volatile>::run();
+ TestCase<R(...) const volatile, 0, Q_CV>::run();
+ TestCase<R(A&), 1, Q_None>::run();
+ TestCase<R(A&) const, 1, Q_Const>::run();
+ TestCase<R(A&) volatile, 1, Q_Volatile>::run();
+ TestCase<R(A&) const volatile, 1, Q_CV>::run();
+ TestCase<R(A&, ...), 1, Q_None>::run();
+ TestCase<R(A&, ...) const, 1, Q_Const>::run();
+ TestCase<R(A&, ...) volatile, 1, Q_Volatile>::run();
+ TestCase<R(A&, ...) const volatile, 1, Q_CV>::run();
+ TestCase<R(A&, A&), 2, Q_None>::run();
+ TestCase<R(A&, A&) const, 2, Q_Const>::run();
+ TestCase<R(A&, A&) volatile, 2, Q_Volatile>::run();
+ TestCase<R(A&, A&) const volatile, 2, Q_CV>::run();
+ TestCase<R(A&, A&, ...), 2, Q_None>::run();
+ TestCase<R(A&, A&, ...) const, 2, Q_Const>::run();
+ TestCase<R(A&, A&, ...) volatile, 2, Q_Volatile>::run();
+ TestCase<R(A&, A&, ...) const volatile, 2, Q_CV>::run();
+ TestCase<R(A&, A&, A&), 3, Q_None>::run();
+ TestCase<R(A&, A&, A&) const, 3, Q_Const>::run();
+ TestCase<R(A&, A&, A&) volatile, 3, Q_Volatile>::run();
+ TestCase<R(A&, A&, A&) const volatile, 3, Q_CV>::run();
+ TestCase<R(A&, A&, A&, ...), 3, Q_None>::run();
+ TestCase<R(A&, A&, A&, ...) const, 3, Q_Const>::run();
+ TestCase<R(A&, A&, A&, ...) volatile, 3, Q_Volatile>::run();
+ TestCase<R(A&, A&, A&, ...) const volatile, 3, Q_CV>::run();
+
+#if TEST_STD_VER >= 11
+ TestCase11<R() &, 0, Q_None>::run();
+ TestCase11<R() const &, 0, Q_Const>::run();
+ TestCase11<R() volatile &, 0, Q_Volatile>::run();
+ TestCase11<R() const volatile &, 0, Q_CV>::run();
+ TestCase11<R(...) &, 0, Q_None>::run();
+ TestCase11<R(...) const &, 0, Q_Const>::run();
+ TestCase11<R(...) volatile &, 0, Q_Volatile>::run();
+ TestCase11<R(...) const volatile &, 0, Q_CV>::run();
+ TestCase11<R(A&&) &, 1, Q_None>::run();
+ TestCase11<R(A&&) const &, 1, Q_Const>::run();
+ TestCase11<R(A&&) volatile &, 1, Q_Volatile>::run();
+ TestCase11<R(A&&) const volatile &, 1, Q_CV>::run();
+ TestCase11<R(A&&, ...) &, 1, Q_None>::run();
+ TestCase11<R(A&&, ...) const &, 1, Q_Const>::run();
+ TestCase11<R(A&&, ...) volatile &, 1, Q_Volatile>::run();
+ TestCase11<R(A&&, ...) const volatile &, 1, Q_CV>::run();
+ TestCase11<R(A&&, A&&) &, 2, Q_None>::run();
+ TestCase11<R(A&&, A&&) const &, 2, Q_Const>::run();
+ TestCase11<R(A&&, A&&) volatile &, 2, Q_Volatile>::run();
+ TestCase11<R(A&&, A&&) const volatile &, 2, Q_CV>::run();
+ TestCase11<R(A&&, A&&, ...) &, 2, Q_None>::run();
+ TestCase11<R(A&&, A&&, ...) const &, 2, Q_Const>::run();
+ TestCase11<R(A&&, A&&, ...) volatile &, 2, Q_Volatile>::run();
+ TestCase11<R(A&&, A&&, ...) const volatile &, 2, Q_CV>::run();
+ TestCase11<R() &&, 0, Q_None, /* RValue */ true>::run();
+ TestCase11<R() const &&, 0, Q_Const, /* RValue */ true>::run();
+ TestCase11<R() volatile &&, 0, Q_Volatile, /* RValue */ true>::run();
+ TestCase11<R() const volatile &&, 0, Q_CV, /* RValue */ true>::run();
+ TestCase11<R(...) &&, 0, Q_None, /* RValue */ true>::run();
+ TestCase11<R(...) const &&, 0, Q_Const, /* RValue */ true>::run();
+ TestCase11<R(...) volatile &&, 0, Q_Volatile, /* RValue */ true>::run();
+ TestCase11<R(...) const volatile &&, 0, Q_CV, /* RValue */ true>::run();
+ TestCase11<R(A&&) &&, 1, Q_None, /* RValue */ true>::run();
+ TestCase11<R(A&&) const &&, 1, Q_Const, /* RValue */ true>::run();
+ TestCase11<R(A&&) volatile &&, 1, Q_Volatile, /* RValue */ true>::run();
+ TestCase11<R(A&&) const volatile &&, 1, Q_CV, /* RValue */ true>::run();
+ TestCase11<R(A&&, ...) &&, 1, Q_None, /* RValue */ true>::run();
+ TestCase11<R(A&&, ...) const &&, 1, Q_Const, /* RValue */ true>::run();
+ TestCase11<R(A&&, ...) volatile &&, 1, Q_Volatile, /* RValue */ true>::run();
+ TestCase11<R(A&&, ...) const volatile &&, 1, Q_CV, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&) &&, 2, Q_None, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&) const &&, 2, Q_Const, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&) volatile &&, 2, Q_Volatile, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&) const volatile &&, 2, Q_CV, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&, ...) &&, 2, Q_None, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&, ...) const &&, 2, Q_Const, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&, ...) volatile &&, 2, Q_Volatile, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&, ...) const volatile &&, 2, Q_CV, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&, A&&) &&, 3, Q_None, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&, A&&) const &&, 3, Q_Const, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&, A&&) volatile &&, 3, Q_Volatile, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&, A&&) const volatile &&, 3, Q_CV, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&, A&&, ...) &&, 3, Q_None, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&, A&&, ...) const &&, 3, Q_Const, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&, A&&, ...) volatile &&, 3, Q_Volatile, /* RValue */ true>::run();
+ TestCase11<R(A&&, A&&, A&&, ...) const volatile &&, 3, Q_CV, /* RValue */ true>::run();
+#endif
+} \ No newline at end of file
diff --git a/test/std/utilities/function.objects/func.require/bullet_3_and_4.pass.cpp b/test/std/utilities/function.objects/func.require/bullet_3_and_4.pass.cpp
new file mode 100644
index 000000000000..b6fe190bd2a7
--- /dev/null
+++ b/test/std/utilities/function.objects/func.require/bullet_3_and_4.pass.cpp
@@ -0,0 +1,164 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// INVOKE (f, t1, t2, ..., tN)
+
+//------------------------------------------------------------------------------
+// TESTING INVOKE(f, t1, t2, ..., tN)
+// - Bullet 3 -- t1.*f
+// - Bullet 4 -- (*t1).*f
+//
+// Overview:
+// Bullets 3 and 4 handle the case where 'f' is a pointer to member object.
+// Bullet 3 only handles the cases where t1 is an object of type T or a
+// type derived from 'T'. Bullet 4 handles all other cases.
+//
+// Concerns:
+// 1) The return type is always an lvalue reference.
+// 2) The return type is not less cv-qualified that the object that contains it.
+// 3) The return type is not less cv-qualified than object type.
+// 4) The call object is perfectly forwarded.
+// 5) Classes that are publicly derived from 'T' are accepted as the call object
+// 6) All types that dereference to T or a type derived from T can be used
+// as the call object.
+// 7) Pointers to T or a type derived from T can be used as the call object.
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "invoke_helpers.h"
+
+template <class Tp>
+struct TestMemberObject {
+ TestMemberObject() : object() {}
+ Tp object;
+private:
+ TestMemberObject(TestMemberObject const&);
+ TestMemberObject& operator=(TestMemberObject const&);
+};
+
+template <class ObjectType>
+struct TestCase {
+ public:
+
+ static void run() { TestCase().doTest(); }
+
+private:
+ typedef TestMemberObject<ObjectType> TestType;
+
+ //==========================================================================
+ // TEST DISPATCH
+ void doTest() {
+ typedef DerivedFromType<TestType> Derived;
+ TestType obj;
+ TestType* obj_ptr = &obj;
+ Derived der;
+ Derived* der_ptr = &der;
+ DerefToType<TestType> dref;
+ DerefPropType<TestType> dref2;
+
+ {
+ typedef ObjectType (TestType::*MemPtr);
+ typedef ObjectType E;
+ MemPtr M = &TestType::object;
+ runTestDispatch<E>(M, obj, &obj.object);
+ runTestDispatch<E>(M, der, &der.object);
+ runTestDispatch<E>(M, dref2, &dref2.object.object);
+ runTestPointerDispatch<E>(M, obj_ptr, &obj_ptr->object);
+ runTestPointerDispatch<E>(M, der_ptr, &der_ptr->object);
+ runTestPointerDispatch<E>(M, dref, &dref.object.object);
+ }
+ {
+ typedef ObjectType const (TestType::*CMemPtr);
+ typedef ObjectType const E;
+ CMemPtr M = &TestType::object;
+ runTestDispatch<E>(M, obj, &obj.object);
+ runTestDispatch<E>(M, der, &der.object);
+ runTestDispatch<E>(M, dref2, &dref2.object.object);
+ runTestPointerDispatch<E>(M, obj_ptr, &obj_ptr->object);
+ runTestPointerDispatch<E>(M, der_ptr, &der_ptr->object);
+ runTestPointerDispatch<E>(M, dref, &dref.object.object);
+ }
+ {
+ typedef ObjectType volatile (TestType::*VMemPtr);
+ typedef ObjectType volatile E;
+ VMemPtr M = &TestType::object;
+ runTestDispatch<E>(M, obj, &obj.object);
+ runTestDispatch<E>(M, der, &der.object);
+ runTestDispatch<E>(M, dref2, &dref2.object.object);
+ runTestPointerDispatch<E>(M, obj_ptr, &obj_ptr->object);
+ runTestPointerDispatch<E>(M, der_ptr, &der_ptr->object);
+ runTestPointerDispatch<E>(M, dref, &dref.object.object);
+ }
+ {
+ typedef ObjectType const volatile (TestType::*CVMemPtr);
+ typedef ObjectType const volatile E;
+ CVMemPtr M = &TestType::object;
+ runTestDispatch<E>(M, obj, &obj.object);
+ runTestDispatch<E>(M, der, &der.object);
+ runTestDispatch<E>(M, dref2, &dref2.object.object);
+ runTestPointerDispatch<E>(M, obj_ptr, &obj_ptr->object);
+ runTestPointerDispatch<E>(M, der_ptr, &der_ptr->object);
+ runTestPointerDispatch<E>(M, dref, &dref.object.object);
+ }
+ }
+
+ template <class Expect, class Fn, class T>
+ void runTestDispatch(Fn M, T& obj, ObjectType* expect) {
+ runTest<Expect &> (M, C_<T&>(obj), expect);
+ runTest<Expect const&> (M, C_<T const&>(obj), expect);
+ runTest<Expect volatile&> (M, C_<T volatile&>(obj), expect);
+ runTest<Expect const volatile&>(M, C_<T const volatile&>(obj), expect);
+#if TEST_STD_VER >= 11
+ runTest<Expect&&> (M, C_<T&&>(obj), expect);
+ runTest<Expect const&&> (M, C_<T const&&>(obj), expect);
+ runTest<Expect volatile&&> (M, C_<T volatile&&>(obj), expect);
+ runTest<Expect const volatile&&>(M, C_<T const volatile&&>(obj), expect);
+#endif
+ }
+
+ template <class Expect, class Fn, class T>
+ void runTestPointerDispatch(Fn M, T& obj, ObjectType* expect) {
+ runTest<Expect&>(M, C_<T &>(obj), expect);
+ runTest<Expect&>(M, C_<T const&>(obj), expect);
+ runTest<Expect&>(M, C_<T volatile&>(obj), expect);
+ runTest<Expect&>(M, C_<T const volatile&>(obj), expect);
+#if TEST_STD_VER >= 11
+ runTest<Expect&>(M, C_<T&&>(obj), expect);
+ runTest<Expect&>(M, C_<T const&&>(obj), expect);
+ runTest<Expect&>(M, C_<T volatile&&>(obj), expect);
+ runTest<Expect&>(M, C_<T const volatile&&>(obj), expect);
+#endif
+ }
+
+ template <class Expect, class Fn, class T>
+#if TEST_STD_VER >= 11
+ void runTest(Fn M, T&& obj, ObjectType* expect) {
+#else
+ void runTest(Fn M, T& obj, ObjectType* expect ) {
+#endif
+ static_assert((std::is_same<
+ decltype(std::__invoke(M, std::forward<T>(obj))), Expect
+ >::value), "");
+ Expect e = std::__invoke(M, std::forward<T>(obj));
+ assert(&e == expect);
+ }
+};
+
+int main() {
+ TestCase<ArgType>::run();
+ TestCase<ArgType const>::run();
+ TestCase<ArgType volatile>::run();
+ TestCase<ArgType const volatile>::run();
+ TestCase<ArgType*>::run();
+} \ No newline at end of file
diff --git a/test/std/utilities/function.objects/func.require/bullet_5.pass.cpp b/test/std/utilities/function.objects/func.require/bullet_5.pass.cpp
new file mode 100644
index 000000000000..3f3c96a9b9bd
--- /dev/null
+++ b/test/std/utilities/function.objects/func.require/bullet_5.pass.cpp
@@ -0,0 +1,327 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// INVOKE (f, t1, t2, ..., tN)
+
+//------------------------------------------------------------------------------
+// TESTING INVOKE(f, t1, t2, ..., tN)
+// - Bullet 5 -- f(t2, ..., tN)
+//
+// Overview:
+// Bullet 5 handles the cases where the first argument is not a member
+// function.
+//
+// Concerns:
+// 1) Different types of callable objects are supported. Including
+// 1a) Free Function pointers and references.
+// 1b) Classes which provide a call operator
+// 1c) lambdas
+// 2) The callable objects are perfect forwarded.
+// 3) The arguments are perfect forwarded.
+// 4) Signatures which include varargs are supported.
+// 5) In C++03 3 extra arguments should be allowed.
+//
+// Plan:
+// 1) Define a set of free functions, 'SF', and class types with call
+// operators, 'SC', that address concerns 4 and 5. The free functions should
+// return 'FunctionID::setUncheckedCall()' and the call operators should
+// return 'MethodID::setUncheckedCall()'.
+//
+// 2) For each function 'f' in 'SF' and 'SC' attempt to call 'f'
+// using the correct number of arguments and cv-ref qualifiers. Check that
+// 'f' has been called using 'FunctionID::checkCall()' if 'f' is a free
+// function and 'MethodID::checkCall()' otherwise.
+
+
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "invoke_helpers.h"
+
+
+//==============================================================================
+// freeFunction03 - A C++03 free function.
+void*& freeFunction03() {
+ return FunctionPtrID<void*&(), freeFunction03>::setUncheckedCall();
+}
+
+void*& freeFunction03(...) {
+ return FunctionPtrID<void*&(...), freeFunction03>::setUncheckedCall();
+}
+
+template <class A0>
+void*& freeFunction03(A0&) {
+ return FunctionPtrID<void*&(A0&), freeFunction03>::setUncheckedCall();
+}
+
+
+template <class A0>
+void*& freeFunction03(A0&, ...) {
+ return FunctionPtrID<void*&(A0&, ...), freeFunction03>::setUncheckedCall();
+}
+
+template <class A0, class A1>
+void*& freeFunction03(A0&, A1&) {
+ return FunctionPtrID<void*&(A0&, A1&), freeFunction03>::setUncheckedCall();
+}
+
+
+template <class A0, class A1>
+void*& freeFunction03(A0&, A1&, ...) {
+ return FunctionPtrID<void*&(A0&, A1&, ...), freeFunction03>::setUncheckedCall();
+}
+
+template <class A0, class A1, class A2>
+void*& freeFunction03(A0&, A1&, A2&) {
+ return FunctionPtrID<void*&(A0&, A1&, A2&), freeFunction03>::setUncheckedCall();
+}
+
+template <class A0, class A1, class A2>
+void*& freeFunction03(A0&, A1&, A2&, ...) {
+ return FunctionPtrID<void*&(A0&, A1&, A2&, ...), freeFunction03>::setUncheckedCall();
+}
+
+//==============================================================================
+// Functor03 - C++03 compatible functor object
+struct Functor03 {
+ typedef void*& R;
+ typedef Functor03 C;
+#define F(Args, ...) \
+ __VA_ARGS__ R operator() Args { return MethodID<R(C::*) Args>::setUncheckedCall(); } \
+ __VA_ARGS__ R operator() Args const { return MethodID<R(C::*) Args const>::setUncheckedCall(); } \
+ __VA_ARGS__ R operator() Args volatile { return MethodID<R(C::*) Args volatile>::setUncheckedCall(); } \
+ __VA_ARGS__ R operator() Args const volatile { return MethodID<R(C::*) Args const volatile>::setUncheckedCall(); }
+#
+ F(())
+ F((A0&), template <class A0>)
+ F((A0&, A1&), template <class A0, class A1>)
+ F((A0&, A1&, A2&), template <class A0, class A1, class A2>)
+#undef F
+public:
+ Functor03() {}
+private:
+ Functor03(Functor03 const&);
+ Functor03& operator=(Functor03 const&);
+};
+
+
+#if TEST_STD_VER >= 11
+
+//==============================================================================
+// freeFunction11 - A C++11 free function.
+template <class ...Args>
+void*& freeFunction11(Args&&...) {
+ return FunctionPtrID<void*&(Args&&...), freeFunction11>::setUncheckedCall();
+}
+
+template <class ...Args>
+void*& freeFunction11(Args&&...,...) {
+ return FunctionPtrID<void*&(Args&&...,...), freeFunction11>::setUncheckedCall();
+}
+
+//==============================================================================
+// Functor11 - C++11 reference qualified test member functions.
+struct Functor11 {
+ typedef void*& R;
+ typedef Functor11 C;
+
+#define F(CV) \
+ template <class ...Args> \
+ R operator()(Args&&...) CV { return MethodID<R(C::*)(Args&&...) CV>::setUncheckedCall(); }
+#
+ F(&)
+ F(const &)
+ F(volatile &)
+ F(const volatile &)
+ F(&&)
+ F(const &&)
+ F(volatile &&)
+ F(const volatile &&)
+#undef F
+public:
+ Functor11() {}
+private:
+ Functor11(Functor11 const&);
+ Functor11& operator=(Functor11 const&);
+};
+
+#endif // TEST_STD_VER >= 11
+
+
+//==============================================================================
+// TestCaseFunctorImp - A test case for an operator() class method.
+// ClassType - The type of the call object.
+// CallSig - The function signature of the call operator being tested.
+// Arity - the arity of 'CallSig'
+// ObjCaster - Transformation function applied to call object.
+// ArgCaster - Transformation function applied to the extra arguments.
+template <class ClassType, class CallSig, int Arity,
+ class ObjCaster, class ArgCaster = LValueCaster>
+struct TestCaseFunctorImp {
+public:
+ static void run() {
+ typedef MethodID<CallSig ClassType::*> MID;
+ BasicTest<MID, Arity, ObjCaster, ArgCaster> t;
+ typedef ClassType T;
+ typedef DerivedFromType<T> D;
+ T obj;
+ D der;
+ t.runTest(obj);
+ t.runTest(der);
+ }
+};
+
+//==============================================================================
+// TestCaseFreeFunction - A test case for a free function.
+// CallSig - The function signature of the free function being tested.
+// FnPtr - The function being tested.
+// Arity - the arity of 'CallSig'
+// ArgCaster - Transformation function to be applied to the extra arguments.
+template <class CallSig, CallSig* FnPtr, int Arity, class ArgCaster>
+struct TestCaseFreeFunction {
+public:
+ static void run() {
+ typedef FunctionPtrID<CallSig, FnPtr> FID;
+ BasicTest<FID, Arity, LValueCaster, ArgCaster> t;
+
+ DerefToType<CallSig*> deref_to(FnPtr);
+ DerefToType<CallSig&> deref_to_ref(*FnPtr);
+
+ t.runTest(FnPtr);
+ t.runTest(*FnPtr);
+ t.runTest(deref_to);
+ t.runTest(deref_to_ref);
+ }
+};
+
+//==============================================================================
+// runTest Helpers
+//==============================================================================
+#if TEST_STD_VER >= 11
+template <class Sig, int Arity, class ArgCaster>
+void runFunctionTestCase11() {
+ TestCaseFreeFunction<Sig, freeFunction11, Arity, ArgCaster>();
+}
+#endif
+
+template <class Sig, int Arity, class ArgCaster>
+void runFunctionTestCase() {
+ TestCaseFreeFunction<Sig, freeFunction03, Arity, ArgCaster>();
+#if TEST_STD_VER >= 11
+ runFunctionTestCase11<Sig, Arity, ArgCaster>();
+#endif
+}
+
+template <class Sig, int Arity, class ObjCaster, class ArgCaster>
+void runFunctorTestCase() {
+ TestCaseFunctorImp<Functor03, Sig, Arity, ObjCaster, ArgCaster>::run();
+}
+
+template <class Sig, int Arity, class ObjCaster>
+void runFunctorTestCase() {
+ TestCaseFunctorImp<Functor03, Sig, Arity, ObjCaster>::run();
+}
+
+#if TEST_STD_VER >= 11
+// runTestCase - Run a test case for C++11 class functor types
+template <class Sig, int Arity, class ObjCaster, class ArgCaster = LValueCaster>
+void runFunctorTestCase11() {
+ TestCaseFunctorImp<Functor11, Sig, Arity, ObjCaster, ArgCaster>::run();
+}
+#endif
+
+// runTestCase - Run a test case for both function and functor types.
+template <class Sig, int Arity, class ArgCaster>
+void runTestCase() {
+ runFunctionTestCase<Sig, Arity, ArgCaster>();
+ runFunctorTestCase <Sig, Arity, LValueCaster, ArgCaster>();
+};
+
+int main() {
+ typedef void*& R;
+ typedef ArgType A;
+ typedef A const CA;
+
+ runTestCase< R(), 0, LValueCaster >();
+ runTestCase< R(A&), 1, LValueCaster >();
+ runTestCase< R(A&, A&), 2, LValueCaster >();
+ runTestCase< R(A&, A&, A&), 3, LValueCaster >();
+ runTestCase< R(CA&), 1, ConstCaster >();
+ runTestCase< R(CA&, CA&), 2, ConstCaster >();
+ runTestCase< R(CA&, CA&, CA&), 3, ConstCaster >();
+
+ runFunctionTestCase<R(...), 0, LValueCaster >();
+ runFunctionTestCase<R(A&, ...), 1, LValueCaster >();
+ runFunctionTestCase<R(A&, A&, ...), 2, LValueCaster >();
+ runFunctionTestCase<R(A&, A&, A&, ...), 3, LValueCaster >();
+
+#if TEST_STD_VER >= 11
+ runFunctionTestCase11<R(A&&), 1, MoveCaster >();
+ runFunctionTestCase11<R(A&&, ...), 1, MoveCaster >();
+#endif
+
+ runFunctorTestCase<R(), 0, LValueCaster >();
+ runFunctorTestCase<R() const, 0, ConstCaster >();
+ runFunctorTestCase<R() volatile, 0, VolatileCaster >();
+ runFunctorTestCase<R() const volatile, 0, CVCaster >();
+ runFunctorTestCase<R(A&), 1, LValueCaster >();
+ runFunctorTestCase<R(A&) const, 1, ConstCaster >();
+ runFunctorTestCase<R(A&) volatile, 1, VolatileCaster >();
+ runFunctorTestCase<R(A&) const volatile, 1, CVCaster >();
+ runFunctorTestCase<R(A&, A&), 2, LValueCaster >();
+ runFunctorTestCase<R(A&, A&) const, 2, ConstCaster >();
+ runFunctorTestCase<R(A&, A&) volatile, 2, VolatileCaster >();
+ runFunctorTestCase<R(A&, A&) const volatile, 2, CVCaster >();
+ runFunctorTestCase<R(A&, A&, A&), 3, LValueCaster >();
+ runFunctorTestCase<R(A&, A&, A&) const, 3, ConstCaster >();
+ runFunctorTestCase<R(A&, A&, A&) volatile, 3, VolatileCaster >();
+ runFunctorTestCase<R(A&, A&, A&) const volatile, 3, CVCaster >();
+ {
+ typedef ConstCaster CC;
+ runFunctorTestCase<R(CA&), 1, LValueCaster, CC>();
+ runFunctorTestCase<R(CA&) const, 1, ConstCaster, CC>();
+ runFunctorTestCase<R(CA&) volatile, 1, VolatileCaster, CC>();
+ runFunctorTestCase<R(CA&) const volatile, 1, CVCaster, CC>();
+ runFunctorTestCase<R(CA&, CA&), 2, LValueCaster, CC>();
+ runFunctorTestCase<R(CA&, CA&) const, 2, ConstCaster, CC>();
+ runFunctorTestCase<R(CA&, CA&) volatile, 2, VolatileCaster, CC>();
+ runFunctorTestCase<R(CA&, CA&) const volatile, 2, CVCaster, CC>();
+ runFunctorTestCase<R(CA&, CA&, CA&), 3, LValueCaster, CC>();
+ runFunctorTestCase<R(CA&, CA&, CA&) const, 3, ConstCaster, CC>();
+ runFunctorTestCase<R(CA&, CA&, CA&) volatile, 3, VolatileCaster, CC>();
+ runFunctorTestCase<R(CA&, CA&, CA&) const volatile, 3, CVCaster, CC>();
+ }
+
+#if TEST_STD_VER >= 11
+ runFunctorTestCase11<R() &, 0, LValueCaster >();
+ runFunctorTestCase11<R() const &, 0, ConstCaster >();
+ runFunctorTestCase11<R() volatile &, 0, VolatileCaster >();
+ runFunctorTestCase11<R() const volatile &, 0, CVCaster >();
+ runFunctorTestCase11<R() &&, 0, MoveCaster >();
+ runFunctorTestCase11<R() const &&, 0, MoveConstCaster >();
+ runFunctorTestCase11<R() volatile &&, 0, MoveVolatileCaster >();
+ runFunctorTestCase11<R() const volatile &&, 0, MoveCVCaster >();
+ {
+ typedef MoveCaster MC;
+ runFunctorTestCase11<R(A&&) &, 1, LValueCaster, MC>();
+ runFunctorTestCase11<R(A&&) const &, 1, ConstCaster, MC>();
+ runFunctorTestCase11<R(A&&) volatile &, 1, VolatileCaster, MC>();
+ runFunctorTestCase11<R(A&&) const volatile &, 1, CVCaster, MC>();
+ runFunctorTestCase11<R(A&&) &&, 1, MoveCaster, MC>();
+ runFunctorTestCase11<R(A&&) const &&, 1, MoveConstCaster, MC>();
+ runFunctorTestCase11<R(A&&) volatile &&, 1, MoveVolatileCaster, MC>();
+ runFunctorTestCase11<R(A&&) const volatile &&, 1, MoveCVCaster, MC>();
+ }
+#endif
+}
diff --git a/test/std/utilities/function.objects/func.require/invoke_helpers.h b/test/std/utilities/function.objects/func.require/invoke_helpers.h
new file mode 100644
index 000000000000..0583b624da31
--- /dev/null
+++ b/test/std/utilities/function.objects/func.require/invoke_helpers.h
@@ -0,0 +1,317 @@
+#ifndef INVOKE_HELPERS_H
+#define INVOKE_HELPERS_H
+
+#include <type_traits>
+#include <cassert>
+#include <functional>
+
+#include "test_macros.h"
+
+template <int I>
+struct Int : public std::integral_constant<int, I> {};
+
+template <bool P>
+struct Bool : public std::integral_constant<bool, P> {};
+
+struct Q_None {
+ template <class T>
+ struct apply { typedef T type; };
+};
+
+struct Q_Const {
+ template <class T>
+ struct apply { typedef T const type; };
+};
+
+struct Q_Volatile {
+ template <class T>
+ struct apply { typedef T volatile type; };
+};
+
+struct Q_CV {
+ template <class T>
+ struct apply { typedef T const volatile type; };
+};
+
+// Caster - A functor object that performs cv-qualifier and value category
+// conversions.
+// QualTag - A metafunction type that applies cv-qualifiers to its argument.
+// RValue - True if the resulting object should be an RValue reference.
+// False otherwise.
+template <class QualTag, bool RValue = false>
+struct Caster {
+ template <class T>
+ struct apply {
+ typedef typename std::remove_reference<T>::type RawType;
+ typedef typename QualTag::template apply<RawType>::type CVType;
+#if TEST_STD_VER >= 11
+ typedef typename std::conditional<RValue,
+ CVType&&, CVType&
+ >::type type;
+#else
+ typedef CVType& type;
+#endif
+ };
+
+ template <class T>
+ typename apply<T>::type
+ operator()(T& obj) const {
+ typedef typename apply<T>::type OutType;
+ return static_cast<OutType>(obj);
+ }
+};
+
+typedef Caster<Q_None> LValueCaster;
+typedef Caster<Q_Const> ConstCaster;
+typedef Caster<Q_Volatile> VolatileCaster;
+typedef Caster<Q_CV> CVCaster;
+typedef Caster<Q_None, true> MoveCaster;
+typedef Caster<Q_Const, true> MoveConstCaster;
+typedef Caster<Q_Volatile, true> MoveVolatileCaster;
+typedef Caster<Q_CV, true> MoveCVCaster;
+
+// A shorter name for 'static_cast'
+template <class QualType, class Tp>
+QualType C_(Tp& v) { return static_cast<QualType>(v); };
+
+//==============================================================================
+// ArgType - A non-copyable type intended to be used as a dummy argument type
+// to test functions.
+struct ArgType {
+ int value;
+ explicit ArgType(int val = 0) : value(val) {}
+private:
+ ArgType(ArgType const&);
+ ArgType& operator=(ArgType const&);
+};
+
+//==============================================================================
+// DerivedFromBase - A type that derives from it's template argument 'Base'
+template <class Base>
+struct DerivedFromType : public Base {
+ DerivedFromType() : Base() {}
+ template <class Tp>
+ explicit DerivedFromType(Tp const& t) : Base(t) {}
+};
+
+//==============================================================================
+// DerefToType - A type that dereferences to it's template argument 'To'.
+// The cv-ref qualifiers of the 'DerefToType' object do not propagate
+// to the resulting 'To' object.
+template <class To>
+struct DerefToType {
+ To object;
+
+ DerefToType() {}
+
+ template <class Up>
+ explicit DerefToType(Up const& val) : object(val) {}
+
+ To& operator*() const volatile { return const_cast<To&>(object); }
+};
+
+//==============================================================================
+// DerefPropToType - A type that dereferences to it's template argument 'To'.
+// The cv-ref qualifiers of the 'DerefPropToType' object propagate
+// to the resulting 'To' object.
+template <class To>
+struct DerefPropType {
+ To object;
+
+ DerefPropType() {}
+
+ template <class Up>
+ explicit DerefPropType(Up const& val) : object(val) {}
+
+#if TEST_STD_VER < 11
+ To& operator*() { return object; }
+ To const& operator*() const { return object; }
+ To volatile& operator*() volatile { return object; }
+ To const volatile& operator*() const volatile { return object; }
+#else
+ To& operator*() & { return object; }
+ To const& operator*() const & { return object; }
+ To volatile& operator*() volatile & { return object; }
+ To const volatile& operator*() const volatile & { return object; }
+ To&& operator*() && { return static_cast<To &&>(object); }
+ To const&& operator*() const && { return static_cast<To const&&>(object); }
+ To volatile&& operator*() volatile && { return static_cast<To volatile&&>(object); }
+ To const volatile&& operator*() const volatile && { return static_cast<To const volatile&&>(object); }
+#endif
+};
+
+//==============================================================================
+// MethodID - A type that uniquely identifies a member function for a class.
+// This type is used to communicate between the member functions being tested
+// and the tests invoking them.
+// - Test methods should call 'setUncheckedCall()' whenever they are invoked.
+// - Tests consume the unchecked call using checkCall(<return-value>)` to assert
+// that the method has been called and that the return value of `__invoke`
+// matches what the method actually returned.
+template <class T>
+struct MethodID {
+ typedef void* IDType;
+
+ static int dummy; // A dummy memory location.
+ static void* id; // The "ID" is the value of this pointer.
+ static bool unchecked_call; // Has a call happened that has not been checked.
+
+ static void*& setUncheckedCall() {
+ assert(unchecked_call == false);
+ unchecked_call = true;
+ return id;
+ }
+
+ static bool checkCalled(void*& return_value) {
+ bool old = unchecked_call;
+ unchecked_call = false;
+ return old && id == return_value && &id == &return_value;
+ }
+};
+
+template <class T> int MethodID<T>::dummy = 0;
+template <class T> void* MethodID<T>::id = (void*)&MethodID<T>::dummy;
+template <class T> bool MethodID<T>::unchecked_call = false;
+
+
+//==============================================================================
+// FunctionPtrID - Like MethodID but for free function pointers.
+template <class T, T*>
+struct FunctionPtrID {
+ static int dummy; // A dummy memory location.
+ static void* id; // The "ID" is the value of this pointer.
+ static bool unchecked_call; // Has a call happened that has not been checked.
+
+ static void*& setUncheckedCall() {
+ assert(unchecked_call == false);
+ unchecked_call = true;
+ return id;
+ }
+
+ static bool checkCalled(void*& return_value) {
+ bool old = unchecked_call;
+ unchecked_call = false;
+ return old && id == return_value && &id == &return_value;
+ }
+};
+
+template <class T, T* Ptr> int FunctionPtrID<T, Ptr>::dummy = 0;
+template <class T, T* Ptr> void* FunctionPtrID<T, Ptr>::id = (void*)&FunctionPtrID<T, Ptr>::dummy;
+template <class T, T* Ptr> bool FunctionPtrID<T, Ptr>::unchecked_call = false;
+
+//==============================================================================
+// BasicTest - The basic test structure for everything except
+// member object pointers.
+// ID - The "Function Identifier" type used either MethodID or FunctionPtrID.
+// Arity - The Arity of the call signature.
+// ObjectCaster - The object transformation functor type.
+// ArgCaster - The extra argument transformation functor type.
+template <class ID, int Arity, class ObjectCaster = LValueCaster,
+ class ArgCaster = LValueCaster>
+struct BasicTest {
+ template <class ObjectT>
+ void runTest(ObjectT& object) {
+ Int<Arity> A;
+ runTestImp(A, object);
+ }
+
+ template <class MethodPtr, class ObjectT>
+ void runTest(MethodPtr ptr, ObjectT& object) {
+ Int<Arity> A;
+ runTestImp(A, ptr, object);
+ }
+
+private:
+ typedef void*& CallRet;
+ ObjectCaster object_cast;
+ ArgCaster arg_cast;
+ ArgType a0, a1, a2;
+
+ //==========================================================================
+ // BULLET 1 AND 2 TEST METHODS
+ //==========================================================================
+ template <class MethodPtr, class ObjectT>
+ void runTestImp(Int<0>, MethodPtr ptr, ObjectT& object) {
+ static_assert((std::is_same<
+ decltype(std::__invoke(ptr, object_cast(object)))
+ , CallRet>::value), "");
+ assert(ID::unchecked_call == false);
+ CallRet ret = std::__invoke(ptr, object_cast(object));
+ assert(ID::checkCalled(ret));
+ }
+
+ template <class MethodPtr, class ObjectT>
+ void runTestImp(Int<1>, MethodPtr ptr, ObjectT& object) {
+ static_assert((std::is_same<
+ decltype(std::__invoke(ptr, object_cast(object), arg_cast(a0)))
+ , CallRet>::value), "");
+ assert(ID::unchecked_call == false);
+ CallRet ret = std::__invoke(ptr, object_cast(object), arg_cast(a0));
+ assert(ID::checkCalled(ret));
+ }
+
+ template <class MethodPtr, class ObjectT>
+ void runTestImp(Int<2>, MethodPtr ptr, ObjectT& object) {
+ static_assert((std::is_same<
+ decltype(std::__invoke(ptr, object_cast(object), arg_cast(a0), arg_cast(a1)))
+ , CallRet>::value), "");
+ assert(ID::unchecked_call == false);
+ CallRet ret = std::__invoke(ptr, object_cast(object), arg_cast(a0), arg_cast(a1));
+ assert(ID::checkCalled(ret));
+ }
+
+ template <class MethodPtr, class ObjectT>
+ void runTestImp(Int<3>, MethodPtr ptr, ObjectT& object) {
+ static_assert((std::is_same<
+ decltype(std::__invoke(ptr, object_cast(object), arg_cast(a0), arg_cast(a1), arg_cast(a2)))
+ , CallRet>::value), "");
+ assert(ID::unchecked_call == false);
+ CallRet ret = std::__invoke(ptr, object_cast(object), arg_cast(a0), arg_cast(a1), arg_cast(a2));
+ assert(ID::checkCalled(ret));
+ }
+
+ //==========================================================================
+ // BULLET 5 TEST METHODS
+ //==========================================================================
+ template <class ObjectT>
+ void runTestImp(Int<0>, ObjectT& object) {
+ static_assert((std::is_same<
+ decltype(std::__invoke(object_cast(object)))
+ , CallRet>::value), "");
+ assert(ID::unchecked_call == false);
+ CallRet ret = std::__invoke(object_cast(object));
+ assert(ID::checkCalled(ret));
+ }
+
+ template <class ObjectT>
+ void runTestImp(Int<1>, ObjectT& object) {
+ static_assert((std::is_same<
+ decltype(std::__invoke(object_cast(object), arg_cast(a0)))
+ , CallRet>::value), "");
+ assert(ID::unchecked_call == false);
+ CallRet ret = std::__invoke(object_cast(object), arg_cast(a0));
+ assert(ID::checkCalled(ret));
+ }
+
+ template <class ObjectT>
+ void runTestImp(Int<2>, ObjectT& object) {
+ static_assert((std::is_same<
+ decltype(std::__invoke(object_cast(object), arg_cast(a0), arg_cast(a1)))
+ , CallRet>::value), "");
+ assert(ID::unchecked_call == false);
+ CallRet ret = std::__invoke(object_cast(object), arg_cast(a0), arg_cast(a1));
+ assert(ID::checkCalled(ret));
+ }
+
+ template <class ObjectT>
+ void runTestImp(Int<3>, ObjectT& object) {
+ static_assert((std::is_same<
+ decltype(std::__invoke(object_cast(object), arg_cast(a0), arg_cast(a1), arg_cast(a2)))
+ , CallRet>::value), "");
+ assert(ID::unchecked_call == false);
+ CallRet ret = std::__invoke(object_cast(object), arg_cast(a0), arg_cast(a1), arg_cast(a2));
+ assert(ID::checkCalled(ret));
+ }
+};
+
+#endif // INVOKE_HELPERS_H
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 cd86e4cbf8eb..82a6f6c5215e 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
@@ -11,7 +11,7 @@
// class function<R(ArgTypes...)>
-// function(nullptr_t);
+// function(F);
#include <functional>
#include <cassert>
@@ -87,4 +87,8 @@ int main()
assert(f.target<int(*)(int)>() != 0);
f(1);
}
+ {
+ std::function <void()> f(static_cast<void (*)()>(0));
+ assert(!f);
+ }
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_nullptr.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_nullptr.pass.cpp
new file mode 100644
index 000000000000..f89bde8e6544
--- /dev/null
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_nullptr.pass.cpp
@@ -0,0 +1,247 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// class function<R(ArgTypes...)>
+
+// function(Fp);
+
+// Ensure that __not_null works for all function types.
+// See https://llvm.org/bugs/show_bug.cgi?id=23589
+
+//------------------------------------------------------------------------------
+// TESTING std::function<...>::__not_null(Callable)
+//
+// Concerns:
+// 1) The call __not_null(Callable) is well formed and correct for each
+// possible 'Callable' type category. These categories include:
+// 1a) function pointers
+// 1b) member function pointer
+// 1c) member data pointer
+// 1d) callable class type
+// 1e) lambdas
+// Categories 1a, 1b, and 1c are 'Nullable' types. Only objects of these
+// types can be null. The other categories are not tested here.
+// 3) '__not_null(Callable)' is well formed when the call signature includes
+// varargs.
+// 4) '__not_null(Callable)' works for Callable types with all aritys less
+// than or equal to 3 in C++03.
+// 5) '__not_null(Callable)' works when 'Callable' is a member function
+// pointer to a cv or ref qualified function type.
+//
+// Plan:
+// 1 For categories 1a, 1b and 1c define a set of
+// 'Callable' objects for this category. This set should include examples
+// of arity 0, 1, 2 and possible 3 including versions with varargs as the
+// last parameter.
+//
+// 2 For each 'Callable' object in categories 1a, 1b and 1c do the following.
+//
+// 1 Define a type 'std::function<Sig>' as 'F' where 'Sig' is compatible with
+// the signature of the 'Callable' object.
+//
+// 2 Create an object of type 'F' using a null pointer of type 'Callable'.
+// Check that 'F.target<Callable>()' is null.
+//
+// 3 Create an object of type 'F' that is not null. Check that
+// 'F.target<Callable>()' is not null and is equal to the original
+// argument.
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+///////////////////////////////////////////////////////////////////////////////
+int foo() { return 42; }
+int foo(int) { return 42; }
+int foo(int, int) { return 42; }
+int foo(int, int, int) { return 42; }
+
+int foo(...) { return 42; }
+int foo(int, ...) { return 42; }
+int foo(int, int, ...) { return 42; }
+int foo(int, int, int, ...) { return 42; }
+
+///////////////////////////////////////////////////////////////////////////////
+struct MemFun03 {
+ int foo() { return 42; }
+ int foo() const { return 42; }
+ int foo() volatile { return 42; }
+ int foo() const volatile { return 42; }
+
+ int foo(int) { return 42; }
+ int foo(int) const { return 42; }
+ int foo(int) volatile { return 42; }
+ int foo(int) const volatile { return 42; }
+
+ int foo(int, int) { return 42; }
+ int foo(int, int) const { return 42; }
+ int foo(int, int) volatile { return 42; }
+ int foo(int, int) const volatile { return 42; }
+
+ int foo(int, int, int) { return 42; }
+ int foo(int, int, int) const { return 42; }
+ int foo(int, int, int) volatile { return 42; }
+ int foo(int, int, int) const volatile { return 42; }
+
+ int foo(...) { return 42; }
+ int foo(...) const { return 42; }
+ int foo(...) volatile { return 42; }
+ int foo(...) const volatile { return 42; }
+
+ int foo(int, ...) { return 42; }
+ int foo(int, ...) const { return 42; }
+ int foo(int, ...) volatile { return 42; }
+ int foo(int, ...) const volatile { return 42; }
+
+ int foo(int, int, ...) { return 42; }
+ int foo(int, int, ...) const { return 42; }
+ int foo(int, int, ...) volatile { return 42; }
+ int foo(int, int, ...) const volatile { return 42; }
+
+ int foo(int, int, int, ...) { return 42; }
+ int foo(int, int, int, ...) const { return 42; }
+ int foo(int, int, int, ...) volatile { return 42; }
+ int foo(int, int, int, ...) const volatile { return 42; }
+};
+
+#if TEST_STD_VER >= 11
+struct MemFun11 {
+ int foo() & { return 42; }
+ int foo() const & { return 42; }
+ int foo() volatile & { return 42; }
+ int foo() const volatile & { return 42; }
+
+ int foo(...) & { return 42; }
+ int foo(...) const & { return 42; }
+ int foo(...) volatile & { return 42; }
+ int foo(...) const volatile & { return 42; }
+
+ int foo() && { return 42; }
+ int foo() const && { return 42; }
+ int foo() volatile && { return 42; }
+ int foo() const volatile && { return 42; }
+
+ int foo(...) && { return 42; }
+ int foo(...) const && { return 42; }
+ int foo(...) volatile && { return 42; }
+ int foo(...) const volatile && { return 42; }
+};
+#endif // TEST_STD_VER >= 11
+
+struct MemData {
+ int foo;
+};
+
+// Create a non-null free function by taking the address of
+// &static_cast<Tp&>(foo);
+template <class Tp>
+struct Creator {
+ static Tp create() {
+ return &foo;
+ }
+};
+
+// Create a non-null member pointer.
+template <class Ret, class Class>
+struct Creator<Ret Class::*> {
+ typedef Ret Class::*ReturnType;
+ static ReturnType create() {
+ return &Class::foo;
+ }
+};
+
+template <class TestFn, class Fn>
+void test_imp() {
+ { // Check that the null value is detected
+ TestFn tf = nullptr;
+ std::function<Fn> f = tf;
+ assert(f.template target<TestFn>() == nullptr);
+ }
+ { // Check that the non-null value is detected.
+ TestFn tf = Creator<TestFn>::create();
+ assert(tf != nullptr);
+ std::function<Fn> f = tf;
+ assert(f.template target<TestFn>() != nullptr);
+ assert(*f.template target<TestFn>() == tf);
+ }
+}
+
+void test_func() {
+ test_imp<int(*)(), int()>();
+ test_imp<int(*)(...), int()>();
+ test_imp<int(*)(int), int(int)>();
+ test_imp<int(*)(int, ...), int(int)>();
+ test_imp<int(*)(int, int), int(int, int)>();
+ test_imp<int(*)(int, int, ...), int(int, int)>();
+ test_imp<int(*)(int, int, int), int(int, int, int)>();
+ test_imp<int(*)(int, int, int, ...), int(int, int, int)>();
+}
+
+void test_mf() {
+ test_imp<int(MemFun03::*)(), int(MemFun03&)>();
+ test_imp<int(MemFun03::*)(...), int(MemFun03&)>();
+ test_imp<int(MemFun03::*)() const, int(MemFun03&)>();
+ test_imp<int(MemFun03::*)(...) const, int(MemFun03&)>();
+ test_imp<int(MemFun03::*)() volatile, int(MemFun03&)>();
+ test_imp<int(MemFun03::*)(...) volatile, int(MemFun03&)>();
+ test_imp<int(MemFun03::*)() const volatile, int(MemFun03&)>();
+ test_imp<int(MemFun03::*)(...) const volatile, int(MemFun03&)>();
+
+ test_imp<int(MemFun03::*)(int), int(MemFun03&, int)>();
+ test_imp<int(MemFun03::*)(int, ...), int(MemFun03&, int)>();
+ test_imp<int(MemFun03::*)(int) const, int(MemFun03&, int)>();
+ test_imp<int(MemFun03::*)(int, ...) const, int(MemFun03&, int)>();
+ test_imp<int(MemFun03::*)(int) volatile, int(MemFun03&, int)>();
+ test_imp<int(MemFun03::*)(int, ...) volatile, int(MemFun03&, int)>();
+ test_imp<int(MemFun03::*)(int) const volatile, int(MemFun03&, int)>();
+ test_imp<int(MemFun03::*)(int, ...) const volatile, int(MemFun03&, int)>();
+
+ test_imp<int(MemFun03::*)(int, int), int(MemFun03&, int, int)>();
+ test_imp<int(MemFun03::*)(int, int, ...), int(MemFun03&, int, int)>();
+ test_imp<int(MemFun03::*)(int, int) const, int(MemFun03&, int, int)>();
+ test_imp<int(MemFun03::*)(int, int, ...) const, int(MemFun03&, int, int)>();
+ test_imp<int(MemFun03::*)(int, int) volatile, int(MemFun03&, int, int)>();
+ test_imp<int(MemFun03::*)(int, int, ...) volatile, int(MemFun03&, int, int)>();
+ test_imp<int(MemFun03::*)(int, int) const volatile, int(MemFun03&, int, int)>();
+ test_imp<int(MemFun03::*)(int, int, ...) const volatile, int(MemFun03&, int, int)>();
+
+#if TEST_STD_VER >= 11
+ test_imp<int(MemFun11::*)() &, int(MemFun11&)>();
+ test_imp<int(MemFun11::*)(...) &, int(MemFun11&)>();
+ test_imp<int(MemFun11::*)() const &, int(MemFun11&)>();
+ test_imp<int(MemFun11::*)(...) const &, int(MemFun11&)>();
+ test_imp<int(MemFun11::*)() volatile &, int(MemFun11&)>();
+ test_imp<int(MemFun11::*)(...) volatile &, int(MemFun11&)>();
+ test_imp<int(MemFun11::*)() const volatile &, int(MemFun11&)>();
+ test_imp<int(MemFun11::*)(...) const volatile &, int(MemFun11&)>();
+
+ test_imp<int(MemFun11::*)() &&, int(MemFun11&&)>();
+ test_imp<int(MemFun11::*)(...) &&, int(MemFun11&&)>();
+ test_imp<int(MemFun11::*)() const &&, int(MemFun11&&)>();
+ test_imp<int(MemFun11::*)(...) const &&, int(MemFun11&&)>();
+ test_imp<int(MemFun11::*)() volatile &&, int(MemFun11&&)>();
+ test_imp<int(MemFun11::*)(...) volatile &&, int(MemFun11&&)>();
+ test_imp<int(MemFun11::*)() const volatile &&, int(MemFun11&&)>();
+ test_imp<int(MemFun11::*)(...) const volatile &&, int(MemFun11&&)>();
+#endif
+}
+
+void test_md() {
+ test_imp<int MemData::*, int(MemData&)>();
+}
+
+int main() {
+ test_func();
+ test_mf();
+ test_md();
+}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp
index 6dcd2857452c..61eda7244d3b 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp
@@ -30,13 +30,13 @@ test_int_1()
{
// member data pointer
{
- int A_int_1::*fp = &A_int_1::data_;
- A_int_1 a;
- std::function<int& (const A_int_1*)> r2(fp);
- const A_int_1* ap = &a;
- assert(r2(ap) == 6);
- r2(ap) = 7;
- assert(r2(ap) == 7);
+ int A_int_1::*fp = &A_int_1::data_;
+ A_int_1 a;
+ std::function<int& (const A_int_1*)> r2(fp);
+ const A_int_1* ap = &a;
+ assert(r2(ap) == 6);
+ r2(ap) = 7;
+ assert(r2(ap) == 7);
}
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp
index 31b80c3323c1..cc4315c14422 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp
@@ -16,8 +16,85 @@
#include <functional>
#include <cassert>
+
int count = 0;
+
+// 0 args, return int
+
+int f_int_0()
+{
+ return 3;
+}
+
+struct A_int_0
+{
+ int operator()() {return 4;}
+};
+
+void test_int_0()
+{
+ // function
+ {
+ std::function<int ()> r1(f_int_0);
+ assert(r1() == 3);
+ }
+ // function pointer
+ {
+ int (*fp)() = f_int_0;
+ std::function<int ()> r1(fp);
+ assert(r1() == 3);
+ }
+ // functor
+ {
+ A_int_0 a0;
+ std::function<int ()> r1(a0);
+ assert(r1() == 4);
+ }
+}
+
+
+// 0 args, return void
+
+void f_void_0()
+{
+ ++count;
+}
+
+struct A_void_0
+{
+ void operator()() {++count;}
+};
+
+void
+test_void_0()
+{
+ int save_count = count;
+ // function
+ {
+ std::function<void ()> r1(f_void_0);
+ r1();
+ assert(count == save_count+1);
+ save_count = count;
+ }
+ // function pointer
+ {
+ void (*fp)() = f_void_0;
+ std::function<void ()> r1(fp);
+ r1();
+ assert(count == save_count+1);
+ save_count = count;
+ }
+ // functor
+ {
+ A_void_0 a0;
+ std::function<void ()> r1(a0);
+ r1();
+ assert(count == save_count+1);
+ save_count = count;
+ }
+}
+
// 1 arg, return void
void f_void_1(int i)
@@ -42,57 +119,57 @@ test_void_1()
int save_count = count;
// function
{
- std::function<void (int)> r1(f_void_1);
- int i = 2;
- r1(i);
- assert(count == save_count+2);
- save_count = count;
+ std::function<void (int)> r1(f_void_1);
+ int i = 2;
+ r1(i);
+ assert(count == save_count+2);
+ save_count = count;
}
// function pointer
{
- void (*fp)(int) = f_void_1;
- std::function<void (int)> r1(fp);
- int i = 3;
- r1(i);
- assert(count == save_count+3);
- save_count = count;
+ void (*fp)(int) = f_void_1;
+ std::function<void (int)> r1(fp);
+ int i = 3;
+ r1(i);
+ assert(count == save_count+3);
+ save_count = count;
}
// functor
{
- A_void_1 a0;
- std::function<void (int)> r1(a0);
- int i = 4;
- r1(i);
- assert(count == save_count+4);
- save_count = count;
+ A_void_1 a0;
+ std::function<void (int)> r1(a0);
+ int i = 4;
+ r1(i);
+ assert(count == save_count+4);
+ save_count = count;
}
// member function pointer
{
- void (A_void_1::*fp)() = &A_void_1::mem1;
- std::function<void (A_void_1)> r1(fp);
- A_void_1 a;
- r1(a);
- assert(count == save_count+1);
- save_count = count;
- A_void_1* ap = &a;
- std::function<void (A_void_1*)> r2 = fp;
- r2(ap);
- assert(count == save_count+1);
- save_count = count;
+ void (A_void_1::*fp)() = &A_void_1::mem1;
+ std::function<void (A_void_1)> r1(fp);
+ A_void_1 a;
+ r1(a);
+ assert(count == save_count+1);
+ save_count = count;
+ A_void_1* ap = &a;
+ std::function<void (A_void_1*)> r2 = fp;
+ r2(ap);
+ assert(count == save_count+1);
+ save_count = count;
}
// const member function pointer
{
- void (A_void_1::*fp)() const = &A_void_1::mem2;
- std::function<void (A_void_1)> r1(fp);
- A_void_1 a;
- r1(a);
- assert(count == save_count+1);
- save_count = count;
- std::function<void (A_void_1*)> r2(fp);
- A_void_1* ap = &a;
- r2(ap);
- assert(count == save_count+1);
- save_count = count;
+ void (A_void_1::*fp)() const = &A_void_1::mem2;
+ std::function<void (A_void_1)> r1(fp);
+ A_void_1 a;
+ r1(a);
+ assert(count == save_count+1);
+ save_count = count;
+ std::function<void (A_void_1*)> r2(fp);
+ A_void_1* ap = &a;
+ r2(ap);
+ assert(count == save_count+1);
+ save_count = count;
}
}
@@ -121,57 +198,57 @@ test_int_1()
{
// function
{
- std::function<int (int)> r1(f_int_1);
- int i = 2;
- assert(r1(i) == 3);
+ std::function<int (int)> r1(f_int_1);
+ int i = 2;
+ assert(r1(i) == 3);
}
// function pointer
{
- int (*fp)(int) = f_int_1;
- std::function<int (int)> r1(fp);
- int i = 3;
- assert(r1(i) == 4);
+ int (*fp)(int) = f_int_1;
+ std::function<int (int)> r1(fp);
+ int i = 3;
+ assert(r1(i) == 4);
}
// functor
{
- A_int_1 a0;
- std::function<int (int)> r1(a0);
- int i = 4;
- assert(r1(i) == 3);
+ A_int_1 a0;
+ std::function<int (int)> r1(a0);
+ int i = 4;
+ assert(r1(i) == 3);
}
// member function pointer
{
- int (A_int_1::*fp)() = &A_int_1::mem1;
- std::function<int (A_int_1)> r1(fp);
- A_int_1 a;
- assert(r1(a) == 3);
- std::function<int (A_int_1*)> r2(fp);
- A_int_1* ap = &a;
- assert(r2(ap) == 3);
+ int (A_int_1::*fp)() = &A_int_1::mem1;
+ std::function<int (A_int_1)> r1(fp);
+ A_int_1 a;
+ assert(r1(a) == 3);
+ std::function<int (A_int_1*)> r2(fp);
+ A_int_1* ap = &a;
+ assert(r2(ap) == 3);
}
// const member function pointer
{
- int (A_int_1::*fp)() const = &A_int_1::mem2;
- std::function<int (A_int_1)> r1(fp);
- A_int_1 a;
- assert(r1(a) == 4);
- std::function<int (A_int_1*)> r2(fp);
- A_int_1* ap = &a;
- assert(r2(ap) == 4);
+ int (A_int_1::*fp)() const = &A_int_1::mem2;
+ std::function<int (A_int_1)> r1(fp);
+ A_int_1 a;
+ assert(r1(a) == 4);
+ std::function<int (A_int_1*)> r2(fp);
+ A_int_1* ap = &a;
+ assert(r2(ap) == 4);
}
// member data pointer
{
- int A_int_1::*fp = &A_int_1::data_;
- std::function<int& (A_int_1&)> r1(fp);
- A_int_1 a;
- assert(r1(a) == 5);
- r1(a) = 6;
- assert(r1(a) == 6);
- std::function<int& (A_int_1*)> r2(fp);
- A_int_1* ap = &a;
- assert(r2(ap) == 6);
- r2(ap) = 7;
- assert(r2(ap) == 7);
+ int A_int_1::*fp = &A_int_1::data_;
+ std::function<int& (A_int_1&)> r1(fp);
+ A_int_1 a;
+ assert(r1(a) == 5);
+ r1(a) = 6;
+ assert(r1(a) == 6);
+ std::function<int& (A_int_1*)> r2(fp);
+ A_int_1* ap = &a;
+ assert(r2(ap) == 6);
+ r2(ap) = 7;
+ assert(r2(ap) == 7);
}
}
@@ -199,62 +276,62 @@ test_void_2()
int save_count = count;
// function
{
- std::function<void (int, int)> r1(f_void_2);
- int i = 2;
- int j = 3;
- r1(i, j);
- assert(count == save_count+5);
- save_count = count;
+ std::function<void (int, int)> r1(f_void_2);
+ int i = 2;
+ int j = 3;
+ r1(i, j);
+ assert(count == save_count+5);
+ save_count = count;
}
// function pointer
{
- void (*fp)(int, int) = f_void_2;
- std::function<void (int, int)> r1(fp);
- int i = 3;
- int j = 4;
- r1(i, j);
- assert(count == save_count+7);
- save_count = count;
+ void (*fp)(int, int) = f_void_2;
+ std::function<void (int, int)> r1(fp);
+ int i = 3;
+ int j = 4;
+ r1(i, j);
+ assert(count == save_count+7);
+ save_count = count;
}
// functor
{
- A_void_2 a0;
- std::function<void (int, int)> r1(a0);
- int i = 4;
- int j = 5;
- r1(i, j);
- assert(count == save_count+9);
- save_count = count;
+ A_void_2 a0;
+ std::function<void (int, int)> r1(a0);
+ int i = 4;
+ int j = 5;
+ r1(i, j);
+ assert(count == save_count+9);
+ save_count = count;
}
// member function pointer
{
- void (A_void_2::*fp)(int) = &A_void_2::mem1;
- std::function<void (A_void_2, int)> r1(fp);
- A_void_2 a;
- int i = 3;
- r1(a, i);
- assert(count == save_count+3);
- save_count = count;
- std::function<void (A_void_2*, int)> r2(fp);
- A_void_2* ap = &a;
- r2(ap, i);
- assert(count == save_count+3);
- save_count = count;
+ void (A_void_2::*fp)(int) = &A_void_2::mem1;
+ std::function<void (A_void_2, int)> r1(fp);
+ A_void_2 a;
+ int i = 3;
+ r1(a, i);
+ assert(count == save_count+3);
+ save_count = count;
+ std::function<void (A_void_2*, int)> r2(fp);
+ A_void_2* ap = &a;
+ r2(ap, i);
+ assert(count == save_count+3);
+ save_count = count;
}
// const member function pointer
{
- void (A_void_2::*fp)(int) const = &A_void_2::mem2;
- std::function<void (A_void_2, int)> r1(fp);
- A_void_2 a;
- int i = 4;
- r1(a, i);
- assert(count == save_count+4);
- save_count = count;
- std::function<void (A_void_2*, int)> r2(fp);
- A_void_2* ap = &a;
- r2(ap, i);
- assert(count == save_count+4);
- save_count = count;
+ void (A_void_2::*fp)(int) const = &A_void_2::mem2;
+ std::function<void (A_void_2, int)> r1(fp);
+ A_void_2 a;
+ int i = 4;
+ r1(a, i);
+ assert(count == save_count+4);
+ save_count = count;
+ std::function<void (A_void_2*, int)> r2(fp);
+ A_void_2* ap = &a;
+ r2(ap, i);
+ assert(count == save_count+4);
+ save_count = count;
}
}
@@ -276,60 +353,61 @@ struct A_int_2
int mem2(int i) const {return i+2;}
};
-void
-testint_2()
+void test_int_2()
{
// function
{
- std::function<int (int, int)> r1(f_int_2);
- int i = 2;
- int j = 3;
- assert(r1(i, j) == i+j);
+ std::function<int (int, int)> r1(f_int_2);
+ int i = 2;
+ int j = 3;
+ assert(r1(i, j) == i+j);
}
// function pointer
{
- int (*fp)(int, int) = f_int_2;
- std::function<int (int, int)> r1(fp);
- int i = 3;
- int j = 4;
- assert(r1(i, j) == i+j);
+ int (*fp)(int, int) = f_int_2;
+ std::function<int (int, int)> r1(fp);
+ int i = 3;
+ int j = 4;
+ assert(r1(i, j) == i+j);
}
// functor
{
- A_int_2 a0;
- std::function<int (int, int)> r1(a0);
- int i = 4;
- int j = 5;
- assert(r1(i, j) == i+j);
+ A_int_2 a0;
+ std::function<int (int, int)> r1(a0);
+ int i = 4;
+ int j = 5;
+ assert(r1(i, j) == i+j);
}
// member function pointer
{
- int(A_int_2::*fp)(int) = &A_int_2::mem1;
- std::function<int (A_int_2, int)> r1(fp);
- A_int_2 a;
- int i = 3;
- assert(r1(a, i) == i+1);
- std::function<int (A_int_2*, int)> r2(fp);
- A_int_2* ap = &a;
- assert(r2(ap, i) == i+1);
+ int(A_int_2::*fp)(int) = &A_int_2::mem1;
+ std::function<int (A_int_2, int)> r1(fp);
+ A_int_2 a;
+ int i = 3;
+ assert(r1(a, i) == i+1);
+ std::function<int (A_int_2*, int)> r2(fp);
+ A_int_2* ap = &a;
+ assert(r2(ap, i) == i+1);
}
// const member function pointer
{
- int (A_int_2::*fp)(int) const = &A_int_2::mem2;
- std::function<int (A_int_2, int)> r1(fp);
- A_int_2 a;
- int i = 4;
- assert(r1(a, i) == i+2);
- std::function<int (A_int_2*, int)> r2(fp);
- A_int_2* ap = &a;
- assert(r2(ap, i) == i+2);
+ int (A_int_2::*fp)(int) const = &A_int_2::mem2;
+ std::function<int (A_int_2, int)> r1(fp);
+ A_int_2 a;
+ int i = 4;
+ assert(r1(a, i) == i+2);
+ std::function<int (A_int_2*, int)> r2(fp);
+ A_int_2* ap = &a;
+ assert(r2(ap, i) == i+2);
}
}
int main()
{
+ test_void_0();
+ test_int_0();
test_void_1();
test_int_1();
test_void_2();
- testint_2();
+ test_int_2();
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_int_0.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_int_0.pass.cpp
deleted file mode 100644
index 67b4ec22da8c..000000000000
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_int_0.pass.cpp
+++ /dev/null
@@ -1,58 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// class function<R(ArgTypes...)>
-
-// R operator()(ArgTypes... args) const
-
-#include <functional>
-#include <cassert>
-
-// 0 args, return int
-
-int count = 0;
-
-int f_int_0()
-{
- return 3;
-}
-
-struct A_int_0
-{
- int operator()() {return 4;}
-};
-
-void
-test_int_0()
-{
- // function
- {
- std::function<int ()> r1(f_int_0);
- assert(r1() == 3);
- }
- // function pointer
- {
- int (*fp)() = f_int_0;
- std::function<int ()> r1(fp);
- assert(r1() == 3);
- }
- // functor
- {
- A_int_0 a0;
- std::function<int ()> r1(a0);
- assert(r1() == 4);
- }
-}
-
-int main()
-{
- test_int_0();
-}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_no_variadics.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_no_variadics.pass.cpp
deleted file mode 100644
index c0a14fd96fcb..000000000000
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_no_variadics.pass.cpp
+++ /dev/null
@@ -1,60 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// class function<R()>
-
-// Test that we properly return both values and void for all non-variadic
-// overloads of function::operator()(...)
-
-#define _LIBCPP_HAS_NO_VARIADICS
-#include <functional>
-#include <cassert>
-
-int foo0() { return 42; }
-int foo1(int) { return 42; }
-int foo2(int, int) { return 42; }
-int foo3(int, int, int) { return 42; }
-
-int main()
-{
- {
- std::function<int()> f(&foo0);
- assert(f() == 42);
- }
- {
- std::function<int(int)> f(&foo1);
- assert(f(1) == 42);
- }
- {
- std::function<int(int, int)> f(&foo2);
- assert(f(1, 1) == 42);
- }
- {
- std::function<int(int, int, int)> f(&foo3);
- assert(f(1, 1, 1) == 42);
- }
- {
- std::function<void()> f(&foo0);
- f();
- }
- {
- std::function<void(int)> f(&foo1);
- f(1);
- }
- {
- std::function<void(int, int)> f(&foo2);
- f(1, 1);
- }
- {
- std::function<void(int, int, int)> f(&foo3);
- f(1, 1, 1);
- }
-}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_void_0.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_void_0.pass.cpp
deleted file mode 100644
index a820cb1b8f38..000000000000
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_void_0.pass.cpp
+++ /dev/null
@@ -1,67 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// class function<R(ArgTypes...)>
-
-// R operator()(ArgTypes... args) const
-
-#include <functional>
-#include <new>
-#include <cstdlib>
-#include <cassert>
-
-// 0 args, return void
-
-int count = 0;
-
-void f_void_0()
-{
- ++count;
-}
-
-struct A_void_0
-{
- void operator()() {++count;}
-};
-
-void
-test_void_0()
-{
- int save_count = count;
- // function
- {
- std::function<void ()> r1(f_void_0);
- r1();
- assert(count == save_count+1);
- save_count = count;
- }
- // function pointer
- {
- void (*fp)() = f_void_0;
- std::function<void ()> r1(fp);
- r1();
- assert(count == save_count+1);
- save_count = count;
- }
- // functor
- {
- A_void_0 a0;
- std::function<void ()> r1(a0);
- r1();
- assert(count == save_count+1);
- save_count = count;
- }
-}
-
-int main()
-{
- test_void_0();
-}
diff --git a/test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.fail.cpp b/test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.fail.cpp
index ba46946aae1b..a2316063cec6 100644
--- a/test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.fail.cpp
+++ b/test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.fail.cpp
@@ -13,6 +13,8 @@
// reference_wrapper(T&&) = delete;
+// XFAIL: c++98, c++03
+
#include <functional>
#include <cassert>
diff --git a/test/std/utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp b/test/std/utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp
index 86a5696f48ca..0aad4986a1f8 100644
--- a/test/std/utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp
+++ b/test/std/utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp
@@ -15,6 +15,8 @@
// Don't allow binding to a temp
+// XFAIL: c++98, c++03
+
#include <functional>
struct A {};
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 7cd9f15e93d1..d3db45fad7c0 100644
--- a/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
+++ b/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
@@ -57,4 +57,44 @@ int main()
test<unsigned long>();
test<long long>();
test<unsigned long long>();
+
+// LWG #2119
+ test<ptrdiff_t>();
+ test<size_t>();
+
+ test<int8_t>();
+ test<int16_t>();
+ test<int32_t>();
+ test<int64_t>();
+
+ test<int_fast8_t>();
+ test<int_fast16_t>();
+ test<int_fast32_t>();
+ test<int_fast64_t>();
+
+ test<int_least8_t>();
+ test<int_least16_t>();
+ test<int_least32_t>();
+ test<int_least64_t>();
+
+ test<intmax_t>();
+ test<intptr_t>();
+
+ test<uint8_t>();
+ test<uint16_t>();
+ test<uint32_t>();
+ test<uint64_t>();
+
+ test<uint_fast8_t>();
+ test<uint_fast16_t>();
+ test<uint_fast32_t>();
+ test<uint_fast64_t>();
+
+ test<uint_least8_t>();
+ test<uint_least16_t>();
+ test<uint_least32_t>();
+ test<uint_least64_t>();
+
+ test<uintmax_t>();
+ test<uintptr_t>();
}
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 2dd6c17b3dee..af4a3c4dfe7f 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
@@ -12,19 +12,23 @@
// template<class T, T N>
// using make_integer_sequence = integer_sequence<T, 0, 1, ..., N-1>;
+// UNSUPPORTED: c++98, c++03, c++11
+
#include <utility>
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
-#if _LIBCPP_STD_VER > 11
-
- std::make_integer_sequence<int, -3>::value_type i;
+ typedef std::make_integer_sequence<int, -3> MakeSeqT;
+ // std::make_integer_sequence is implemented using a compiler builtin if available.
+ // this builtin has different diagnostic messages than the fallback implementation.
+#if TEST_HAS_BUILTIN(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
+ MakeSeqT i; // expected-error@utility:* {{integer sequences must have non-negative sequence length}}
#else
-
-X
-
-#endif // _LIBCPP_STD_VER > 11
+ MakeSeqT i; // expected-error@utility:* {{static_assert failed "std::make_integer_sequence must have a non-negative sequence length"}}
+#endif
}
diff --git a/test/std/utilities/intseq/intseq.make/make_integer_seq.pass.cpp b/test/std/utilities/intseq/intseq.make/make_integer_seq.pass.cpp
index 7e82b94a7da0..9bfc5f3d9d70 100644
--- a/test/std/utilities/intseq/intseq.make/make_integer_seq.pass.cpp
+++ b/test/std/utilities/intseq/intseq.make/make_integer_seq.pass.cpp
@@ -12,14 +12,14 @@
// template<class T, T N>
// using make_integer_sequence = integer_sequence<T, 0, 1, ..., N-1>;
+// UNSUPPORTED: c++98, c++03, c++11
+
#include <utility>
#include <type_traits>
#include <cassert>
int main()
{
-#if _LIBCPP_STD_VER > 11
-
static_assert(std::is_same<std::make_integer_sequence<int, 0>, std::integer_sequence<int>>::value, "");
static_assert(std::is_same<std::make_integer_sequence<int, 1>, std::integer_sequence<int, 0>>::value, "");
static_assert(std::is_same<std::make_integer_sequence<int, 2>, std::integer_sequence<int, 0, 1>>::value, "");
@@ -29,6 +29,4 @@ int main()
static_assert(std::is_same<std::make_integer_sequence<unsigned long long, 1>, std::integer_sequence<unsigned long long, 0>>::value, "");
static_assert(std::is_same<std::make_integer_sequence<unsigned long long, 2>, std::integer_sequence<unsigned long long, 0, 1>>::value, "");
static_assert(std::is_same<std::make_integer_sequence<unsigned long long, 3>, std::integer_sequence<unsigned long long, 0, 1, 2>>::value, "");
-
-#endif // _LIBCPP_STD_VER > 11
}
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
new file mode 100644
index 000000000000..b6431b56d5f0
--- /dev/null
+++ b/test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.fail.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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 T, T N>
+// using make_integer_sequence = integer_sequence<T, 0, 1, ..., N-1>;
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+#define _LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE
+#include "make_integer_seq.fail.cpp"
diff --git a/test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.pass.cpp b/test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.pass.cpp
new file mode 100644
index 000000000000..c75d20b11af3
--- /dev/null
+++ b/test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.pass.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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 T, T N>
+// using make_integer_sequence = integer_sequence<T, 0, 1, ..., N-1>;
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+#define _LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE
+#include "make_integer_seq.pass.cpp"
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 1fa7291203ed..352c7c8d0caf 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
@@ -45,12 +45,12 @@ int main()
{
A<int> a;
assert(std::allocator_traits<A<int> >::max_size(a) ==
- std::numeric_limits<std::size_t>::max());
+ std::numeric_limits<std::size_t>::max() / sizeof(int));
}
{
const A<int> a = {};
assert(std::allocator_traits<A<int> >::max_size(a) ==
- std::numeric_limits<std::size_t>::max());
+ std::numeric_limits<std::size_t>::max() / sizeof(int));
}
#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
{
diff --git a/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp
index d0a870e60690..28dadd831514 100644
--- a/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp
+++ b/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp
@@ -15,6 +15,7 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
#include "count_new.hpp"
int A_constructed = 0;
@@ -34,30 +35,24 @@ struct A
int move_only_constructed = 0;
+#if TEST_STD_VER >= 11
class move_only
{
- int data;
-#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
+ move_only(const move_only&) = delete;
+ move_only& operator=(const move_only&)= delete;
public:
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
move_only(move_only&&) {++move_only_constructed;}
move_only& operator=(move_only&&) {return *this;}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- operator std::__rv<move_only> () {return std::__rv<move_only>(*this);}
- move_only(std::__rv<move_only>) {++move_only_constructed;}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
move_only() {++move_only_constructed;}
~move_only() {--move_only_constructed;}
+
+public:
+ int data; // unused other than to make sizeof(move_only) == sizeof(int).
+ // but public to suppress "-Wunused-private-field"
};
+#endif // TEST_STD_VER >= 11
int main()
{
@@ -108,6 +103,7 @@ int main()
assert(globalMemCounter.checkOutstandingNewEq(0));
assert(A_constructed == 0);
}
+#if TEST_STD_VER >= 11
{
std::allocator<move_only> a;
assert(globalMemCounter.checkOutstandingNewEq(0));
@@ -139,4 +135,5 @@ int main()
assert(globalMemCounter.checkOutstandingNewEq(0));
assert(move_only_constructed == 0);
}
+#endif
}
diff --git a/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp
index 6ec9339bc48f..10109383b0c7 100644
--- a/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp
+++ b/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp
@@ -22,6 +22,6 @@ int new_called = 0;
int main()
{
const std::allocator<int> a;
- std::size_t M = a.max_size() * sizeof(int);
- assert(M > 0xFFFF && M <= std::numeric_limits<std::size_t>::max());
+ std::size_t M = a.max_size();
+ assert(M > 0xFFFF && M <= (std::numeric_limits<std::size_t>::max() / sizeof(int)));
}
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 f431335db732..8bb818319a37 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <memory>
// template <class InputIterator, class ForwardIterator>
@@ -20,13 +21,15 @@
struct B
{
static int count_;
+ static int population_;
int data_;
- explicit B() : data_(1) {}
- B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_;}
- ~B() {data_ = 0;}
+ explicit B() : data_(1) { ++population_; }
+ B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_; ++population_; }
+ ~B() {data_ = 0; --population_; }
};
int B::count_ = 0;
+int B::population_ = 0;
struct Nasty
{
@@ -45,6 +48,7 @@ int main()
char pool[sizeof(B)*N] = {0};
B* bp = (B*)pool;
B b[N];
+ assert(B::population_ == N);
try
{
std::uninitialized_copy(b, b+N, bp);
@@ -52,14 +56,15 @@ int main()
}
catch (...)
{
- for (int i = 0; i < N; ++i)
- assert(bp[i].data_ == 0);
+ assert(B::population_ == N);
}
B::count_ = 0;
std::uninitialized_copy(b, b+2, bp);
for (int i = 0; i < 2; ++i)
assert(bp[i].data_ == 1);
+ assert(B::population_ == N + 2);
}
+
{
const int N = 5;
char pool[sizeof(Nasty)*N] = {0};
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 3b2007b969c3..ae438ef7d561 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <memory>
// template <class InputIterator, class Size, class ForwardIterator>
@@ -20,12 +21,14 @@
struct B
{
static int count_;
+ static int population_;
int data_;
- explicit B() : data_(1) {}
- B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_;}
- ~B() {data_ = 0;}
+ explicit B() : data_(1) { ++population_; }
+ B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_; ++population_; }
+ ~B() {data_ = 0; --population_; }
};
+int B::population_ = 0;
int B::count_ = 0;
struct Nasty
@@ -45,6 +48,7 @@ int main()
char pool[sizeof(B)*N] = {0};
B* bp = (B*)pool;
B b[N];
+ assert(B::population_ == N);
try
{
std::uninitialized_copy_n(b, 5, bp);
@@ -52,14 +56,15 @@ int main()
}
catch (...)
{
- for (int i = 0; i < N; ++i)
- assert(bp[i].data_ == 0);
+ assert(B::population_ == N);
}
B::count_ = 0;
std::uninitialized_copy_n(b, 2, bp);
for (int i = 0; i < 2; ++i)
assert(bp[i].data_ == 1);
+ assert(B::population_ == N + 2);
}
+
{
const int N = 5;
char pool[sizeof(Nasty)*N] = {0};
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 d2b1dfa28868..22aa8b98b8c9 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <memory>
// template <class ForwardIterator, class Size, class T>
@@ -19,13 +20,15 @@
struct B
{
static int count_;
+ static int population_;
int data_;
- explicit B() : data_(1) {}
- B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_;}
- ~B() {data_ = 0;}
+ explicit B() : data_(1) { ++population_; }
+ B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_; ++population_; }
+ ~B() {data_ = 0; --population_; }
};
int B::count_ = 0;
+int B::population_ = 0;
struct Nasty
{
@@ -43,6 +46,7 @@ int main()
const int N = 5;
char pool[sizeof(B)*N] = {0};
B* bp = (B*)pool;
+ assert(B::population_ == 0);
try
{
std::uninitialized_fill_n(bp, 5, B());
@@ -50,14 +54,14 @@ int main()
}
catch (...)
{
- for (int i = 0; i < N; ++i)
- assert(bp[i].data_ == 0);
+ assert(B::population_ == 0);
}
B::count_ = 0;
B* r = std::uninitialized_fill_n(bp, 2, B());
assert(r == bp + 2);
for (int i = 0; i < 2; ++i)
assert(bp[i].data_ == 1);
+ assert(B::population_ == 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 47cabdfa478a..95c45dd50541 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <memory>
// template <class ForwardIterator, class T>
@@ -20,13 +21,15 @@
struct B
{
static int count_;
+ static int population_;
int data_;
- explicit B() : data_(1) {}
- B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_;}
- ~B() {data_ = 0;}
+ explicit B() : data_(1) { ++population_; }
+ B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_; ++population_; }
+ ~B() {data_ = 0; --population_; }
};
int B::count_ = 0;
+int B::population_ = 0;
struct Nasty
{
@@ -44,6 +47,7 @@ int main()
const int N = 5;
char pool[sizeof(B)*N] = {0};
B* bp = (B*)pool;
+ assert(B::population_ == 0);
try
{
std::uninitialized_fill(bp, bp+N, B());
@@ -51,13 +55,13 @@ int main()
}
catch (...)
{
- for (int i = 0; i < N; ++i)
- assert(bp[i].data_ == 0);
+ assert(B::population_ == 0);
}
B::count_ = 0;
std::uninitialized_fill(bp, bp+2, B());
for (int i = 0; i < 2; ++i)
assert(bp[i].data_ == 1);
+ assert(B::population_ == 2);
}
{
const int N = 5;
diff --git a/test/std/utilities/memory/storage.iterator/raw_storag_iterator.pass.cpp b/test/std/utilities/memory/storage.iterator/raw_storag_iterator.pass.cpp
index f77d6c75e17a..914802423ce7 100644
--- a/test/std/utilities/memory/storage.iterator/raw_storag_iterator.pass.cpp
+++ b/test/std/utilities/memory/storage.iterator/raw_storag_iterator.pass.cpp
@@ -13,6 +13,8 @@
#include <type_traits>
#include <cassert>
+#include <MoveOnly.h>
+
int A_constructed = 0;
struct A
@@ -29,16 +31,33 @@ public:
int main()
{
- typedef std::aligned_storage<3*sizeof(A), std::alignment_of<A>::value>::type
+ {
+ typedef A S;
+ typedef std::aligned_storage<3*sizeof(S), std::alignment_of<S>::value>::type
Storage;
Storage buffer;
- std::raw_storage_iterator<A*, A> it((A*)&buffer);
+ std::raw_storage_iterator<S*, S> it((S*)&buffer);
assert(A_constructed == 0);
for (int i = 0; i < 3; ++i)
{
- *it++ = A(i+1);
- A* ap = (A*)&buffer + i;
+ *it++ = S(i+1);
+ S* ap = (S*)&buffer + i;
assert(*ap == i+1);
assert(A_constructed == i+1);
}
+ }
+#if _LIBCPP_STD_VER >= 14
+ {
+ typedef MoveOnly S;
+ typedef std::aligned_storage<3*sizeof(S), std::alignment_of<S>::value>::type
+ Storage;
+ Storage buffer;
+ std::raw_storage_iterator<S*, S> it((S*)&buffer);
+ S m{1};
+ *it++ = std::move(m);
+ assert(m.get() == 0); // moved from
+ S *ap = (S*) &buffer;
+ assert(ap->get() == 1); // original value
+ }
+#endif
}
diff --git a/test/std/utilities/memory/unique.ptr/deleter.h b/test/std/utilities/memory/unique.ptr/deleter.h
index fb26044d98ff..1d8e19d5bc41 100644
--- a/test/std/utilities/memory/unique.ptr/deleter.h
+++ b/test/std/utilities/memory/unique.ptr/deleter.h
@@ -20,21 +20,19 @@
#include <utility>
#include <cassert>
+#include "test_macros.h"
+
+#if TEST_STD_VER >= 11
+
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)
{
@@ -42,22 +40,12 @@ 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_(0) {}
explicit Deleter(int s) : state_(s) {}
~Deleter() {assert(state_ >= 0); state_ = -1;}
-#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)
@@ -67,12 +55,6 @@ 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;}
@@ -85,16 +67,11 @@ class Deleter<T[]>
{
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)
{
@@ -102,16 +79,66 @@ 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;
+
+ Deleter() : state_(0) {}
+ explicit Deleter(int s) : state_(s) {}
+ ~Deleter() {assert(state_ >= 0); state_ = -1;}
+
+ int state() const {return state_;}
+ void set_state(int i) {state_ = i;}
+
+ void operator()(T* p) {delete [] p;}
+};
+
+#else // TEST_STD_VER < 11
+
+template <class T>
+class Deleter
+{
+ mutable int state_;
+
+public:
+ Deleter() : state_(0) {}
+ explicit Deleter(int s) : state_(s) {}
+
+ Deleter(Deleter const & other) : state_(other.state_) {
+ other.state_ = 0;
+ }
+ Deleter& operator=(Deleter const& other) {
+ state_ = other.state_;
+ other.state_ = 0;
+ return *this;
+ }
+
+ ~Deleter() {assert(state_ >= 0); state_ = -1;}
+
+ template <class U>
+ Deleter(Deleter<U> d,
+ typename std::enable_if<!std::is_same<U, T>::value>::type* = 0)
+ : state_(d.state()) {}
+
+public:
+ int state() const {return state_;}
+ void set_state(int i) {state_ = i;}
+
+ void operator()(T* p) {delete p;}
+};
+
+template <class T>
+class Deleter<T[]>
+{
+ mutable int state_;
+
+public:
+
+ Deleter(Deleter const& other) : state_(other.state_) {
+ other.state_ = 0;
+ }
+ Deleter& operator=(Deleter const& other) {
+ state_ = other.state_;
+ other.state_ = 0;
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Deleter() : state_(0) {}
explicit Deleter(int s) : state_(s) {}
@@ -123,6 +150,8 @@ public:
void operator()(T* p) {delete [] p;}
};
+#endif
+
template <class T>
void
swap(Deleter<T>& x, Deleter<T>& y)
@@ -132,6 +161,7 @@ swap(Deleter<T>& x, Deleter<T>& y)
y = std::move(t);
}
+
template <class T>
class CDeleter
{
@@ -179,4 +209,130 @@ swap(CDeleter<T>& x, CDeleter<T>& y)
y = std::move(t);
}
+// Non-copyable deleter
+template <class T>
+class NCDeleter
+{
+ int state_;
+ NCDeleter(NCDeleter const&);
+ NCDeleter& operator=(NCDeleter const&);
+public:
+
+ NCDeleter() : state_(0) {}
+ explicit NCDeleter(int s) : state_(s) {}
+ ~NCDeleter() {assert(state_ >= 0); state_ = -1;}
+
+ int state() const {return state_;}
+ void set_state(int i) {state_ = i;}
+
+ void operator()(T* p) {delete p;}
+};
+
+
+template <class T>
+class NCDeleter<T[]>
+{
+ int state_;
+ NCDeleter(NCDeleter const&);
+ NCDeleter& operator=(NCDeleter const&);
+public:
+
+ NCDeleter() : state_(0) {}
+ explicit NCDeleter(int s) : state_(s) {}
+ ~NCDeleter() {assert(state_ >= 0); state_ = -1;}
+
+ int state() const {return state_;}
+ void set_state(int i) {state_ = i;}
+
+ void operator()(T* p) {delete [] p;}
+};
+
+
+// Non-copyable deleter
+template <class T>
+class NCConstDeleter
+{
+ int state_;
+ NCConstDeleter(NCConstDeleter const&);
+ NCConstDeleter& operator=(NCConstDeleter const&);
+public:
+
+ NCConstDeleter() : state_(0) {}
+ explicit NCConstDeleter(int s) : state_(s) {}
+ ~NCConstDeleter() {assert(state_ >= 0); state_ = -1;}
+
+ int state() const {return state_;}
+ void set_state(int i) {state_ = i;}
+
+ void operator()(T* p) const {delete p;}
+};
+
+
+template <class T>
+class NCConstDeleter<T[]>
+{
+ int state_;
+ NCConstDeleter(NCConstDeleter const&);
+ NCConstDeleter& operator=(NCConstDeleter const&);
+public:
+
+ NCConstDeleter() : state_(0) {}
+ explicit NCConstDeleter(int s) : state_(s) {}
+ ~NCConstDeleter() {assert(state_ >= 0); state_ = -1;}
+
+ int state() const {return state_;}
+ void set_state(int i) {state_ = i;}
+
+ void operator()(T* p) const {delete [] p;}
+};
+
+
+// Non-copyable deleter
+template <class T>
+class CopyDeleter
+{
+ int state_;
+public:
+
+ CopyDeleter() : state_(0) {}
+ explicit CopyDeleter(int s) : state_(s) {}
+ ~CopyDeleter() {assert(state_ >= 0); state_ = -1;}
+
+ CopyDeleter(CopyDeleter const& other) : state_(other.state_) {}
+ CopyDeleter& operator=(CopyDeleter const& other) {
+ state_ = other.state_;
+ return *this;
+ }
+
+ int state() const {return state_;}
+ void set_state(int i) {state_ = i;}
+
+ void operator()(T* p) {delete p;}
+};
+
+
+template <class T>
+class CopyDeleter<T[]>
+{
+ int state_;
+
+public:
+
+ CopyDeleter() : state_(0) {}
+ explicit CopyDeleter(int s) : state_(s) {}
+ ~CopyDeleter() {assert(state_ >= 0); state_ = -1;}
+
+ CopyDeleter(CopyDeleter const& other) : state_(other.state_) {}
+ CopyDeleter& operator=(CopyDeleter const& other) {
+ state_ = other.state_;
+ return *this;
+ }
+
+ int state() const {return state_;}
+ void set_state(int i) {state_ = i;}
+
+ void operator()(T* p) {delete [] p;}
+};
+
+
#endif // DELETER_H
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp
index 17375ede00f5..ed94c1a1e470 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp
@@ -14,26 +14,15 @@
// Test unique_ptr move assignment
#include <memory>
-#include <utility>
-#include <cassert>
-// Can't copy from lvalue
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
+#include "test_macros.h"
int main()
{
- {
- std::unique_ptr<A> s(new A);
- std::unique_ptr<A> s2;
- s2 = s;
- }
+ std::unique_ptr<int> s, s2;
+#if TEST_STD_VER >= 11
+ s2 = s; // expected-error {{cannot be assigned because its copy assignment operator is implicitly deleted}}
+#else
+ s2 = s; // expected-error {{'operator=' is a private member of 'std::__1::unique_ptr}}
+#endif
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp
index 03747b4f89cf..5088a4410e79 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp
@@ -32,22 +32,6 @@ struct A
int A::count = 0;
-class NCDeleter
-{
- int state_;
-
- NCDeleter(NCDeleter&);
- NCDeleter& operator=(NCDeleter&);
-public:
-
- NCDeleter() : state_(5) {}
-
- int state() const {return state_;}
- void set_state(int s) {state_ = s;}
-
- void operator()(A* p) {delete [] p;}
-};
-
int main()
{
{
@@ -71,10 +55,10 @@ int main()
}
assert(A::count == 0);
{
- NCDeleter d;
- std::unique_ptr<A[], NCDeleter&> s(new A[3], d);
+ NCDeleter<A[]> d;
+ std::unique_ptr<A[], NCDeleter<A[]>&> s(new A[3], d);
A* p = s.get();
- std::unique_ptr<A[], NCDeleter&> s2 = std::move(s);
+ std::unique_ptr<A[], NCDeleter<A[]>&> s2 = std::move(s);
assert(s2.get() == p);
assert(s.get() == 0);
assert(A::count == 3);
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 ef821a915e44..5720d3bd288f 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
@@ -31,21 +31,6 @@ struct A
int A::count = 0;
-class NCDeleter
-{
- int state_;
-
- NCDeleter(NCDeleter&);
- NCDeleter& operator=(NCDeleter&);
-public:
-
- NCDeleter() : state_(5) {}
-
- int state() const {return state_;}
- void set_state(int s) {state_ = s;}
-
- void operator()(A* p) {delete [] p;}
-};
std::unique_ptr<A[]>
source1()
@@ -67,14 +52,14 @@ void sink2(std::unique_ptr<A[], Deleter<A[]> > p)
{
}
-std::unique_ptr<A[], NCDeleter&>
+std::unique_ptr<A[], NCDeleter<A[]>&>
source3()
{
- static NCDeleter d;
- return std::unique_ptr<A[], NCDeleter&>(new A[3], d);
+ static NCDeleter<A[]> d;
+ return std::unique_ptr<A[], NCDeleter<A[]>&>(new A[3], d);
}
-void sink3(std::unique_ptr<A[], NCDeleter&> p)
+void sink3(std::unique_ptr<A[], NCDeleter<A[]>&> p)
{
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp
index b635d507b2ec..9d3f94098a08 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: c++98, c++03
+
// <memory>
// unique_ptr
@@ -16,40 +18,16 @@
// unique_ptr<T, const D&>(pointer, D()) should not compile
#include <memory>
-#include <cassert>
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
class Deleter
{
- int state_;
-
public:
-
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
- void set_state(int s) {state_ = s;}
-
- void operator()(A* p) const {delete [] p;}
+ Deleter() {}
+ void operator()(int* p) const {delete [] p;}
};
int main()
{
- {
- A* p = new A[3];
- assert(A::count == 3);
- std::unique_ptr<A[], const Deleter&> s(p, Deleter());
- assert(s.get() == p);
- assert(s.get_deleter().state() == 5);
- }
- assert(A::count == 0);
+ int* p = nullptr;
+ std::unique_ptr<int[], const Deleter&> s(p, Deleter()); // expected-error@memory:* {{static_assert failed "rvalue deleter bound to reference"}}
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp
index 57724ae10a70..87cfb72ad6e0 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp
@@ -14,25 +14,16 @@
// Test unique_ptr move assignment
#include <memory>
-#include <cassert>
-// Can't copy from lvalue
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
+#include "test_macros.h"
+// Can't copy from lvalue
int main()
{
- {
- std::unique_ptr<A> s(new A);
- std::unique_ptr<A> s2;
- s2 = s;
- }
+ std::unique_ptr<int> s, s2;
+#if TEST_STD_VER >= 11
+ s2 = s; // expected-error {{cannot be assigned because its copy assignment operator is implicitly deleted}}
+#else
+ s2 = s; // expected-error {{'operator=' is a private member}}
+#endif
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp
index 5046fd8aae6b..9cea12b1249f 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp
@@ -14,25 +14,20 @@
// Test unique_ptr move assignment
#include <memory>
-#include <cassert>
-// Can't copy from const lvalue
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
+#include "test_macros.h"
-int A::count = 0;
+// Can't copy from const lvalue
int main()
{
- {
- const std::unique_ptr<A> s(new A);
- std::unique_ptr<A> s2;
- s2 = s;
- }
+ const std::unique_ptr<int> s(new int);
+ std::unique_ptr<int> s2;
+#if TEST_STD_VER >= 11
+ s2 = s; // expected-error {{cannot be assigned because its copy assignment operator is implicitly deleted}}
+#else
+ // NOTE: The error says "constructor" because the assignment operator takes
+ // 's' by value and attempts to copy construct it.
+ s2 = s; // expected-error {{no matching constructor for initialization}}
+#endif
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp
index aa4fdb8a96b1..05a057f9bb32 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp
@@ -14,43 +14,20 @@
// Test unique_ptr move assignment
#include <memory>
-#include <cassert>
-// Can't copy from lvalue
+#include "test_macros.h"
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
-
-class Deleter
-{
- int state_;
-
-public:
-
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
-
- void operator()(A* p) {delete p;}
+struct Deleter {
+ void operator()(int* p) {delete p;}
};
+// Can't copy from lvalue
int main()
{
- {
- std::unique_ptr<A, Deleter> s(new A);
- A* p = s.get();
- std::unique_ptr<A, Deleter> s2;
- s2 = s;
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- }
- assert(A::count == 0);
+ std::unique_ptr<int, Deleter> s, s2;
+#if TEST_STD_VER >= 11
+ s2 = s; // expected-error {{cannot be assigned because its copy assignment operator is implicitly deleted}}
+#else
+ s2 = s; // expected-error {{'operator=' is a private member}}
+#endif
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp
index e0d7c891c80f..24703ec98238 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp
@@ -11,46 +11,26 @@
// unique_ptr
-// Test unique_ptr move ctor
+// Test unique_ptr move assignment
#include <memory>
-#include <cassert>
-// test move ctor. Can't copy from const lvalue
+#include "test_macros.h"
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
-
-class Deleter
-{
- int state_;
-
-public:
-
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
-
- void operator()(A* p) {delete p;}
+struct Deleter {
+ void operator()(int* p) {delete p;}
};
+// Can't copy from a const lvalue
int main()
{
- {
- const std::unique_ptr<A, Deleter> s(new A);
- A* p = s.get();
- std::unique_ptr<A, Deleter> s2;
- s2 = s;
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- }
- assert(A::count == 0);
+ const std::unique_ptr<int, Deleter> s(new int);
+ std::unique_ptr<int, Deleter> s2;
+#if TEST_STD_VER >= 11
+ s2 = s; // expected-error {{cannot be assigned because its copy assignment operator is implicitly deleted}}
+#else
+ // NOTE: The error says "constructor" because the assignment operator takes
+ // 's' by value and attempts to copy construct it.
+ s2 = s; // expected-error {{no matching constructor for initialization}}
+#endif
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert.pass.cpp
new file mode 100644
index 000000000000..4c4a32035641
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert.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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "../../deleter.h"
+
+struct A
+{
+ static int count;
+ A() {++count;}
+ A(const A&) {++count;}
+ virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+ : public A
+{
+ static int count;
+ B() {++count;}
+ B(const B&) {++count;}
+ virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+
+template <class APtr, class BPtr>
+void testAssign(APtr& aptr, BPtr& bptr) {
+ A* p = bptr.get();
+ assert(A::count == 2);
+ aptr = std::move(bptr);
+ assert(aptr.get() == p);
+ assert(bptr.get() == 0);
+ assert(A::count == 1);
+ assert(B::count == 1);
+}
+
+template <class LHS, class RHS>
+void checkDeleter(LHS& lhs, RHS& rhs, int LHSState, int RHSState) {
+ assert(lhs.get_deleter().state() == LHSState);
+ assert(rhs.get_deleter().state() == RHSState);
+}
+
+int main()
+{
+ {
+ std::unique_ptr<B> bptr(new B);
+ std::unique_ptr<A> aptr(new A);
+ testAssign(aptr, bptr);
+ }
+ assert(A::count == 0);
+ assert(B::count == 0);
+ {
+ Deleter<B> del(42);
+ std::unique_ptr<B, Deleter<B> > bptr(new B, std::move(del));
+ std::unique_ptr<A, Deleter<A> > aptr(new A);
+ testAssign(aptr, bptr);
+ checkDeleter(aptr, bptr, 42, 0);
+ }
+ assert(A::count == 0);
+ assert(B::count == 0);
+ {
+ CDeleter<A> adel(6);
+ CDeleter<B> bdel(42);
+ std::unique_ptr<B, CDeleter<B>&> bptr(new B, bdel);
+ std::unique_ptr<A, CDeleter<A>&> aptr(new A, adel);
+ testAssign(aptr, bptr);
+ checkDeleter(aptr, bptr, 42, 42);
+ }
+ assert(A::count == 0);
+ assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp
index 3fd2cbc42bd6..816a598d9a23 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp
@@ -14,44 +14,29 @@
// Test unique_ptr converting move assignment
#include <memory>
-#include <utility>
-#include <cassert>
-// Can't assign from lvalue
+#include "test_macros.h"
struct A
{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
+ A() {}
+ virtual ~A() {}
};
-int A::count = 0;
-
-struct B
- : public A
+struct B : public A
{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
};
-int B::count = 0;
-
+// Can't assign from lvalue
int main()
{
- {
- std::unique_ptr<B> s(new B);
- A* p = s.get();
+ std::unique_ptr<B> s;
std::unique_ptr<A> s2;
- s2 = s;
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- assert(B::count == 1);
- }
- assert(A::count == 0);
- assert(B::count == 0);
+#if TEST_STD_VER >= 11
+ s2 = s; // expected-error {{no viable overloaded '='}}
+#else
+ // NOTE: The move-semantic emulation creates an ambiguous overload set
+ // so that assignment from an lvalue does not compile
+ s2 = s; // expected-error {{use of overloaded operator '=' is ambiguous}}
+#endif
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.pass.cpp
deleted file mode 100644
index 989f594e38b8..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move assignment
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
-};
-
-int A::count = 0;
-
-struct B
- : public A
-{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
-};
-
-int B::count = 0;
-
-int main()
-{
- {
- std::unique_ptr<B> s(new B);
- A* p = s.get();
- std::unique_ptr<A> s2(new A);
- assert(A::count == 2);
- s2 = std::move(s);
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- assert(B::count == 1);
- }
- assert(A::count == 0);
- assert(B::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp
index 0f900603e239..1ddf1d811651 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp
@@ -14,48 +14,30 @@
// Test unique_ptr converting move assignment
#include <memory>
-#include <utility>
-#include <cassert>
+#include "test_macros.h"
#include "../../deleter.h"
-// Can't assign from lvalue
-
struct A
{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
+ A() {}
+ virtual ~A() {}
};
-int A::count = 0;
-
-struct B
- : public A
+struct B : public A
{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
};
-int B::count = 0;
-
+// Can't assign from lvalue
int main()
{
- {
- std::unique_ptr<B, Deleter<B> > s(new B);
- A* p = s.get();
+ std::unique_ptr<B, Deleter<B> > s;
std::unique_ptr<A, Deleter<A> > s2;
- 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);
+#if TEST_STD_VER >= 11
+ s2 = s; // expected-error {{no viable overloaded '='}}
+#else
+ // NOTE: The move-semantic emulation creates an ambiguous overload set
+ // so that assignment from an lvalue does not compile
+ s2 = s; // expected-error {{use of overloaded operator '=' is ambiguous}}
+#endif
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.pass.cpp
deleted file mode 100644
index a448c77a66a7..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.pass.cpp
+++ /dev/null
@@ -1,60 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move assignment
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-#include "../../deleter.h"
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
-};
-
-int A::count = 0;
-
-struct B
- : public A
-{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
-};
-
-int B::count = 0;
-
-int main()
-{
- {
- std::unique_ptr<B, Deleter<B> > s(new B, Deleter<B>(5));
- A* p = s.get();
- std::unique_ptr<A, Deleter<A> > s2(new A);
- assert(A::count == 2);
- s2 = std::move(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);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp
index f35af9f453ff..570c1c42f4fe 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp
@@ -16,47 +16,32 @@
// Can't assign from lvalue
#include <memory>
-#include <utility>
-#include <cassert>
+#include "test_macros.h"
#include "../../deleter.h"
struct A
{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
+ A() {}
+ virtual ~A() {}
};
-int A::count = 0;
-
-struct B
- : public A
+struct B : public A
{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
};
-int B::count = 0;
-
+// Can't assign from lvalue
int main()
{
- {
- Deleter<B> db(5);
- std::unique_ptr<B, Deleter<B>&> s(new B, db);
- A* p = s.get();
- Deleter<A> da(6);
- std::unique_ptr<A, Deleter<A>&> s2(new A, da);
- 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(A::count == 0);
- assert(B::count == 0);
+ Deleter<B> db;
+ std::unique_ptr<B, Deleter<B>& > s(new B, db);
+ Deleter<A> da;
+ std::unique_ptr<A, Deleter<A> &> s2(new A, da);
+#if TEST_STD_VER >= 11
+ s2 = s; // expected-error {{no viable overloaded '='}}
+#else
+ // NOTE: The move-semantic emulation creates an ambiguous overload set
+ // so that assignment from an lvalue does not compile
+ s2 = s; // expected-error {{use of overloaded operator '=' is ambiguous}}
+#endif
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.pass.cpp
deleted file mode 100644
index 9aea81a8b144..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.pass.cpp
+++ /dev/null
@@ -1,63 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move assignment
-
-// test converting move assignment with reference deleters
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-#include "../../deleter.h"
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
-};
-
-int A::count = 0;
-
-struct B
- : public A
-{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
-};
-
-int B::count = 0;
-
-int main()
-{
- {
- CDeleter<B> db(5);
- std::unique_ptr<B, CDeleter<B>&> s(new B, db);
- A* p = s.get();
- CDeleter<A> da(6);
- std::unique_ptr<A, CDeleter<A>&> s2(new A, da);
- s2 = std::move(s);
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- assert(B::count == 1);
- assert(s.get_deleter().state() == 5);
- assert(s2.get_deleter().state() == 5);
- }
- assert(A::count == 0);
- assert(B::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp
index dba901b2ce17..2ebc33d21d81 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp
@@ -14,44 +14,30 @@
// Test unique_ptr converting move assignment
#include <memory>
-#include <utility>
-#include <cassert>
-// Can't assign from const lvalue
+#include "test_macros.h"
+#include "../../deleter.h"
struct A
{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
+ A() {}
+ virtual ~A() {}
};
-int A::count = 0;
-
-struct B
- : public A
+struct B : public A
{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
};
-int B::count = 0;
-
+// Can't assign from lvalue
int main()
{
- {
const std::unique_ptr<B> s(new B);
- A* p = s.get();
std::unique_ptr<A> s2;
- s2 = s;
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- assert(B::count == 1);
- }
- assert(A::count == 0);
- assert(B::count == 0);
+#if TEST_STD_VER >= 11
+ s2 = s; // expected-error {{no viable overloaded '='}}
+#else
+ // NOTE: The error says "constructor" because the assignment operator takes
+ // 's' by value and attempts to copy construct it.
+ s2 = s; // expected-error {{no matching constructor for initialization}}
+#endif
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp
index 56ab43c7de24..412648420d46 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp
@@ -32,5 +32,5 @@ int main()
{
std::unique_ptr<A[], Deleter> s;
std::unique_ptr<A, Deleter> s2;
- s2 = std::move(s);
+ s2 = std::move(s); // expected-error {{no viable overloaded '='}}
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp
index 1ce1838afbb7..7c3ac462c287 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp
@@ -7,17 +7,21 @@
//
//===----------------------------------------------------------------------===//
+// libc++ cannot safely provide the auto_ptr constructor without rvalue
+// references.
+// XFAIL: c++98, c++03
+
// <memory>
// unique_ptr
-// Test unique_ptr(pointer) ctor
+// template <class U> unique_ptr(auto_ptr<U>&&) noexcept
#include <memory>
#include <utility>
#include <cassert>
-// template <class U> explicit unique_ptr(auto_ptr<U>&);
+#include "test_macros.h"
struct A
{
@@ -65,4 +69,12 @@ int main()
}
assert(A::count == 0);
assert(B::count == 0);
+#if TEST_STD_VER >= 11
+ {
+ static_assert(std::is_nothrow_constructible<
+ std::unique_ptr<A>,
+ std::auto_ptr<B>&&
+ >::value, "");
+ }
+#endif
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default.pass.cpp
new file mode 100644
index 000000000000..2694538145b9
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default.pass.cpp
@@ -0,0 +1,86 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// unique_ptr
+
+//=============================================================================
+// TESTING std::unique_ptr::unique_ptr()
+//
+// Concerns:
+// 1 The default constructor works for any default constructible deleter types.
+// 2 The stored type 'T' is allowed to be incomplete.
+//
+// Plan
+// 1 Default construct unique_ptr's with various deleter types (C-1)
+// 2 Default construct a unique_ptr with a incomplete element_type and
+// various deleter types (C-1,2)
+
+#include <memory>
+#include <cassert>
+
+#include "../../deleter.h"
+
+struct IncompleteT;
+
+void checkNumIncompleteTypeAlive(int i);
+
+template <class Del = std::default_delete<IncompleteT> >
+struct StoresIncomplete {
+ std::unique_ptr<IncompleteT, Del> m_ptr;
+ StoresIncomplete() {}
+ ~StoresIncomplete();
+
+ IncompleteT* get() const { return m_ptr.get(); }
+ Del& get_deleter() { return m_ptr.get_deleter(); }
+};
+
+int main()
+{
+ {
+ std::unique_ptr<int> p;
+ assert(p.get() == 0);
+ }
+ {
+ std::unique_ptr<int, NCDeleter<int> > p;
+ assert(p.get() == 0);
+ assert(p.get_deleter().state() == 0);
+ p.get_deleter().set_state(5);
+ assert(p.get_deleter().state() == 5);
+ }
+ {
+ StoresIncomplete<> s;
+ assert(s.get() == 0);
+ checkNumIncompleteTypeAlive(0);
+ }
+ checkNumIncompleteTypeAlive(0);
+ {
+ StoresIncomplete< Deleter<IncompleteT> > s;
+ assert(s.get() == 0);
+ assert(s.get_deleter().state() == 0);
+ checkNumIncompleteTypeAlive(0);
+ }
+ checkNumIncompleteTypeAlive(0);
+}
+
+struct IncompleteT {
+ static int count;
+ IncompleteT() { ++count; }
+ ~IncompleteT() {--count; }
+};
+
+int IncompleteT::count = 0;
+
+void checkNumIncompleteTypeAlive(int i) {
+ assert(IncompleteT::count == i);
+}
+
+template <class Del>
+StoresIncomplete<Del>::~StoresIncomplete() { } \ No newline at end of file
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.pass.cpp
deleted file mode 100644
index e63db5cb7185..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.pass.cpp
+++ /dev/null
@@ -1,46 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr default ctor
-
-#include <memory>
-#include <cassert>
-
-// default unique_ptr ctor should only require default Deleter ctor
-class Deleter
-{
- int state_;
-
- Deleter(Deleter&);
- Deleter& operator=(Deleter&);
-
-public:
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
-
- void operator()(void*) {}
-};
-
-int main()
-{
- {
- std::unique_ptr<int> p;
- assert(p.get() == 0);
- }
- {
- std::unique_ptr<int, Deleter> p;
- assert(p.get() == 0);
- assert(p.get_deleter().state() == 5);
- }
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.pass.cpp
deleted file mode 100644
index e9af7e285255..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.pass.cpp
+++ /dev/null
@@ -1,84 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test default unique_ptr ctor
-
-#include <memory>
-#include <cassert>
-
-// default unique_ptr ctor shouldn't require complete type
-
-struct A;
-
-class Deleter
-{
- int state_;
-
- Deleter(Deleter&);
- Deleter& operator=(Deleter&);
-
-public:
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
-
- void operator()(A* p);
-};
-
-void check(int i);
-
-template <class D = std::default_delete<A> >
-struct B
-{
- std::unique_ptr<A, D> a_;
- B() {}
- ~B();
-
- A* get() const {return a_.get();}
- D& get_deleter() {return a_.get_deleter();}
-};
-
-int main()
-{
- {
- B<> s;
- assert(s.get() == 0);
- }
- check(0);
- {
- B<Deleter> s;
- assert(s.get() == 0);
- assert(s.get_deleter().state() == 5);
- }
- check(0);
-}
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
-
-void Deleter::operator()(A* p) {delete p;}
-
-void check(int i)
-{
- assert(A::count == i);
-}
-
-template <class D>
-B<D>::~B() {}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move.pass.cpp
new file mode 100644
index 000000000000..4c5cc843a138
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move.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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "../../deleter.h"
+
+//=============================================================================
+// TESTING unique_ptr(unique_ptr&&)
+//
+// Concerns
+// 1 The moved from pointer is empty and the new pointer stores the old value.
+// 2 The only requirement on the deleter is that it is MoveConstructible
+// or a reference.
+// 3 The constructor works for explicitly moved values (ie std::move(x))
+// 4 The constructor works for true temporaries (ie a return value)
+//
+// Plan
+// 1 Explicitly construct unique_ptr<T, D> for various deleter types 'D'.
+// check that the value and deleter have been properly moved. (C-1,2,3)
+//
+// 2 Use the expression 'sink(source())' to move construct a unique_ptr<T, D>
+// from a temporary. 'source' should return the unique_ptr by value and
+// 'sink' should accept the unique_ptr by value. (C-1,2,4)
+
+struct A
+{
+ static int count;
+ A() {++count;}
+ A(const A&) {++count;}
+ virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+template <class Expect>
+void sinkFunction(Expect)
+{
+}
+
+typedef std::unique_ptr<A> APtrSource1;
+typedef std::unique_ptr<A, Deleter<A> > APtrSource2;
+typedef std::unique_ptr<A, NCDeleter<A>& > APtrSource3;
+
+APtrSource1 source1() {
+ return APtrSource1 (new A);
+}
+
+void sink1(APtrSource1 p) {
+ assert(p.get() != nullptr);
+}
+
+APtrSource2 source2() {
+ return APtrSource2(new A, Deleter<A>(5));
+}
+
+void sink2(APtrSource2 p) {
+ assert(p.get() != nullptr);
+ assert(p.get_deleter().state() == 5);
+}
+
+APtrSource3 source3() {
+ static NCDeleter<A> d(5);
+ return APtrSource3(new A, d);
+}
+
+void sink3(APtrSource3 p) {
+ assert(p.get() != nullptr);
+ assert(p.get_deleter().state() == 5);
+ assert(&p.get_deleter() == &source3().get_deleter());
+}
+
+int main()
+{
+ {
+ typedef std::unique_ptr<A> APtr;
+ APtr s(new A);
+ A* p = s.get();
+ APtr s2 = std::move(s);
+ assert(s2.get() == p);
+ assert(s.get() == 0);
+ assert(A::count == 1);
+ }
+ assert(A::count == 0);
+ {
+ typedef Deleter<A> MoveDel;
+ typedef std::unique_ptr<A, MoveDel> APtr;
+ MoveDel d(5);
+ APtr s(new A, std::move(d));
+ assert(d.state() == 0);
+ assert(s.get_deleter().state() == 5);
+ A* p = s.get();
+ APtr s2 = std::move(s);
+ assert(s2.get() == p);
+ assert(s.get() == 0);
+ assert(A::count == 1);
+ assert(s2.get_deleter().state() == 5);
+ assert(s.get_deleter().state() == 0);
+ }
+ assert(A::count == 0);
+ {
+ typedef NCDeleter<A> NonCopyDel;
+ typedef std::unique_ptr<A, NonCopyDel&> APtr;
+
+ NonCopyDel d;
+ APtr s(new A, d);
+ A* p = s.get();
+ APtr s2 = std::move(s);
+ assert(s2.get() == p);
+ assert(s.get() == 0);
+ assert(A::count == 1);
+ d.set_state(6);
+ assert(s2.get_deleter().state() == d.state());
+ assert(s.get_deleter().state() == d.state());
+ }
+ assert(A::count == 0);
+ {
+ sink1(source1());
+ assert(A::count == 0);
+ sink2(source2());
+ assert(A::count == 0);
+ sink3(source3());
+ assert(A::count == 0);
+ }
+ assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.pass.cpp
deleted file mode 100644
index dc16c3115376..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.pass.cpp
+++ /dev/null
@@ -1,142 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr move ctor
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-// test move ctor. Should only require a MoveConstructible deleter, or if
-// deleter is a reference, not even that.
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
-
-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)
- {
- state_ = r.state_;
- 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)
- : state_(d.state()) {d.set_state(0);}
-
-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;}
-
- void operator()(T* p) {delete p;}
-};
-
-class CDeleter
-{
- int state_;
-
- CDeleter(CDeleter&);
- CDeleter& operator=(CDeleter&);
-public:
-
- CDeleter() : state_(5) {}
-
- int state() const {return state_;}
- void set_state(int s) {state_ = s;}
-
- void operator()(A* p) {delete p;}
-};
-
-int main()
-{
- {
- std::unique_ptr<A> s(new A);
- A* p = s.get();
- std::unique_ptr<A> s2 = std::move(s);
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- }
- assert(A::count == 0);
- {
- std::unique_ptr<A, Deleter<A> > s(new A);
- A* p = s.get();
- std::unique_ptr<A, Deleter<A> > s2 = std::move(s);
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- assert(s2.get_deleter().state() == 5);
- assert(s.get_deleter().state() == 0);
- }
- assert(A::count == 0);
- {
- CDeleter d;
- std::unique_ptr<A, CDeleter&> s(new A, d);
- A* p = s.get();
- std::unique_ptr<A, CDeleter&> s2 = std::move(s);
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- d.set_state(6);
- assert(s2.get_deleter().state() == d.state());
- assert(s.get_deleter().state() == d.state());
- }
- assert(A::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.pass.cpp
deleted file mode 100644
index 4b997df95a0b..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.pass.cpp
+++ /dev/null
@@ -1,143 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr move ctor
-
-#include <memory>
-#include <cassert>
-
-// test move ctor. Should only require a MoveConstructible deleter, or if
-// deleter is a reference, not even that.
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
-
-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)
- {
- state_ = r.state_;
- 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)
- : state_(d.state()) {d.set_state(0);}
-
-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;}
-
- void operator()(T* p) {delete p;}
-};
-
-class CDeleter
-{
- int state_;
-
- CDeleter(CDeleter&);
- CDeleter& operator=(CDeleter&);
-public:
-
- CDeleter() : state_(5) {}
-
- int state() const {return state_;}
- void set_state(int s) {state_ = s;}
-
- void operator()(A* p) {delete p;}
-};
-
-std::unique_ptr<A>
-source1()
-{
- return std::unique_ptr<A>(new A);
-}
-
-void sink1(std::unique_ptr<A> p)
-{
-}
-
-std::unique_ptr<A, Deleter<A> >
-source2()
-{
- return std::unique_ptr<A, Deleter<A> >(new A);
-}
-
-void sink2(std::unique_ptr<A, Deleter<A> > p)
-{
-}
-
-std::unique_ptr<A, CDeleter&>
-source3()
-{
- static CDeleter d;
- return std::unique_ptr<A, CDeleter&>(new A, d);
-}
-
-void sink3(std::unique_ptr<A, CDeleter&> p)
-{
-}
-
-int main()
-{
- sink1(source1());
- sink2(source2());
- sink3(source3());
- assert(A::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert.pass.cpp
new file mode 100644
index 000000000000..f00fcfe15b80
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert.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.
+//
+
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// NOTE: unique_ptr does not provide converting constructors in c++03
+// XFAIL: c++98, c++03
+
+
+
+#include <memory>
+#include <type_traits>
+#include <utility>
+#include <cassert>
+
+#include "../../deleter.h"
+
+// test converting move ctor. Should only require a MoveConstructible deleter, or if
+// deleter is a reference, not even that.
+// Explicit version
+
+struct A
+{
+ static int count;
+ A() {++count;}
+ A(const A&) {++count;}
+ virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+ : public A
+{
+ static int count;
+ B() {++count;}
+ B(const B&) {++count;}
+ virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+
+template <class LHS, class RHS>
+void checkReferenceDeleter(LHS& lhs, RHS& rhs) {
+ typedef typename LHS::deleter_type NewDel;
+ static_assert(std::is_reference<NewDel>::value, "");
+ rhs.get_deleter().set_state(42);
+ assert(rhs.get_deleter().state() == 42);
+ assert(lhs.get_deleter().state() == 42);
+ lhs.get_deleter().set_state(99);
+ assert(lhs.get_deleter().state() == 99);
+ assert(rhs.get_deleter().state() == 99);
+}
+
+template <class LHS, class RHS>
+void checkDeleter(LHS& lhs, RHS& rhs, int LHSVal, int RHSVal) {
+ assert(lhs.get_deleter().state() == LHSVal);
+ assert(rhs.get_deleter().state() == RHSVal);
+}
+
+template <class LHS, class RHS>
+void checkCtor(LHS& lhs, RHS& rhs, A* RHSVal) {
+ assert(lhs.get() == RHSVal);
+ assert(rhs.get() == nullptr);
+ assert(A::count == 1);
+ assert(B::count == 1);
+}
+
+void checkNoneAlive() {
+ assert(A::count == 0);
+ assert(B::count == 0);
+}
+
+int main()
+{
+ {
+ typedef std::unique_ptr<A> APtr;
+ typedef std::unique_ptr<B> BPtr;
+ { // explicit
+ BPtr b(new B);
+ A* p = b.get();
+ APtr a(std::move(b));
+ checkCtor(a, b, p);
+ }
+ checkNoneAlive();
+ { // implicit
+ BPtr b(new B);
+ A* p = b.get();
+ APtr a = std::move(b);
+ checkCtor(a, b, p);
+ }
+ checkNoneAlive();
+ }
+ { // test with moveable deleters
+ typedef std::unique_ptr<A, Deleter<A> > APtr;
+ typedef std::unique_ptr<B, Deleter<B> > BPtr;
+ {
+ Deleter<B> del(5);
+ BPtr b(new B, std::move(del));
+ A* p = b.get();
+ APtr a(std::move(b));
+ checkCtor(a, b, p);
+ checkDeleter(a, b, 5, 0);
+ }
+ checkNoneAlive();
+ {
+ Deleter<B> del(5);
+ BPtr b(new B, std::move(del));
+ A* p = b.get();
+ APtr a = std::move(b);
+ checkCtor(a, b, p);
+ checkDeleter(a, b, 5, 0);
+ }
+ checkNoneAlive();
+
+ }
+ { // test with reference deleters
+ typedef std::unique_ptr<A, NCDeleter<A>& > APtr;
+ typedef std::unique_ptr<B, NCDeleter<A>& > BPtr;
+ NCDeleter<A> del(5);
+ {
+ BPtr b(new B, del);
+ A* p = b.get();
+ APtr a(std::move(b));
+ checkCtor(a, b, p);
+ checkReferenceDeleter(a, b);
+ }
+ checkNoneAlive();
+ {
+ BPtr b(new B, del);
+ A* p = b.get();
+ APtr a = std::move(b);
+ checkCtor(a, b, p);
+ checkReferenceDeleter(a, b);
+ }
+ checkNoneAlive();
+ }
+ {
+ typedef std::unique_ptr<A, CDeleter<A> > APtr;
+ typedef std::unique_ptr<B, CDeleter<B>& > BPtr;
+ CDeleter<B> del(5);
+ {
+ BPtr b(new B, del);
+ A* p = b.get();
+ APtr a(std::move(b));
+ checkCtor(a, b, p);
+ checkDeleter(a, b, 5, 5);
+ }
+ checkNoneAlive();
+ {
+ BPtr b(new B, del);
+ A* p = b.get();
+ APtr a = std::move(b);
+ checkCtor(a, b, p);
+ checkDeleter(a, b, 5, 5);
+ }
+ checkNoneAlive();
+ }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.pass.cpp
deleted file mode 100644
index b65cf564a925..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.pass.cpp
+++ /dev/null
@@ -1,58 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move ctor
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-// test converting move ctor. Should only require a MoveConstructible deleter, or if
-// deleter is a reference, not even that.
-// Explicit version
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
-};
-
-int A::count = 0;
-
-struct B
- : public A
-{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
-};
-
-int B::count = 0;
-
-int main()
-{
- {
- std::unique_ptr<B> s(new B);
- A* p = s.get();
- std::unique_ptr<A> s2(std::move(s));
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- assert(B::count == 1);
- }
- assert(A::count == 0);
- assert(B::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.pass.cpp
deleted file mode 100644
index 829e7553acd9..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.pass.cpp
+++ /dev/null
@@ -1,62 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move ctor
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-#include "../../deleter.h"
-
-// test converting move ctor. Should only require a MoveConstructible deleter, or if
-// deleter is a reference, not even that.
-// Explicit version
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
-};
-
-int A::count = 0;
-
-struct B
- : public A
-{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
-};
-
-int B::count = 0;
-
-int main()
-{
- {
- std::unique_ptr<B, Deleter<B> > s(new B, Deleter<B>(5));
- A* p = s.get();
- std::unique_ptr<A, Deleter<A> > s2(std::move(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);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.pass.cpp
deleted file mode 100644
index 792076a95245..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.pass.cpp
+++ /dev/null
@@ -1,79 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move ctor
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-// test converting move ctor. Should only require a MoveConstructible deleter, or if
-// deleter is a reference, not even that.
-// Explicit version
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
-};
-
-int A::count = 0;
-
-struct B
- : public A
-{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
-};
-
-int B::count = 0;
-
-template <class T>
-class CDeleter
-{
- int state_;
-
- CDeleter(CDeleter&);
- CDeleter& operator=(CDeleter&);
-public:
-
- CDeleter() : state_(5) {}
-
- int state() const {return state_;}
- void set_state(int s) {state_ = s;}
-
- void operator()(T* p) {delete p;}
-};
-
-int main()
-{
- {
- CDeleter<A> d;
- std::unique_ptr<B, CDeleter<A>&> s(new B, d);
- A* p = s.get();
- std::unique_ptr<A, CDeleter<A>&> s2(std::move(s));
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- assert(B::count == 1);
- d.set_state(6);
- assert(s2.get_deleter().state() == d.state());
- assert(s.get_deleter().state() == d.state());
- }
- assert(A::count == 0);
- assert(B::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.pass.cpp
deleted file mode 100644
index 12ab17fadcd3..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.pass.cpp
+++ /dev/null
@@ -1,58 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move ctor
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-// test converting move ctor. Should only require a MoveConstructible deleter, or if
-// deleter is a reference, not even that.
-// implicit version
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
-};
-
-int A::count = 0;
-
-struct B
- : public A
-{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
-};
-
-int B::count = 0;
-
-int main()
-{
- {
- std::unique_ptr<B> s(new B);
- A* p = s.get();
- std::unique_ptr<A> s2 = std::move(s);
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- assert(B::count == 1);
- }
- assert(A::count == 0);
- assert(B::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.pass.cpp
deleted file mode 100644
index 8077b0dacb23..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.pass.cpp
+++ /dev/null
@@ -1,62 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move ctor
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-#include "../../deleter.h"
-
-// test converting move ctor. Should only require a MoveConstructible deleter, or if
-// deleter is a reference, not even that.
-// Implicit version
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
-};
-
-int A::count = 0;
-
-struct B
- : public A
-{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
-};
-
-int B::count = 0;
-
-int main()
-{
- {
- std::unique_ptr<B, Deleter<B> > s(new B, Deleter<B>(5));
- A* p = s.get();
- std::unique_ptr<A, Deleter<A> > s2 = std::move(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);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.pass.cpp
deleted file mode 100644
index 4115107b85f9..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.pass.cpp
+++ /dev/null
@@ -1,79 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move ctor
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-// test converting move ctor. Should only require a MoveConstructible deleter, or if
-// deleter is a reference, not even that.
-// Explicit version
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
-};
-
-int A::count = 0;
-
-struct B
- : public A
-{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
-};
-
-int B::count = 0;
-
-template <class T>
-class CDeleter
-{
- int state_;
-
- CDeleter(CDeleter&);
- CDeleter& operator=(CDeleter&);
-public:
-
- CDeleter() : state_(5) {}
-
- int state() const {return state_;}
- void set_state(int s) {state_ = s;}
-
- void operator()(T* p) {delete p;}
-};
-
-int main()
-{
- {
- CDeleter<A> d;
- std::unique_ptr<B, CDeleter<A>&> s(new B, d);
- A* p = s.get();
- std::unique_ptr<A, CDeleter<A>&> s2 = std::move(s);
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- assert(B::count == 1);
- d.set_state(6);
- assert(s2.get_deleter().state() == d.state());
- assert(s.get_deleter().state() == d.state());
- }
- assert(A::count == 0);
- assert(B::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.pass.cpp
deleted file mode 100644
index 978cb0e9024b..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.pass.cpp
+++ /dev/null
@@ -1,63 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move ctor
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-#include "../../deleter.h"
-
-// test converting move ctor. Should only require a MoveConstructible deleter, or if
-// deleter is a reference, not even that.
-// Implicit version
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
-};
-
-int A::count = 0;
-
-struct B
- : public A
-{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
-};
-
-int B::count = 0;
-
-int main()
-{
- {
- CDeleter<B> b(5);
- std::unique_ptr<B, CDeleter<B>&> s(new B, b);
- A* p = s.get();
- std::unique_ptr<A, CDeleter<A> > s2 = std::move(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() == 5);
- }
- assert(A::count == 0);
- assert(B::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer.pass.cpp
new file mode 100644
index 000000000000..faa554d8b320
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer.pass.cpp
@@ -0,0 +1,163 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// unique_ptr
+
+//=============================================================================
+// TESTING std::unique_ptr::unique_ptr()
+//
+// Concerns:
+// 1 The pointer constructor works for any default constructible deleter types.
+// 2 The pointer constructor accepts pointers to derived types.
+// 2 The stored type 'T' is allowed to be incomplete.
+//
+// Plan
+// 1 Construct unique_ptr<T, D>'s with a pointer to 'T' and various deleter
+// types (C-1)
+// 2 Construct unique_ptr<T, D>'s with a pointer to 'D' and various deleter
+// types where 'D' is derived from 'T'. (C-1,2)
+// 3 Construct a unique_ptr<T, D> with a pointer to 'T' and various deleter
+// types where 'T' is an incomplete type (C-1,3)
+
+// Test unique_ptr(pointer) ctor
+
+#include <memory>
+#include <cassert>
+
+#include "../../deleter.h"
+
+// unique_ptr(pointer) ctor should only require default Deleter ctor
+
+struct A
+{
+ static int count;
+ A() {++count;}
+ A(const A&) {++count;}
+ virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+
+struct B
+ : public A
+{
+ static int count;
+ B() {++count;}
+ B(const B&) {++count;}
+ virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+
+struct IncompleteT;
+
+IncompleteT* getIncomplete();
+void checkNumIncompleteTypeAlive(int i);
+
+template <class Del = std::default_delete<IncompleteT> >
+struct StoresIncomplete {
+ std::unique_ptr<IncompleteT, Del> m_ptr;
+ StoresIncomplete() {}
+ explicit StoresIncomplete(IncompleteT* ptr) : m_ptr(ptr) {}
+ ~StoresIncomplete();
+
+ IncompleteT* get() const { return m_ptr.get(); }
+ Del& get_deleter() { return m_ptr.get_deleter(); }
+};
+
+void test_pointer()
+{
+ {
+ A* p = new A;
+ assert(A::count == 1);
+ std::unique_ptr<A> s(p);
+ assert(s.get() == p);
+ }
+ assert(A::count == 0);
+ {
+ A* p = new A;
+ assert(A::count == 1);
+ std::unique_ptr<A, NCDeleter<A> > s(p);
+ assert(s.get() == p);
+ assert(s.get_deleter().state() == 0);
+ }
+ assert(A::count == 0);
+}
+
+void test_derived()
+{
+ {
+ B* p = new B;
+ assert(A::count == 1);
+ assert(B::count == 1);
+ std::unique_ptr<A> s(p);
+ assert(s.get() == p);
+ }
+ assert(A::count == 0);
+ assert(B::count == 0);
+ {
+ B* p = new B;
+ assert(A::count == 1);
+ assert(B::count == 1);
+ std::unique_ptr<A, NCDeleter<A> > s(p);
+ assert(s.get() == p);
+ assert(s.get_deleter().state() == 0);
+ }
+ assert(A::count == 0);
+ assert(B::count == 0);
+}
+
+void test_incomplete()
+{
+ {
+ IncompleteT* p = getIncomplete();
+ checkNumIncompleteTypeAlive(1);
+ StoresIncomplete<> s(p);
+ assert(s.get() == p);
+ }
+ checkNumIncompleteTypeAlive(0);
+ {
+ IncompleteT* p = getIncomplete();
+ checkNumIncompleteTypeAlive(1);
+ StoresIncomplete< NCDeleter<IncompleteT> > s(p);
+ assert(s.get() == p);
+ assert(s.get_deleter().state() == 0);
+ }
+ checkNumIncompleteTypeAlive(0);
+}
+
+struct IncompleteT {
+ static int count;
+ IncompleteT() { ++count; }
+ ~IncompleteT() {--count; }
+};
+
+int IncompleteT::count = 0;
+
+IncompleteT* getIncomplete() {
+ return new IncompleteT;
+}
+
+void checkNumIncompleteTypeAlive(int i) {
+ assert(IncompleteT::count == i);
+}
+
+template <class Del>
+StoresIncomplete<Del>::~StoresIncomplete() { }
+
+int main()
+{
+ test_pointer();
+ test_derived();
+ test_incomplete();
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.pass.cpp
deleted file mode 100644
index e5fff774b790..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.pass.cpp
+++ /dev/null
@@ -1,63 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr(pointer) ctor
-
-#include <memory>
-#include <cassert>
-
-// unique_ptr(pointer) ctor should only require default Deleter ctor
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
-
-class Deleter
-{
- int state_;
-
- Deleter(Deleter&);
- Deleter& operator=(Deleter&);
-
-public:
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
-
- void operator()(A* p) {delete p;}
-};
-
-int main()
-{
- {
- A* p = new A;
- assert(A::count == 1);
- std::unique_ptr<A> s(p);
- assert(s.get() == p);
- }
- assert(A::count == 0);
- {
- A* p = new A;
- assert(A::count == 1);
- std::unique_ptr<A, Deleter> s(p);
- assert(s.get() == p);
- assert(s.get_deleter().state() == 5);
- }
- assert(A::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.pass.cpp
deleted file mode 100644
index a226e87d64a4..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.pass.cpp
+++ /dev/null
@@ -1,95 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr(pointer) ctor
-
-#include <memory>
-#include <cassert>
-
-// unique_ptr(pointer) ctor shouldn't require complete type
-
-struct A;
-
-class Deleter
-{
- int state_;
-
- Deleter(Deleter&);
- Deleter& operator=(Deleter&);
-
-public:
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
-
- void operator()(A* p);
-};
-
-void check(int i);
-
-template <class D = std::default_delete<A> >
-struct B
-{
- std::unique_ptr<A, D> a_;
- explicit B(A*);
- ~B();
-
- A* get() const {return a_.get();}
- D& get_deleter() {return a_.get_deleter();}
-};
-
-A* get();
-
-int main()
-{
- {
- A* p = get();
- check(1);
- B<> s(p);
- assert(s.get() == p);
- }
- check(0);
- {
- A* p = get();
- check(1);
- B<Deleter> s(p);
- assert(s.get() == p);
- assert(s.get_deleter().state() == 5);
- }
- check(0);
-}
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
-
-A* get() {return new A;}
-
-void Deleter::operator()(A* p) {delete p;}
-
-void check(int i)
-{
- assert(A::count == i);
-}
-
-template <class D>
-B<D>::B(A* a) : a_(a) {}
-
-template <class D>
-B<D>::~B() {}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.pass.cpp
deleted file mode 100644
index 42fc09453914..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.pass.cpp
+++ /dev/null
@@ -1,78 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr(pointer) ctor
-
-#include <memory>
-#include <cassert>
-
-// unique_ptr(pointer) ctor should work with derived pointers
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
-};
-
-int A::count = 0;
-
-struct B
- : public A
-{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
-};
-
-int B::count = 0;
-
-class Deleter
-{
- int state_;
-
- Deleter(Deleter&);
- Deleter& operator=(Deleter&);
-
-public:
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
-
- void operator()(A* p) {delete p;}
-};
-
-int main()
-{
- {
- B* p = new B;
- assert(A::count == 1);
- assert(B::count == 1);
- std::unique_ptr<A> s(p);
- assert(s.get() == p);
- }
- assert(A::count == 0);
- assert(B::count == 0);
- {
- B* p = new B;
- assert(A::count == 1);
- assert(B::count == 1);
- std::unique_ptr<A, Deleter> s(p);
- assert(s.get() == p);
- assert(s.get_deleter().state() == 5);
- }
- assert(A::count == 0);
- assert(B::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter.pass.cpp
new file mode 100644
index 000000000000..7ddd16265107
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter.pass.cpp
@@ -0,0 +1,123 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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>
+
+// unique_ptr
+
+//=============================================================================
+// TESTING unique_ptr(pointer, deleter)
+//
+// Concerns:
+// 1 unique_ptr(pointer, deleter&&) only requires a MoveConstructible deleter.
+// 2 unique_ptr(pointer, deleter&) requires a CopyConstructible deleter.
+// 3 unique_ptr<T, D&>(pointer, deleter) does not require a CopyConstructible deleter.
+// 4 unique_ptr<T, D const&>(pointer, deleter) does not require a CopyConstructible deleter.
+// 5 unique_ptr(pointer, deleter) should work for derived pointers.
+// 6 unique_ptr(pointer, deleter) should work with function pointers.
+// 7 unique_ptr<void> should work.
+
+
+#include <memory>
+#include <cassert>
+
+#include "../../deleter.h"
+
+struct A
+{
+ static int count;
+ A() {++count;}
+ A(const A&) {++count;}
+ virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+
+struct B
+ : public A
+{
+ static int count;
+ B() {++count;}
+ B(const B&) {++count;}
+ virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+bool my_free_called = false;
+
+void my_free(void*) {
+ my_free_called = true;
+}
+
+int main()
+{
+ { // MoveConstructible deleter (C-1)
+ A* p = new A;
+ assert(A::count == 1);
+ std::unique_ptr<A, Deleter<A> > s(p, Deleter<A>(5));
+ assert(s.get() == p);
+ assert(s.get_deleter().state() == 5);
+ }
+ assert(A::count == 0);
+ { // CopyConstructible deleter (C-2)
+ A* p = new A;
+ assert(A::count == 1);
+ CopyDeleter<A> d(5);
+ std::unique_ptr<A, CopyDeleter<A> > s(p, d);
+ assert(s.get() == p);
+ assert(s.get_deleter().state() == 5);
+ d.set_state(6);
+ assert(s.get_deleter().state() == 5);
+ }
+ assert(A::count == 0);
+ { // Reference deleter (C-3)
+ A* p = new A;
+ assert(A::count == 1);
+ NCDeleter<A> d(5);
+ std::unique_ptr<A, NCDeleter<A>&> s(p, d);
+ assert(s.get() == p);
+ assert(&s.get_deleter() == &d);
+ assert(s.get_deleter().state() == 5);
+ d.set_state(6);
+ assert(s.get_deleter().state() == 6);
+ }
+ assert(A::count == 0);
+ { // Const Reference deleter (C-4)
+ A* p = new A;
+ assert(A::count == 1);
+ NCConstDeleter<A> d(5);
+ std::unique_ptr<A, NCConstDeleter<A> const&> s(p, d);
+ assert(s.get() == p);
+ assert(s.get_deleter().state() == 5);
+ assert(&s.get_deleter() == &d);
+ }
+ assert(A::count == 0);
+ { // Derived pointers (C-5)
+ B* p = new B;
+ assert(A::count == 1);
+ assert(B::count == 1);
+ std::unique_ptr<A, Deleter<A> > s(p, Deleter<A>(5));
+ assert(s.get() == p);
+ assert(s.get_deleter().state() == 5);
+ }
+ assert(A::count == 0);
+ assert(B::count == 0);
+ { // Void and function pointers (C-6,7)
+ {
+ int i = 0;
+ std::unique_ptr<void, void(*)(void*)> s(&i, my_free);
+ assert(s.get() == &i);
+ assert(s.get_deleter() == my_free);
+ assert(!my_free_called);
+ }
+ assert(my_free_called);
+ }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter01.pass.cpp
deleted file mode 100644
index 130f91d6216f..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter01.pass.cpp
+++ /dev/null
@@ -1,99 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr(pointer) ctor
-
-#include <memory>
-#include <cassert>
-
-// unique_ptr(pointer, deleter()) only requires MoveConstructible deleter
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
-
-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)
- {
- state_ = r.state_;
- 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)
- : state_(d.state()) {d.set_state(0);}
-
-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;}
-
- void operator()(T* p) {delete p;}
-};
-
-int main()
-{
- {
- A* p = new A;
- assert(A::count == 1);
- std::unique_ptr<A, Deleter<A> > s(p, Deleter<A>());
- assert(s.get() == p);
- assert(s.get_deleter().state() == 5);
- }
- assert(A::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter02.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter02.pass.cpp
deleted file mode 100644
index 421bec55f99c..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter02.pass.cpp
+++ /dev/null
@@ -1,58 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr(pointer) ctor
-
-#include <memory>
-#include <cassert>
-
-// unique_ptr(pointer, d) requires CopyConstructible deleter
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
-
-class Deleter
-{
- int state_;
-
-public:
-
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
- void set_state(int s) {state_ = s;}
-
- void operator()(A* p) {delete p;}
-};
-
-int main()
-{
- {
- A* p = new A;
- assert(A::count == 1);
- Deleter d;
- std::unique_ptr<A, Deleter> s(p, d);
- assert(s.get() == p);
- assert(s.get_deleter().state() == 5);
- d.set_state(6);
- assert(s.get_deleter().state() == 5);
- }
- assert(A::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter03.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter03.pass.cpp
deleted file mode 100644
index bce79dbb1a97..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter03.pass.cpp
+++ /dev/null
@@ -1,60 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr(pointer) ctor
-
-#include <memory>
-#include <cassert>
-
-// unique_ptr<T, D&>(pointer, d) does not requires CopyConstructible deleter
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
-
-class Deleter
-{
- int state_;
-
- Deleter(const Deleter&);
- Deleter& operator=(const Deleter&);
-public:
-
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
- void set_state(int s) {state_ = s;}
-
- void operator()(A* p) {delete p;}
-};
-
-int main()
-{
- {
- A* p = new A;
- assert(A::count == 1);
- Deleter d;
- std::unique_ptr<A, Deleter&> s(p, d);
- assert(s.get() == p);
- assert(s.get_deleter().state() == 5);
- d.set_state(6);
- assert(s.get_deleter().state() == 6);
- }
- assert(A::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp
index 7cacd1fda9f3..ad64b5e4ea39 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp
@@ -7,49 +7,24 @@
//
//===----------------------------------------------------------------------===//
+// Without rvalue references it is impossible to detect when a rvalue deleter
+// is given.
+// XFAIL: c++98, c++03
+
// <memory>
// unique_ptr
-// Test unique_ptr(pointer) ctor
-
-#include <memory>
-#include <cassert>
-
// unique_ptr<T, const D&>(pointer, D()) should not compile
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
-
-class Deleter
-{
- int state_;
-
-public:
-
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
- void set_state(int s) {state_ = s;}
+#include <memory>
- void operator()(A* p) const {delete p;}
+struct Deleter {
+ void operator()(int* p) const {delete p;}
};
int main()
{
- {
- A* p = new A;
- assert(A::count == 1);
- std::unique_ptr<A, const Deleter&> s(p, Deleter());
- assert(s.get() == p);
- assert(s.get_deleter().state() == 5);
- }
- assert(A::count == 0);
+ // expected-error@memory:* {{static_assert failed "rvalue deleter bound to reference"}}
+ std::unique_ptr<int, const Deleter&> s((int*)nullptr, Deleter()); // expected-note {{requested here}}
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.pass.cpp
deleted file mode 100644
index a7750fcb9f0f..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.pass.cpp
+++ /dev/null
@@ -1,58 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr(pointer) ctor
-
-#include <memory>
-#include <cassert>
-
-// unique_ptr<T, const D&>(pointer, d) does not requires CopyConstructible deleter
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- ~A() {--count;}
-};
-
-int A::count = 0;
-
-class Deleter
-{
- int state_;
-
- Deleter(const Deleter&);
- Deleter& operator=(const Deleter&);
-public:
-
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
- void set_state(int s) {state_ = s;}
-
- void operator()(A* p) const {delete p;}
-};
-
-int main()
-{
- {
- A* p = new A;
- assert(A::count == 1);
- Deleter d;
- std::unique_ptr<A, const Deleter&> s(p, d);
- assert(s.get() == p);
- assert(s.get_deleter().state() == 5);
- }
- assert(A::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter05.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter05.pass.cpp
deleted file mode 100644
index 1a83258e1e41..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter05.pass.cpp
+++ /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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr(pointer, deleter) ctor
-
-#include <memory>
-#include <cassert>
-
-// unique_ptr(pointer, deleter) should work with derived pointers
-
-struct A
-{
- static int count;
- A() {++count;}
- A(const A&) {++count;}
- virtual ~A() {--count;}
-};
-
-int A::count = 0;
-
-struct B
- : public A
-{
- static int count;
- B() {++count;}
- B(const B&) {++count;}
- virtual ~B() {--count;}
-};
-
-int B::count = 0;
-
-class Deleter
-{
- int state_;
-
-public:
- Deleter() : state_(5) {}
-
- int state() const {return state_;}
-
- void operator()(A* p) {delete p;}
-};
-
-int main()
-{
- {
- B* p = new B;
- assert(A::count == 1);
- assert(B::count == 1);
- std::unique_ptr<A, Deleter> s(p, Deleter());
- assert(s.get() == p);
- assert(s.get_deleter().state() == 5);
- }
- assert(A::count == 0);
- assert(B::count == 0);
-}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter06.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter06.pass.cpp
deleted file mode 100644
index ed68052cd3bb..000000000000
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter06.pass.cpp
+++ /dev/null
@@ -1,39 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr(pointer, deleter) ctor
-
-#include <memory>
-#include <cassert>
-
-// unique_ptr(pointer, deleter) should work with function pointers
-// unique_ptr<void> should work
-
-bool my_free_called = false;
-
-void my_free(void*)
-{
- my_free_called = true;
-}
-
-int main()
-{
- {
- int i = 0;
- std::unique_ptr<void, void (*)(void*)> s(&i, my_free);
- assert(s.get() == &i);
- assert(s.get_deleter() == my_free);
- assert(!my_free_called);
- }
- assert(my_free_called);
-}
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
index b2e61faff5ed..f17485108b92 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <memory>
// template<class Y> explicit shared_ptr(auto_ptr<Y>&& r);
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 ab2c73e0c5f1..41aeb04a5feb 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: 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 97d3f69fb5c4..6a79a8ef60db 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <memory>
// shared_ptr
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 4220993a5fd1..c72847791778 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: 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 ead081645671..982313b07499 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <memory>
// shared_ptr
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 041fe9a7853d..2e761d70bba0 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <memory>
// template<class Y> explicit shared_ptr(Y* p);
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 5e09d9a7934c..c62fcd689320 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <memory>
// template <class Y, class D> explicit shared_ptr(unique_ptr<Y, D>&&r);
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 a9d8aff145a7..35a7d077b424 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// <memory>
// shared_ptr
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
index d091ae99fc27..bf1719c66ffa 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
@@ -30,9 +30,28 @@
// bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const;
// bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const;
// };
+//
+// Added in C++17
+// template<> struct owner_less<void>
+// {
+// template<class T, class U>
+// bool operator()(shared_ptr<T> const&, shared_ptr<U> const&) const;
+// template<class T, class U>
+// bool operator()(shared_ptr<T> const&, weak_ptr<U> const&) const;
+// template<class T, class U>
+// bool operator()(weak_ptr<T> const&, shared_ptr<U> const&) const;
+// template<class T, class U>
+// bool operator()(weak_ptr<T> const&, weak_ptr<U> const&) const;
+//
+// typedef unspecified is_transparent;
+// };
#include <memory>
#include <cassert>
+#include <set>
+#include "test_macros.h"
+
+struct X {};
int main()
{
@@ -79,4 +98,25 @@ int main()
assert(cs(w1, p3) || cs(w3, p1));
assert(cs(w3, p1) == cs(w3, p2));
}
+#if TEST_STD_VER > 14
+ {
+ std::shared_ptr<int> sp1;
+ std::shared_ptr<void> sp2;
+ std::shared_ptr<long> sp3;
+ std::weak_ptr<int> wp1;
+
+ std::owner_less<> cmp;
+ cmp(sp1, sp2);
+ cmp(sp1, wp1);
+ cmp(sp1, sp3);
+ cmp(wp1, sp1);
+ cmp(wp1, wp1);
+ }
+ {
+ // test heterogeneous lookups
+ std::set<std::shared_ptr<X>, std::owner_less<>> s;
+ std::shared_ptr<void> vp;
+ s.find(vp);
+ }
+#endif
}
diff --git a/test/std/utilities/meta/meta.logical/conjunction.pass.cpp b/test/std/utilities/meta/meta.logical/conjunction.pass.cpp
new file mode 100644
index 000000000000..dce58ec23725
--- /dev/null
+++ b/test/std/utilities/meta/meta.logical/conjunction.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
+// type_traits
+
+// template<class... B> struct conjunction; // C++17
+// template<class... B>
+// constexpr bool conjunction_v = conjunction<B...>::value; // C++17
+
+#include <type_traits>
+#include <cassert>
+
+struct True { static constexpr bool value = true; };
+struct False { static constexpr bool value = false; };
+
+int main()
+{
+ static_assert ( std::conjunction<>::value, "" );
+ static_assert ( std::conjunction<std::true_type >::value, "" );
+ static_assert (!std::conjunction<std::false_type>::value, "" );
+
+ static_assert ( std::conjunction_v<>, "" );
+ static_assert ( std::conjunction_v<std::true_type >, "" );
+ static_assert (!std::conjunction_v<std::false_type>, "" );
+
+ static_assert ( std::conjunction<std::true_type, std::true_type >::value, "" );
+ static_assert (!std::conjunction<std::true_type, std::false_type>::value, "" );
+ static_assert (!std::conjunction<std::false_type, std::true_type >::value, "" );
+ static_assert (!std::conjunction<std::false_type, std::false_type>::value, "" );
+
+ static_assert ( std::conjunction_v<std::true_type, std::true_type >, "" );
+ static_assert (!std::conjunction_v<std::true_type, std::false_type>, "" );
+ static_assert (!std::conjunction_v<std::false_type, std::true_type >, "" );
+ static_assert (!std::conjunction_v<std::false_type, std::false_type>, "" );
+
+ static_assert ( std::conjunction<std::true_type, std::true_type, std::true_type >::value, "" );
+ static_assert (!std::conjunction<std::true_type, std::false_type, std::true_type >::value, "" );
+ static_assert (!std::conjunction<std::false_type, std::true_type, std::true_type >::value, "" );
+ static_assert (!std::conjunction<std::false_type, std::false_type, std::true_type >::value, "" );
+ static_assert (!std::conjunction<std::true_type, std::true_type, std::false_type>::value, "" );
+ static_assert (!std::conjunction<std::true_type, std::false_type, std::false_type>::value, "" );
+ static_assert (!std::conjunction<std::false_type, std::true_type, std::false_type>::value, "" );
+ static_assert (!std::conjunction<std::false_type, std::false_type, std::false_type>::value, "" );
+
+ static_assert ( std::conjunction_v<std::true_type, std::true_type, std::true_type >, "" );
+ static_assert (!std::conjunction_v<std::true_type, std::false_type, std::true_type >, "" );
+ static_assert (!std::conjunction_v<std::false_type, std::true_type, std::true_type >, "" );
+ static_assert (!std::conjunction_v<std::false_type, std::false_type, std::true_type >, "" );
+ static_assert (!std::conjunction_v<std::true_type, std::true_type, std::false_type>, "" );
+ static_assert (!std::conjunction_v<std::true_type, std::false_type, std::false_type>, "" );
+ static_assert (!std::conjunction_v<std::false_type, std::true_type, std::false_type>, "" );
+ static_assert (!std::conjunction_v<std::false_type, std::false_type, std::false_type>, "" );
+
+ static_assert ( std::conjunction<True >::value, "" );
+ static_assert (!std::conjunction<False>::value, "" );
+
+ static_assert ( std::conjunction_v<True >, "" );
+ static_assert (!std::conjunction_v<False>, "" );
+}
diff --git a/test/std/utilities/meta/meta.logical/disjunction.pass.cpp b/test/std/utilities/meta/meta.logical/disjunction.pass.cpp
new file mode 100644
index 000000000000..13cd9341b99f
--- /dev/null
+++ b/test/std/utilities/meta/meta.logical/disjunction.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
+// type_traits
+
+// template<class... B> struct disjunction; // C++17
+// template<class... B>
+// constexpr bool disjunction_v = disjunction<B...>::value; // C++17
+
+#include <type_traits>
+#include <cassert>
+
+struct True { static constexpr bool value = true; };
+struct False { static constexpr bool value = false; };
+
+int main()
+{
+ static_assert (!std::disjunction<>::value, "" );
+ static_assert ( std::disjunction<std::true_type >::value, "" );
+ static_assert (!std::disjunction<std::false_type>::value, "" );
+
+ static_assert (!std::disjunction_v<>, "" );
+ static_assert ( std::disjunction_v<std::true_type >, "" );
+ static_assert (!std::disjunction_v<std::false_type>, "" );
+
+ static_assert ( std::disjunction<std::true_type, std::true_type >::value, "" );
+ static_assert ( std::disjunction<std::true_type, std::false_type>::value, "" );
+ static_assert ( std::disjunction<std::false_type, std::true_type >::value, "" );
+ static_assert (!std::disjunction<std::false_type, std::false_type>::value, "" );
+
+ static_assert ( std::disjunction_v<std::true_type, std::true_type >, "" );
+ static_assert ( std::disjunction_v<std::true_type, std::false_type>, "" );
+ static_assert ( std::disjunction_v<std::false_type, std::true_type >, "" );
+ static_assert (!std::disjunction_v<std::false_type, std::false_type>, "" );
+
+ static_assert ( std::disjunction<std::true_type, std::true_type, std::true_type >::value, "" );
+ static_assert ( std::disjunction<std::true_type, std::false_type, std::true_type >::value, "" );
+ static_assert ( std::disjunction<std::false_type, std::true_type, std::true_type >::value, "" );
+ static_assert ( std::disjunction<std::false_type, std::false_type, std::true_type >::value, "" );
+ static_assert ( std::disjunction<std::true_type, std::true_type, std::false_type>::value, "" );
+ static_assert ( std::disjunction<std::true_type, std::false_type, std::false_type>::value, "" );
+ static_assert ( std::disjunction<std::false_type, std::true_type, std::false_type>::value, "" );
+ static_assert (!std::disjunction<std::false_type, std::false_type, std::false_type>::value, "" );
+
+ static_assert ( std::disjunction_v<std::true_type, std::true_type, std::true_type >, "" );
+ static_assert ( std::disjunction_v<std::true_type, std::false_type, std::true_type >, "" );
+ static_assert ( std::disjunction_v<std::false_type, std::true_type, std::true_type >, "" );
+ static_assert ( std::disjunction_v<std::false_type, std::false_type, std::true_type >, "" );
+ static_assert ( std::disjunction_v<std::true_type, std::true_type, std::false_type>, "" );
+ static_assert ( std::disjunction_v<std::true_type, std::false_type, std::false_type>, "" );
+ static_assert ( std::disjunction_v<std::false_type, std::true_type, std::false_type>, "" );
+ static_assert (!std::disjunction_v<std::false_type, std::false_type, std::false_type>, "" );
+
+ static_assert ( std::disjunction<True >::value, "" );
+ static_assert (!std::disjunction<False>::value, "" );
+
+ static_assert ( std::disjunction_v<True >, "" );
+ static_assert (!std::disjunction_v<False>, "" );
+}
diff --git a/test/std/utilities/meta/meta.logical/negation.pass.cpp b/test/std/utilities/meta/meta.logical/negation.pass.cpp
new file mode 100644
index 000000000000..76ff6c5b24db
--- /dev/null
+++ b/test/std/utilities/meta/meta.logical/negation.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
+// type_traits
+
+// template<class B> struct negation; // C++17
+// template<class B>
+// constexpr bool negation_v = negation<B>::value; // C++17
+
+#include <type_traits>
+#include <cassert>
+
+struct True { static constexpr bool value = true; };
+struct False { static constexpr bool value = false; };
+
+int main()
+{
+ static_assert (!std::negation<std::true_type >::value, "" );
+ static_assert ( std::negation<std::false_type>::value, "" );
+
+ static_assert (!std::negation_v<std::true_type >, "" );
+ static_assert ( std::negation_v<std::false_type>, "" );
+
+ static_assert (!std::negation<True >::value, "" );
+ static_assert ( std::negation<False>::value, "" );
+
+ static_assert (!std::negation_v<True >, "" );
+ static_assert ( std::negation_v<False>, "" );
+
+ static_assert ( std::negation<std::negation<std::true_type >>::value, "" );
+ static_assert (!std::negation<std::negation<std::false_type>>::value, "" );
+}
diff --git a/test/std/utilities/meta/meta.rel/is_base_of.pass.cpp b/test/std/utilities/meta/meta.rel/is_base_of.pass.cpp
index 0f90ae5c1cab..4b17a9f96505 100644
--- a/test/std/utilities/meta/meta.rel/is_base_of.pass.cpp
+++ b/test/std/utilities/meta/meta.rel/is_base_of.pass.cpp
@@ -13,6 +13,8 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_is_base_of()
{
@@ -20,6 +22,12 @@ void test_is_base_of()
static_assert((std::is_base_of<const T, U>::value), "");
static_assert((std::is_base_of<T, const U>::value), "");
static_assert((std::is_base_of<const T, const U>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((std::is_base_of_v<T, U>), "");
+ static_assert((std::is_base_of_v<const T, U>), "");
+ static_assert((std::is_base_of_v<T, const U>), "");
+ static_assert((std::is_base_of_v<const T, const U>), "");
+#endif
}
template <class T, class U>
diff --git a/test/std/utilities/meta/meta.rel/is_convertible.pass.cpp b/test/std/utilities/meta/meta.rel/is_convertible.pass.cpp
index 429fb33037ff..1681c39972d2 100644
--- a/test/std/utilities/meta/meta.rel/is_convertible.pass.cpp
+++ b/test/std/utilities/meta/meta.rel/is_convertible.pass.cpp
@@ -13,6 +13,8 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_is_convertible()
{
@@ -20,6 +22,12 @@ void test_is_convertible()
static_assert((std::is_convertible<const T, U>::value), "");
static_assert((std::is_convertible<T, const U>::value), "");
static_assert((std::is_convertible<const T, const U>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((std::is_convertible_v<T, U>), "");
+ static_assert((std::is_convertible_v<const T, U>), "");
+ static_assert((std::is_convertible_v<T, const U>), "");
+ static_assert((std::is_convertible_v<const T, const U>), "");
+#endif
}
template <class T, class U>
@@ -29,6 +37,12 @@ void test_is_not_convertible()
static_assert((!std::is_convertible<const T, U>::value), "");
static_assert((!std::is_convertible<T, const U>::value), "");
static_assert((!std::is_convertible<const T, const U>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_convertible_v<T, U>), "");
+ static_assert((!std::is_convertible_v<const T, U>), "");
+ static_assert((!std::is_convertible_v<T, const U>), "");
+ static_assert((!std::is_convertible_v<const T, const U>), "");
+#endif
}
typedef void Function();
diff --git a/test/std/utilities/meta/meta.rel/is_convertible_fallback.pass.cpp b/test/std/utilities/meta/meta.rel/is_convertible_fallback.pass.cpp
index bd35ef63d08b..5a607f3b12ad 100644
--- a/test/std/utilities/meta/meta.rel/is_convertible_fallback.pass.cpp
+++ b/test/std/utilities/meta/meta.rel/is_convertible_fallback.pass.cpp
@@ -13,6 +13,14 @@
// Test the fallback implementation.
+// libc++ provides a fallback implementation of the compiler trait
+// `__is_convertible` with the same name when clang doesn't.
+// Because this test forces the use of the fallback even when clang provides
+// it causing a keyword incompatibility.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wkeyword-compat"
+#endif
+
#define _LIBCPP_USE_IS_CONVERTIBLE_FALLBACK
#include "is_convertible.pass.cpp"
diff --git a/test/std/utilities/meta/meta.rel/is_same.pass.cpp b/test/std/utilities/meta/meta.rel/is_same.pass.cpp
index 7250d6ca7730..9db367391f69 100644
--- a/test/std/utilities/meta/meta.rel/is_same.pass.cpp
+++ b/test/std/utilities/meta/meta.rel/is_same.pass.cpp
@@ -13,13 +13,21 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_is_same()
{
- static_assert((std::is_same<T, U>::value), "");
+ static_assert(( std::is_same<T, U>::value), "");
static_assert((!std::is_same<const T, U>::value), "");
static_assert((!std::is_same<T, const U>::value), "");
- static_assert((std::is_same<const T, const U>::value), "");
+ static_assert(( std::is_same<const T, const U>::value), "");
+#if TEST_STD_VER > 14
+ static_assert(( std::is_same_v<T, U>), "");
+ static_assert((!std::is_same_v<const T, U>), "");
+ static_assert((!std::is_same_v<T, const U>), "");
+ static_assert(( std::is_same_v<const T, const U>), "");
+#endif
}
template <class T, class U>
@@ -29,6 +37,12 @@ void test_is_same_ref()
static_assert((std::is_same<const T, U>::value), "");
static_assert((std::is_same<T, const U>::value), "");
static_assert((std::is_same<const T, const U>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((std::is_same_v<T, U>), "");
+ static_assert((std::is_same_v<const T, U>), "");
+ static_assert((std::is_same_v<T, const U>), "");
+ static_assert((std::is_same_v<const T, const U>), "");
+#endif
}
template <class T, class U>
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
index c87e99c46e80..a53bed984c5e 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp
@@ -12,12 +12,14 @@
// aligned_storage
#include <type_traits>
+#include <cstddef> // for std::max_align_t
+#include "test_macros.h"
int main()
{
{
typedef std::aligned_storage<10, 1 >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<10, 1>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 1, "");
@@ -25,7 +27,7 @@ int main()
}
{
typedef std::aligned_storage<10, 2 >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<10, 2>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 2, "");
@@ -33,7 +35,7 @@ int main()
}
{
typedef std::aligned_storage<10, 4 >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<10, 4>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 4, "");
@@ -41,7 +43,7 @@ int main()
}
{
typedef std::aligned_storage<10, 8 >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<10, 8>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 8, "");
@@ -49,7 +51,7 @@ int main()
}
{
typedef std::aligned_storage<10, 16 >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<10, 16>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 16, "");
@@ -57,7 +59,7 @@ int main()
}
{
typedef std::aligned_storage<10, 32 >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<10, 32>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 32, "");
@@ -65,7 +67,7 @@ int main()
}
{
typedef std::aligned_storage<20, 32 >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<20, 32>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 32, "");
@@ -73,7 +75,7 @@ int main()
}
{
typedef std::aligned_storage<40, 32 >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<40, 32>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 32, "");
@@ -81,7 +83,7 @@ int main()
}
{
typedef std::aligned_storage<12, 16 >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<12, 16>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 16, "");
@@ -89,7 +91,7 @@ int main()
}
{
typedef std::aligned_storage<1>::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<1>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 1, "");
@@ -97,7 +99,7 @@ int main()
}
{
typedef std::aligned_storage<2>::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<2>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 2, "");
@@ -105,7 +107,7 @@ int main()
}
{
typedef std::aligned_storage<3>::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<3>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 2, "");
@@ -113,7 +115,7 @@ int main()
}
{
typedef std::aligned_storage<4>::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<4>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 4, "");
@@ -121,7 +123,7 @@ int main()
}
{
typedef std::aligned_storage<5>::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<5>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 4, "");
@@ -129,7 +131,7 @@ int main()
}
{
typedef std::aligned_storage<7>::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<7>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 4, "");
@@ -137,7 +139,7 @@ int main()
}
{
typedef std::aligned_storage<8>::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<8>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 8, "");
@@ -145,7 +147,7 @@ int main()
}
{
typedef std::aligned_storage<9>::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<9>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 8, "");
@@ -153,7 +155,7 @@ int main()
}
{
typedef std::aligned_storage<15>::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<15>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 8, "");
@@ -167,7 +169,7 @@ int main()
#endif
{
typedef std::aligned_storage<16>::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<16>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == alignof(std::max_align_t),
@@ -176,7 +178,7 @@ int main()
}
{
typedef std::aligned_storage<17>::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<17>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == alignof(std::max_align_t),
@@ -185,7 +187,7 @@ int main()
}
{
typedef std::aligned_storage<10>::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_storage_t<10>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 8, "");
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 91bf7e7654e0..e8611253c5d4 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
@@ -13,11 +13,39 @@
#include <type_traits>
+#include "test_macros.h"
+
+struct E {};
+
+template <class T>
+struct X { explicit X(T const&){} };
+
+template <class T>
+struct S { explicit S(T const&){} };
+
+namespace std
+{
+ template <typename T>
+ struct common_type<T, ::S<T> >
+ {
+ typedef S<T> type;
+ };
+}
+
+#if TEST_STD_VER >= 11
+template <class T, class U, class = void>
+struct no_common_type : std::true_type {};
+
+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 {};
+#endif // TEST_STD_VER >= 11
+
int main()
{
static_assert((std::is_same<std::common_type<int>::type, int>::value), "");
static_assert((std::is_same<std::common_type<char>::type, char>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::common_type_t<int>, int>::value), "");
static_assert((std::is_same<std::common_type_t<char>, char>::value), "");
#endif
@@ -29,7 +57,7 @@ int main()
static_assert((std::is_same<std::common_type<int, int>::type, int>::value), "");
static_assert((std::is_same<std::common_type<int, const int>::type, int>::value), "");
-
+
static_assert((std::is_same<std::common_type<long, const int>::type, long>::value), "");
static_assert((std::is_same<std::common_type<const long, int>::type, long>::value), "");
static_assert((std::is_same<std::common_type<long, volatile int>::type, long>::value), "");
@@ -38,15 +66,37 @@ int main()
static_assert((std::is_same<std::common_type<double, char>::type, double>::value), "");
static_assert((std::is_same<std::common_type<short, char>::type, int>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::common_type_t<double, char>, double>::value), "");
static_assert((std::is_same<std::common_type_t<short, char>, int>::value), "");
#endif
static_assert((std::is_same<std::common_type<double, char, long long>::type, double>::value), "");
static_assert((std::is_same<std::common_type<unsigned, char, long long>::type, long long>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::common_type_t<double, char, long long>, double>::value), "");
static_assert((std::is_same<std::common_type_t<unsigned, char, long long>, long long>::value), "");
#endif
+
+ static_assert((std::is_same<std::common_type< void>::type, void>::value), "");
+ static_assert((std::is_same<std::common_type<const void>::type, void>::value), "");
+ static_assert((std::is_same<std::common_type< volatile void>::type, void>::value), "");
+ static_assert((std::is_same<std::common_type<const volatile void>::type, void>::value), "");
+
+ static_assert((std::is_same<std::common_type<void, const void>::type, void>::value), "");
+ static_assert((std::is_same<std::common_type<const void, void>::type, void>::value), "");
+ static_assert((std::is_same<std::common_type<void, volatile void>::type, void>::value), "");
+ 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), "");
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp
index 8150ce04e37f..fb53312cbe67 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp
@@ -22,6 +22,26 @@ void test_add_lvalue_reference()
#endif
}
+template <class F>
+void test_function0()
+{
+ static_assert((std::is_same<typename std::add_lvalue_reference<F>::type, F&>::value), "");
+#if _LIBCPP_STD_VER > 11
+ static_assert((std::is_same<std::add_lvalue_reference_t<F>, F&>::value), "");
+#endif
+}
+
+template <class F>
+void test_function1()
+{
+ static_assert((std::is_same<typename std::add_lvalue_reference<F>::type, F>::value), "");
+#if _LIBCPP_STD_VER > 11
+ static_assert((std::is_same<std::add_lvalue_reference_t<F>, F>::value), "");
+#endif
+}
+
+struct Foo {};
+
int main()
{
test_add_lvalue_reference<void, void>();
@@ -31,4 +51,20 @@ int main()
test_add_lvalue_reference<const int&, const int&>();
test_add_lvalue_reference<int*, int*&>();
test_add_lvalue_reference<const int*, const int*&>();
+
+// LWG 2101 specifically talks about add_lvalue_reference and functions.
+// The term of art is "a referenceable type", which a cv- or ref-qualified function is not.
+ test_function0<void()>();
+// test_function1<void() const>();
+// test_function1<void() &>();
+// test_function1<void() &&>();
+// test_function1<void() const &>();
+// test_function1<void() const &&>();
+
+ test_function0<void (Foo::*)()>();
+ test_function0<void (Foo::*)() const>();
+ test_function0<void (Foo::*)() &>();
+ test_function0<void (Foo::*)() &&>();
+ test_function0<void (Foo::*)() const &>();
+ test_function0<void (Foo::*)() const &&>();
}
diff --git a/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp b/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp
index 6ea1cac789ef..0f55db64719b 100644
--- a/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp
+++ b/test/std/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp
@@ -14,6 +14,8 @@
#include <type_traits>
#include <cstdint>
+#include "test_macros.h"
+
template <class T, unsigned A>
void test_alignment_of()
{
@@ -21,6 +23,12 @@ void test_alignment_of()
static_assert( std::alignment_of<const T>::value == A, "");
static_assert( std::alignment_of<volatile T>::value == A, "");
static_assert( std::alignment_of<const volatile T>::value == A, "");
+#if TEST_STD_VER > 14
+ static_assert( std::alignment_of_v<T> == A, "");
+ static_assert( std::alignment_of_v<const T> == A, "");
+ static_assert( std::alignment_of_v<volatile T> == A, "");
+ static_assert( std::alignment_of_v<const volatile T> == A, "");
+#endif
}
class Class
diff --git a/test/std/utilities/meta/meta.unary.prop.query/extent.pass.cpp b/test/std/utilities/meta/meta.unary.prop.query/extent.pass.cpp
index a99dc6948529..39a7c2b593bb 100644
--- a/test/std/utilities/meta/meta.unary.prop.query/extent.pass.cpp
+++ b/test/std/utilities/meta/meta.unary.prop.query/extent.pass.cpp
@@ -13,6 +13,8 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T, unsigned A>
void test_extent()
{
@@ -20,6 +22,12 @@ void test_extent()
static_assert((std::extent<const T>::value == A), "");
static_assert((std::extent<volatile T>::value == A), "");
static_assert((std::extent<const volatile T>::value == A), "");
+#if TEST_STD_VER > 14
+ static_assert((std::extent_v<T> == A), "");
+ static_assert((std::extent_v<const T> == A), "");
+ static_assert((std::extent_v<volatile T> == A), "");
+ static_assert((std::extent_v<const volatile T> == A), "");
+#endif
}
template <class T, unsigned A>
@@ -29,6 +37,12 @@ void test_extent1()
static_assert((std::extent<const T, 1>::value == A), "");
static_assert((std::extent<volatile T, 1>::value == A), "");
static_assert((std::extent<const volatile T, 1>::value == A), "");
+#if TEST_STD_VER > 14
+ static_assert((std::extent_v<T, 1> == A), "");
+ static_assert((std::extent_v<const T, 1> == A), "");
+ static_assert((std::extent_v<volatile T, 1> == A), "");
+ static_assert((std::extent_v<const volatile T, 1> == A), "");
+#endif
}
class Class
diff --git a/test/std/utilities/meta/meta.unary.prop.query/rank.pass.cpp b/test/std/utilities/meta/meta.unary.prop.query/rank.pass.cpp
index 06f66a92c7c3..755269d1d403 100644
--- a/test/std/utilities/meta/meta.unary.prop.query/rank.pass.cpp
+++ b/test/std/utilities/meta/meta.unary.prop.query/rank.pass.cpp
@@ -13,6 +13,8 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T, unsigned A>
void test_rank()
{
@@ -20,6 +22,12 @@ void test_rank()
static_assert( std::rank<const T>::value == A, "");
static_assert( std::rank<volatile T>::value == A, "");
static_assert( std::rank<const volatile T>::value == A, "");
+#if TEST_STD_VER > 14
+ static_assert( std::rank_v<T> == A, "");
+ static_assert( std::rank_v<const T> == A, "");
+ static_assert( std::rank_v<volatile T> == A, "");
+ static_assert( std::rank_v<const volatile T> == A, "");
+#endif
}
class Class
diff --git a/test/std/utilities/meta/meta.unary.prop.query/void_t.pass.cpp b/test/std/utilities/meta/meta.unary.prop.query/void_t.pass.cpp
index 5deeeff110d4..ccec65fec399 100644
--- a/test/std/utilities/meta/meta.unary.prop.query/void_t.pass.cpp
+++ b/test/std/utilities/meta/meta.unary.prop.query/void_t.pass.cpp
@@ -11,11 +11,11 @@
// void_t
-#include <type_traits>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// XFAIL: gcc-5.1 gcc-5.2
-#if _LIBCPP_STD_VER <= 14
-int main () {}
-#else
+#include <type_traits>
template <class T>
void test1()
@@ -66,4 +66,3 @@ int main()
static_assert( std::is_same<void, std::void_t<int, double const &, Class, volatile int[], void>>::value, "");
}
-#endif
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_array.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_array.pass.cpp
new file mode 100644
index 000000000000..72955defa399
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_array.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.
+//
+//===----------------------------------------------------------------------===//
+
+// type_traits
+
+// is_array
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_array()
+{
+ static_assert( std::is_array<T>::value, "");
+ static_assert( std::is_array<const T>::value, "");
+ static_assert( std::is_array<volatile T>::value, "");
+ static_assert( std::is_array<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_array_v<T>, "");
+ static_assert( std::is_array_v<const T>, "");
+ static_assert( std::is_array_v<volatile T>, "");
+ static_assert( std::is_array_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_array()
+{
+ static_assert(!std::is_array<T>::value, "");
+ static_assert(!std::is_array<const T>::value, "");
+ static_assert(!std::is_array<volatile T>::value, "");
+ static_assert(!std::is_array<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_array_v<T>, "");
+ static_assert(!std::is_array_v<const T>, "");
+ static_assert(!std::is_array_v<volatile T>, "");
+ static_assert(!std::is_array_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+int main()
+{
+ test_is_array<char[3]>();
+ test_is_array<char[]>();
+ test_is_array<Union[]>();
+
+ test_is_not_array<std::nullptr_t>();
+ test_is_not_array<void>();
+ test_is_not_array<int&>();
+ test_is_not_array<int&&>();
+ test_is_not_array<int*>();
+ test_is_not_array<double>();
+ test_is_not_array<const int*>();
+ test_is_not_array<Enum>();
+ test_is_not_array<Union>();
+ test_is_not_array<FunctionPtr>();
+ test_is_not_array<Empty>();
+ test_is_not_array<bit_zero>();
+ test_is_not_array<NotEmpty>();
+ test_is_not_array<Abstract>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_class.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_class.pass.cpp
new file mode 100644
index 000000000000..97671e7b62e0
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_class.pass.cpp
@@ -0,0 +1,98 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// is_class
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_class()
+{
+ static_assert( std::is_class<T>::value, "");
+ static_assert( std::is_class<const T>::value, "");
+ static_assert( std::is_class<volatile T>::value, "");
+ static_assert( std::is_class<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_class_v<T>, "");
+ static_assert( std::is_class_v<const T>, "");
+ static_assert( std::is_class_v<volatile T>, "");
+ static_assert( std::is_class_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_class()
+{
+ static_assert(!std::is_class<T>::value, "");
+ static_assert(!std::is_class<const T>::value, "");
+ static_assert(!std::is_class<volatile T>::value, "");
+ static_assert(!std::is_class<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_class_v<T>, "");
+ static_assert(!std::is_class_v<const T>, "");
+ static_assert(!std::is_class_v<volatile T>, "");
+ static_assert(!std::is_class_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+int main()
+{
+ test_is_class<Empty>();
+ test_is_class<bit_zero>();
+ test_is_class<NotEmpty>();
+ test_is_class<Abstract>();
+
+#if TEST_STD_VER >= 11
+// In C++03 we have an emulation of std::nullptr_t
+ test_is_not_class<std::nullptr_t>();
+#endif
+ test_is_not_class<void>();
+ test_is_not_class<int>();
+ test_is_not_class<int&>();
+#if TEST_STD_VER >= 11
+ test_is_not_class<int&&>();
+#endif
+ test_is_not_class<int*>();
+ test_is_not_class<double>();
+ test_is_not_class<const int*>();
+ test_is_not_class<char[3]>();
+ test_is_not_class<char[]>();
+ test_is_not_class<Enum>();
+ test_is_not_class<Union>();
+ test_is_not_class<FunctionPtr>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_enum.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_enum.pass.cpp
new file mode 100644
index 000000000000..481260ea6e52
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_enum.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.
+//
+//===----------------------------------------------------------------------===//
+
+// type_traits
+
+// is_enum
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_enum()
+{
+ static_assert( std::is_enum<T>::value, "");
+ static_assert( std::is_enum<const T>::value, "");
+ static_assert( std::is_enum<volatile T>::value, "");
+ static_assert( std::is_enum<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_enum_v<T>, "");
+ static_assert( std::is_enum_v<const T>, "");
+ static_assert( std::is_enum_v<volatile T>, "");
+ static_assert( std::is_enum_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_enum()
+{
+ static_assert(!std::is_enum<T>::value, "");
+ static_assert(!std::is_enum<const T>::value, "");
+ static_assert(!std::is_enum<volatile T>::value, "");
+ static_assert(!std::is_enum<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_enum_v<T>, "");
+ static_assert(!std::is_enum_v<const T>, "");
+ static_assert(!std::is_enum_v<volatile T>, "");
+ static_assert(!std::is_enum_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+int main()
+{
+ test_is_enum<Enum>();
+
+ test_is_not_enum<std::nullptr_t>();
+ test_is_not_enum<void>();
+ test_is_not_enum<int>();
+ test_is_not_enum<int&>();
+ test_is_not_enum<int&&>();
+ test_is_not_enum<int*>();
+ test_is_not_enum<double>();
+ test_is_not_enum<const int*>();
+ test_is_not_enum<char[3]>();
+ test_is_not_enum<char[]>();
+ test_is_not_enum<Union>();
+ test_is_not_enum<Empty>();
+ test_is_not_enum<bit_zero>();
+ test_is_not_enum<NotEmpty>();
+ test_is_not_enum<Abstract>();
+ test_is_not_enum<FunctionPtr>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_floating_point.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_floating_point.pass.cpp
new file mode 100644
index 000000000000..de9c146bcb4e
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_floating_point.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.
+//
+//===----------------------------------------------------------------------===//
+
+// type_traits
+
+// is_floating_point
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_floating_point()
+{
+ static_assert( std::is_floating_point<T>::value, "");
+ static_assert( std::is_floating_point<const T>::value, "");
+ static_assert( std::is_floating_point<volatile T>::value, "");
+ static_assert( std::is_floating_point<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_floating_point_v<T>, "");
+ static_assert( std::is_floating_point_v<const T>, "");
+ static_assert( std::is_floating_point_v<volatile T>, "");
+ static_assert( std::is_floating_point_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_floating_point()
+{
+ static_assert(!std::is_floating_point<T>::value, "");
+ static_assert(!std::is_floating_point<const T>::value, "");
+ static_assert(!std::is_floating_point<volatile T>::value, "");
+ static_assert(!std::is_floating_point<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_floating_point_v<T>, "");
+ static_assert(!std::is_floating_point_v<const T>, "");
+ static_assert(!std::is_floating_point_v<volatile T>, "");
+ static_assert(!std::is_floating_point_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+int main()
+{
+ test_is_floating_point<float>();
+ test_is_floating_point<double>();
+ test_is_floating_point<long double>();
+
+ test_is_not_floating_point<short>();
+ test_is_not_floating_point<unsigned short>();
+ test_is_not_floating_point<int>();
+ test_is_not_floating_point<unsigned int>();
+ test_is_not_floating_point<long>();
+ test_is_not_floating_point<unsigned long>();
+
+ test_is_not_floating_point<std::nullptr_t>();
+ test_is_not_floating_point<void>();
+ test_is_not_floating_point<int&>();
+ test_is_not_floating_point<int&&>();
+ test_is_not_floating_point<int*>();
+ test_is_not_floating_point<const int*>();
+ test_is_not_floating_point<char[3]>();
+ test_is_not_floating_point<char[]>();
+ test_is_not_floating_point<Union>();
+ test_is_not_floating_point<Empty>();
+ test_is_not_floating_point<bit_zero>();
+ test_is_not_floating_point<NotEmpty>();
+ test_is_not_floating_point<Abstract>();
+ test_is_not_floating_point<Enum>();
+ test_is_not_floating_point<FunctionPtr>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp
new file mode 100644
index 000000000000..9a1d821b0746
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp
@@ -0,0 +1,98 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// is_function
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_function()
+{
+ static_assert( std::is_function<T>::value, "");
+ static_assert( std::is_function<const T>::value, "");
+ static_assert( std::is_function<volatile T>::value, "");
+ static_assert( std::is_function<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_function_v<T>, "");
+ static_assert( std::is_function_v<const T>, "");
+ static_assert( std::is_function_v<volatile T>, "");
+ static_assert( std::is_function_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_function()
+{
+ static_assert(!std::is_function<T>::value, "");
+ static_assert(!std::is_function<const T>::value, "");
+ static_assert(!std::is_function<volatile T>::value, "");
+ static_assert(!std::is_function<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_function_v<T>, "");
+ static_assert(!std::is_function_v<const T>, "");
+ static_assert(!std::is_function_v<volatile T>, "");
+ static_assert(!std::is_function_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+int main()
+{
+ test_is_function<void(void)>();
+ test_is_function<int(int)>();
+ test_is_function<int(int, double)>();
+ test_is_function<int(Abstract *)>();
+ test_is_function<void(...)>();
+
+ test_is_not_function<std::nullptr_t>();
+ test_is_not_function<void>();
+ test_is_not_function<int>();
+ test_is_not_function<int&>();
+ test_is_not_function<int&&>();
+ test_is_not_function<int*>();
+ test_is_not_function<double>();
+ test_is_not_function<char[3]>();
+ test_is_not_function<char[]>();
+ test_is_not_function<Union>();
+ test_is_not_function<Enum>();
+ test_is_not_function<FunctionPtr>(); // function pointer is not a function
+ test_is_not_function<Empty>();
+ test_is_not_function<bit_zero>();
+ test_is_not_function<NotEmpty>();
+ test_is_not_function<Abstract>();
+ test_is_not_function<Abstract*>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_integral.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_integral.pass.cpp
new file mode 100644
index 000000000000..86b63c53da54
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_integral.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.
+//
+//===----------------------------------------------------------------------===//
+
+// type_traits
+
+// is_integral
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_integral()
+{
+ static_assert( std::is_integral<T>::value, "");
+ static_assert( std::is_integral<const T>::value, "");
+ static_assert( std::is_integral<volatile T>::value, "");
+ static_assert( std::is_integral<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_integral_v<T>, "");
+ static_assert( std::is_integral_v<const T>, "");
+ static_assert( std::is_integral_v<volatile T>, "");
+ static_assert( std::is_integral_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_integral()
+{
+ static_assert(!std::is_integral<T>::value, "");
+ static_assert(!std::is_integral<const T>::value, "");
+ static_assert(!std::is_integral<volatile T>::value, "");
+ static_assert(!std::is_integral<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_integral_v<T>, "");
+ static_assert(!std::is_integral_v<const T>, "");
+ static_assert(!std::is_integral_v<volatile T>, "");
+ static_assert(!std::is_integral_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+
+int main()
+{
+ test_is_integral<short>();
+ test_is_integral<unsigned short>();
+ test_is_integral<int>();
+ test_is_integral<unsigned int>();
+ test_is_integral<long>();
+ test_is_integral<unsigned long>();
+ test_is_integral<bool>();
+ test_is_integral<char>();
+ test_is_integral<signed char>();
+ test_is_integral<unsigned char>();
+ test_is_integral<wchar_t>();
+
+ test_is_not_integral<std::nullptr_t>();
+ test_is_not_integral<void>();
+ test_is_not_integral<int&>();
+ test_is_not_integral<int&&>();
+ test_is_not_integral<int*>();
+ test_is_not_integral<double>();
+ test_is_not_integral<const int*>();
+ test_is_not_integral<char[3]>();
+ test_is_not_integral<char[]>();
+ test_is_not_integral<Union>();
+ test_is_not_integral<Enum>();
+ test_is_not_integral<FunctionPtr>();
+ test_is_not_integral<Empty>();
+ test_is_not_integral<bit_zero>();
+ test_is_not_integral<NotEmpty>();
+ test_is_not_integral<Abstract>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp
new file mode 100644
index 000000000000..0e59f7153f50
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp
@@ -0,0 +1,95 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// is_lvalue_reference
+
+// UNSUPPORTED: c++98, c++03
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_lvalue_reference()
+{
+ static_assert( std::is_lvalue_reference<T>::value, "");
+ static_assert( std::is_lvalue_reference<const T>::value, "");
+ static_assert( std::is_lvalue_reference<volatile T>::value, "");
+ static_assert( std::is_lvalue_reference<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_lvalue_reference_v<T>, "");
+ static_assert( std::is_lvalue_reference_v<const T>, "");
+ static_assert( std::is_lvalue_reference_v<volatile T>, "");
+ static_assert( std::is_lvalue_reference_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_lvalue_reference()
+{
+ static_assert(!std::is_lvalue_reference<T>::value, "");
+ static_assert(!std::is_lvalue_reference<const T>::value, "");
+ static_assert(!std::is_lvalue_reference<volatile T>::value, "");
+ static_assert(!std::is_lvalue_reference<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_lvalue_reference_v<T>, "");
+ static_assert(!std::is_lvalue_reference_v<const T>, "");
+ static_assert(!std::is_lvalue_reference_v<volatile T>, "");
+ static_assert(!std::is_lvalue_reference_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+int main()
+{
+ test_is_lvalue_reference<int&>();
+
+ test_is_not_lvalue_reference<std::nullptr_t>();
+ test_is_not_lvalue_reference<void>();
+ test_is_not_lvalue_reference<int>();
+ test_is_not_lvalue_reference<int*>();
+ test_is_not_lvalue_reference<int&&>();
+ test_is_not_lvalue_reference<double>();
+ test_is_not_lvalue_reference<const int*>();
+ test_is_not_lvalue_reference<char[3]>();
+ test_is_not_lvalue_reference<char[]>();
+ test_is_not_lvalue_reference<Union>();
+ test_is_not_lvalue_reference<Enum>();
+ test_is_not_lvalue_reference<FunctionPtr>();
+ test_is_not_lvalue_reference<Empty>();
+ test_is_not_lvalue_reference<bit_zero>();
+ test_is_not_lvalue_reference<NotEmpty>();
+ test_is_not_lvalue_reference<Abstract>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_object_pointer.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_object_pointer.pass.cpp
new file mode 100644
index 000000000000..8da411d2eeed
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_object_pointer.pass.cpp
@@ -0,0 +1,97 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// is_member_object_pointer
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_member_object_pointer()
+{
+ static_assert( std::is_member_object_pointer<T>::value, "");
+ static_assert( std::is_member_object_pointer<const T>::value, "");
+ static_assert( std::is_member_object_pointer<volatile T>::value, "");
+ static_assert( std::is_member_object_pointer<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_member_object_pointer_v<T>, "");
+ static_assert( std::is_member_object_pointer_v<const T>, "");
+ static_assert( std::is_member_object_pointer_v<volatile T>, "");
+ static_assert( std::is_member_object_pointer_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_member_object_pointer()
+{
+ static_assert(!std::is_member_object_pointer<T>::value, "");
+ static_assert(!std::is_member_object_pointer<const T>::value, "");
+ static_assert(!std::is_member_object_pointer<volatile T>::value, "");
+ static_assert(!std::is_member_object_pointer<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_member_object_pointer_v<T>, "");
+ static_assert(!std::is_member_object_pointer_v<const T>, "");
+ static_assert(!std::is_member_object_pointer_v<volatile T>, "");
+ static_assert(!std::is_member_object_pointer_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+
+int main()
+{
+ test_is_member_object_pointer<int Abstract::*>();
+ test_is_member_object_pointer<double NotEmpty::*>();
+ test_is_member_object_pointer<FunctionPtr Empty::*>();
+
+ test_is_not_member_object_pointer<std::nullptr_t>();
+ test_is_not_member_object_pointer<void>();
+ test_is_not_member_object_pointer<int>();
+ test_is_not_member_object_pointer<int&>();
+ test_is_not_member_object_pointer<int&&>();
+ test_is_not_member_object_pointer<int*>();
+ test_is_not_member_object_pointer<double>();
+ test_is_not_member_object_pointer<const int*>();
+ test_is_not_member_object_pointer<char[3]>();
+ test_is_not_member_object_pointer<char[]>();
+ test_is_not_member_object_pointer<Union>();
+ test_is_not_member_object_pointer<Enum>();
+ test_is_not_member_object_pointer<FunctionPtr>();
+ test_is_not_member_object_pointer<Empty>();
+ test_is_not_member_object_pointer<bit_zero>();
+ test_is_not_member_object_pointer<NotEmpty>();
+ test_is_not_member_object_pointer<Abstract>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp
new file mode 100644
index 000000000000..19a74b01d0fd
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp
@@ -0,0 +1,98 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// is_member_pointer
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_member_pointer()
+{
+ static_assert( std::is_member_pointer<T>::value, "");
+ static_assert( std::is_member_pointer<const T>::value, "");
+ static_assert( std::is_member_pointer<volatile T>::value, "");
+ static_assert( std::is_member_pointer<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_member_pointer_v<T>, "");
+ static_assert( std::is_member_pointer_v<const T>, "");
+ static_assert( std::is_member_pointer_v<volatile T>, "");
+ static_assert( std::is_member_pointer_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_member_pointer()
+{
+ static_assert(!std::is_member_pointer<T>::value, "");
+ static_assert(!std::is_member_pointer<const T>::value, "");
+ static_assert(!std::is_member_pointer<volatile T>::value, "");
+ static_assert(!std::is_member_pointer<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_member_pointer_v<T>, "");
+ static_assert(!std::is_member_pointer_v<const T>, "");
+ static_assert(!std::is_member_pointer_v<volatile T>, "");
+ static_assert(!std::is_member_pointer_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+
+int main()
+{
+ test_is_member_pointer<int Abstract::*>();
+ test_is_member_pointer<double NotEmpty::*>();
+ test_is_member_pointer<FunctionPtr Empty::*>();
+ test_is_member_pointer<void (Empty::*)()>();
+
+ test_is_not_member_pointer<std::nullptr_t>();
+ test_is_not_member_pointer<void>();
+ test_is_not_member_pointer<int>();
+ test_is_not_member_pointer<int&>();
+ test_is_not_member_pointer<int&&>();
+ test_is_not_member_pointer<int*>();
+ test_is_not_member_pointer<double>();
+ test_is_not_member_pointer<const int*>();
+ test_is_not_member_pointer<char[3]>();
+ test_is_not_member_pointer<char[]>();
+ test_is_not_member_pointer<Union>();
+ test_is_not_member_pointer<Enum>();
+ test_is_not_member_pointer<FunctionPtr>();
+ test_is_not_member_pointer<Empty>();
+ test_is_not_member_pointer<bit_zero>();
+ test_is_not_member_pointer<NotEmpty>();
+ test_is_not_member_pointer<Abstract>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_null_pointer.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_null_pointer.pass.cpp
new file mode 100644
index 000000000000..80f563e8969e
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_null_pointer.pass.cpp
@@ -0,0 +1,95 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// is_null_pointer
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_null_pointer()
+{
+ static_assert( std::is_null_pointer<T>::value, "");
+ static_assert( std::is_null_pointer<const T>::value, "");
+ static_assert( std::is_null_pointer<volatile T>::value, "");
+ static_assert( std::is_null_pointer<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_null_pointer_v<T>, "");
+ static_assert( std::is_null_pointer_v<const T>, "");
+ static_assert( std::is_null_pointer_v<volatile T>, "");
+ static_assert( std::is_null_pointer_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_null_pointer()
+{
+ static_assert(!std::is_null_pointer<T>::value, "");
+ static_assert(!std::is_null_pointer<const T>::value, "");
+ static_assert(!std::is_null_pointer<volatile T>::value, "");
+ static_assert(!std::is_null_pointer<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_null_pointer_v<T>, "");
+ static_assert(!std::is_null_pointer_v<const T>, "");
+ static_assert(!std::is_null_pointer_v<volatile T>, "");
+ static_assert(!std::is_null_pointer_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+int main()
+{
+ test_is_null_pointer<std::nullptr_t>();
+
+ test_is_not_null_pointer<void>();
+ test_is_not_null_pointer<int>();
+ test_is_not_null_pointer<int&>();
+ test_is_not_null_pointer<int&&>();
+ test_is_not_null_pointer<int*>();
+ test_is_not_null_pointer<double>();
+ test_is_not_null_pointer<const int*>();
+ test_is_not_null_pointer<char[3]>();
+ test_is_not_null_pointer<char[]>();
+ test_is_not_null_pointer<Union>();
+ test_is_not_null_pointer<Enum>();
+ test_is_not_null_pointer<FunctionPtr>();
+ test_is_not_null_pointer<Empty>();
+ test_is_not_null_pointer<bit_zero>();
+ test_is_not_null_pointer<NotEmpty>();
+ test_is_not_null_pointer<Abstract>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_pointer.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_pointer.pass.cpp
new file mode 100644
index 000000000000..a901aed1143e
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_pointer.pass.cpp
@@ -0,0 +1,94 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// is_pointer
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_pointer()
+{
+ static_assert( std::is_pointer<T>::value, "");
+ static_assert( std::is_pointer<const T>::value, "");
+ static_assert( std::is_pointer<volatile T>::value, "");
+ static_assert( std::is_pointer<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_pointer_v<T>, "");
+ static_assert( std::is_pointer_v<const T>, "");
+ static_assert( std::is_pointer_v<volatile T>, "");
+ static_assert( std::is_pointer_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_pointer()
+{
+ static_assert(!std::is_pointer<T>::value, "");
+ static_assert(!std::is_pointer<const T>::value, "");
+ static_assert(!std::is_pointer<volatile T>::value, "");
+ static_assert(!std::is_pointer<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_pointer_v<T>, "");
+ static_assert(!std::is_pointer_v<const T>, "");
+ static_assert(!std::is_pointer_v<volatile T>, "");
+ static_assert(!std::is_pointer_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+int main()
+{
+ test_is_pointer<void*>();
+ test_is_pointer<int*>();
+ test_is_pointer<const int*>();
+ test_is_pointer<Abstract*>();
+ test_is_pointer<FunctionPtr>();
+
+ test_is_not_pointer<std::nullptr_t>();
+ test_is_not_pointer<void>();
+ test_is_not_pointer<int&>();
+ test_is_not_pointer<int&&>();
+ test_is_not_pointer<double>();
+ test_is_not_pointer<char[3]>();
+ test_is_not_pointer<char[]>();
+ test_is_not_pointer<Union>();
+ test_is_not_pointer<Enum>();
+ test_is_not_pointer<Empty>();
+ test_is_not_pointer<bit_zero>();
+ test_is_not_pointer<NotEmpty>();
+ test_is_not_pointer<Abstract>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp
new file mode 100644
index 000000000000..b7b52687018a
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp
@@ -0,0 +1,95 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// is_rvalue_reference
+
+// UNSUPPORTED: c++98, c++03
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_rvalue_reference()
+{
+ static_assert( std::is_rvalue_reference<T>::value, "");
+ static_assert( std::is_rvalue_reference<const T>::value, "");
+ static_assert( std::is_rvalue_reference<volatile T>::value, "");
+ static_assert( std::is_rvalue_reference<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_rvalue_reference_v<T>, "");
+ static_assert( std::is_rvalue_reference_v<const T>, "");
+ static_assert( std::is_rvalue_reference_v<volatile T>, "");
+ static_assert( std::is_rvalue_reference_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_rvalue_reference()
+{
+ static_assert(!std::is_rvalue_reference<T>::value, "");
+ static_assert(!std::is_rvalue_reference<const T>::value, "");
+ static_assert(!std::is_rvalue_reference<volatile T>::value, "");
+ static_assert(!std::is_rvalue_reference<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_rvalue_reference_v<T>, "");
+ static_assert(!std::is_rvalue_reference_v<const T>, "");
+ static_assert(!std::is_rvalue_reference_v<volatile T>, "");
+ static_assert(!std::is_rvalue_reference_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+int main()
+{
+ test_is_rvalue_reference<int&&>();
+
+ test_is_not_rvalue_reference<std::nullptr_t>();
+ test_is_not_rvalue_reference<void>();
+ test_is_not_rvalue_reference<int>();
+ test_is_not_rvalue_reference<int*>();
+ test_is_not_rvalue_reference<int&>();
+ test_is_not_rvalue_reference<double>();
+ test_is_not_rvalue_reference<const int*>();
+ test_is_not_rvalue_reference<char[3]>();
+ test_is_not_rvalue_reference<char[]>();
+ test_is_not_rvalue_reference<Union>();
+ test_is_not_rvalue_reference<Enum>();
+ test_is_not_rvalue_reference<FunctionPtr>();
+ test_is_not_rvalue_reference<Empty>();
+ test_is_not_rvalue_reference<bit_zero>();
+ test_is_not_rvalue_reference<NotEmpty>();
+ test_is_not_rvalue_reference<Abstract>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_union.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_union.pass.cpp
new file mode 100644
index 000000000000..307fedb32b26
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_union.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.
+//
+//===----------------------------------------------------------------------===//
+
+// type_traits
+
+// is_union
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_union()
+{
+ static_assert( std::is_union<T>::value, "");
+ static_assert( std::is_union<const T>::value, "");
+ static_assert( std::is_union<volatile T>::value, "");
+ static_assert( std::is_union<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_union_v<T>, "");
+ static_assert( std::is_union_v<const T>, "");
+ static_assert( std::is_union_v<volatile T>, "");
+ static_assert( std::is_union_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_union()
+{
+ static_assert(!std::is_union<T>::value, "");
+ static_assert(!std::is_union<const T>::value, "");
+ static_assert(!std::is_union<volatile T>::value, "");
+ static_assert(!std::is_union<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_union_v<T>, "");
+ static_assert(!std::is_union_v<const T>, "");
+ static_assert(!std::is_union_v<volatile T>, "");
+ static_assert(!std::is_union_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+int main()
+{
+ test_is_union<Union>();
+
+ test_is_not_union<std::nullptr_t>();
+ test_is_not_union<void>();
+ test_is_not_union<int>();
+ test_is_not_union<int&>();
+ test_is_not_union<int&&>();
+ test_is_not_union<int*>();
+ test_is_not_union<double>();
+ test_is_not_union<const int*>();
+ test_is_not_union<char[3]>();
+ test_is_not_union<char[]>();
+ test_is_not_union<Enum>();
+ test_is_not_union<FunctionPtr>();
+ test_is_not_union<Empty>();
+ test_is_not_union<bit_zero>();
+ test_is_not_union<NotEmpty>();
+ test_is_not_union<Abstract>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_void.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_void.pass.cpp
new file mode 100644
index 000000000000..1647666adf2e
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_void.pass.cpp
@@ -0,0 +1,92 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// is_void
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_void()
+{
+ static_assert( std::is_void<T>::value, "");
+ static_assert( std::is_void<const T>::value, "");
+ static_assert( std::is_void<volatile T>::value, "");
+ static_assert( std::is_void<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_void_v<T>, "");
+ static_assert( std::is_void_v<const T>, "");
+ static_assert( std::is_void_v<volatile T>, "");
+ static_assert( std::is_void_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_void()
+{
+ static_assert(!std::is_void<T>::value, "");
+ static_assert(!std::is_void<const T>::value, "");
+ static_assert(!std::is_void<volatile T>::value, "");
+ static_assert(!std::is_void<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_void_v<T>, "");
+ static_assert(!std::is_void_v<const T>, "");
+ static_assert(!std::is_void_v<volatile T>, "");
+ static_assert(!std::is_void_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+int main()
+{
+ test_is_void<void>();
+
+ test_is_not_void<int>();
+ test_is_not_void<int*>();
+ test_is_not_void<int&>();
+ test_is_not_void<int&&>();
+ test_is_not_void<double>();
+ test_is_not_void<const int*>();
+ test_is_not_void<char[3]>();
+ test_is_not_void<char[]>();
+ test_is_not_void<Union>();
+ test_is_not_void<Empty>();
+ test_is_not_void<bit_zero>();
+ test_is_not_void<NotEmpty>();
+ test_is_not_void<Abstract>();
+ test_is_not_void<Enum>();
+ test_is_not_void<FunctionPtr>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/nullptr.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/nullptr.pass.cpp
index 691e3536167d..1c7a32fc9dc9 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.cat/nullptr.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/nullptr.pass.cpp
@@ -13,6 +13,7 @@
// is_null_pointer
#include <type_traits>
+#include <cstddef> // for std::nullptr_t
#if _LIBCPP_STD_VER > 11
template <class T>
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.comp/is_arithmetic.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_arithmetic.pass.cpp
new file mode 100644
index 000000000000..a3f18d52a706
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_arithmetic.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.
+//
+//===----------------------------------------------------------------------===//
+
+// type_traits
+
+// is_arithmetic
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_arithmetic()
+{
+ static_assert( std::is_arithmetic<T>::value, "");
+ static_assert( std::is_arithmetic<const T>::value, "");
+ static_assert( std::is_arithmetic<volatile T>::value, "");
+ static_assert( std::is_arithmetic<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_arithmetic_v<T>, "");
+ static_assert( std::is_arithmetic_v<const T>, "");
+ static_assert( std::is_arithmetic_v<volatile T>, "");
+ static_assert( std::is_arithmetic_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_arithmetic()
+{
+ static_assert(!std::is_arithmetic<T>::value, "");
+ static_assert(!std::is_arithmetic<const T>::value, "");
+ static_assert(!std::is_arithmetic<volatile T>::value, "");
+ static_assert(!std::is_arithmetic<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_arithmetic_v<T>, "");
+ static_assert(!std::is_arithmetic_v<const T>, "");
+ static_assert(!std::is_arithmetic_v<volatile T>, "");
+ static_assert(!std::is_arithmetic_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+
+int main()
+{
+ test_is_arithmetic<short>();
+ test_is_arithmetic<unsigned short>();
+ test_is_arithmetic<int>();
+ test_is_arithmetic<unsigned int>();
+ test_is_arithmetic<long>();
+ test_is_arithmetic<unsigned long>();
+ test_is_arithmetic<bool>();
+ test_is_arithmetic<char>();
+ test_is_arithmetic<signed char>();
+ test_is_arithmetic<unsigned char>();
+ test_is_arithmetic<wchar_t>();
+ test_is_arithmetic<double>();
+
+ test_is_not_arithmetic<std::nullptr_t>();
+ test_is_not_arithmetic<void>();
+ test_is_not_arithmetic<int&>();
+ test_is_not_arithmetic<int&&>();
+ test_is_not_arithmetic<int*>();
+ test_is_not_arithmetic<const int*>();
+ test_is_not_arithmetic<char[3]>();
+ test_is_not_arithmetic<char[]>();
+ test_is_not_arithmetic<Union>();
+ test_is_not_arithmetic<Enum>();
+ test_is_not_arithmetic<FunctionPtr>();
+ test_is_not_arithmetic<Empty>();
+ test_is_not_arithmetic<bit_zero>();
+ test_is_not_arithmetic<NotEmpty>();
+ test_is_not_arithmetic<Abstract>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.comp/is_compound.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_compound.pass.cpp
new file mode 100644
index 000000000000..6a1798ab5adc
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_compound.pass.cpp
@@ -0,0 +1,95 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// is_compound
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_compound()
+{
+ static_assert( std::is_compound<T>::value, "");
+ static_assert( std::is_compound<const T>::value, "");
+ static_assert( std::is_compound<volatile T>::value, "");
+ static_assert( std::is_compound<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_compound_v<T>, "");
+ static_assert( std::is_compound_v<const T>, "");
+ static_assert( std::is_compound_v<volatile T>, "");
+ static_assert( std::is_compound_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_compound()
+{
+ static_assert(!std::is_compound<T>::value, "");
+ static_assert(!std::is_compound<const T>::value, "");
+ static_assert(!std::is_compound<volatile T>::value, "");
+ static_assert(!std::is_compound<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_compound_v<T>, "");
+ static_assert(!std::is_compound_v<const T>, "");
+ static_assert(!std::is_compound_v<volatile T>, "");
+ static_assert(!std::is_compound_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+
+int main()
+{
+ test_is_compound<char[3]>();
+ test_is_compound<char[]>();
+ test_is_compound<void *>();
+ test_is_compound<FunctionPtr>();
+ test_is_compound<int&>();
+ test_is_compound<int&&>();
+ test_is_compound<Union>();
+ test_is_compound<Empty>();
+ test_is_compound<bit_zero>();
+ test_is_compound<int*>();
+ test_is_compound<const int*>();
+ test_is_compound<Enum>();
+ test_is_compound<NotEmpty>();
+ test_is_compound<Abstract>();
+
+ test_is_not_compound<std::nullptr_t>();
+ test_is_not_compound<void>();
+ test_is_not_compound<int>();
+ test_is_not_compound<double>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.comp/is_fundamental.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_fundamental.pass.cpp
new file mode 100644
index 000000000000..e16337e05f1c
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_fundamental.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.
+//
+//===----------------------------------------------------------------------===//
+
+// type_traits
+
+// is_fundamental
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_fundamental()
+{
+ static_assert( std::is_fundamental<T>::value, "");
+ static_assert( std::is_fundamental<const T>::value, "");
+ static_assert( std::is_fundamental<volatile T>::value, "");
+ static_assert( std::is_fundamental<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_fundamental_v<T>, "");
+ static_assert( std::is_fundamental_v<const T>, "");
+ static_assert( std::is_fundamental_v<volatile T>, "");
+ static_assert( std::is_fundamental_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_fundamental()
+{
+ static_assert(!std::is_fundamental<T>::value, "");
+ static_assert(!std::is_fundamental<const T>::value, "");
+ static_assert(!std::is_fundamental<volatile T>::value, "");
+ static_assert(!std::is_fundamental<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_fundamental_v<T>, "");
+ static_assert(!std::is_fundamental_v<const T>, "");
+ static_assert(!std::is_fundamental_v<volatile T>, "");
+ static_assert(!std::is_fundamental_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+
+int main()
+{
+ test_is_fundamental<std::nullptr_t>();
+ test_is_fundamental<void>();
+ test_is_fundamental<short>();
+ test_is_fundamental<unsigned short>();
+ test_is_fundamental<int>();
+ test_is_fundamental<unsigned int>();
+ test_is_fundamental<long>();
+ test_is_fundamental<unsigned long>();
+ test_is_fundamental<long long>();
+ test_is_fundamental<unsigned long long>();
+ test_is_fundamental<bool>();
+ test_is_fundamental<char>();
+ test_is_fundamental<signed char>();
+ test_is_fundamental<unsigned char>();
+ test_is_fundamental<wchar_t>();
+ test_is_fundamental<double>();
+ test_is_fundamental<float>();
+ test_is_fundamental<double>();
+ test_is_fundamental<long double>();
+ test_is_fundamental<char16_t>();
+ test_is_fundamental<char32_t>();
+
+ test_is_not_fundamental<char[3]>();
+ test_is_not_fundamental<char[]>();
+ test_is_not_fundamental<void *>();
+ test_is_not_fundamental<FunctionPtr>();
+ test_is_not_fundamental<int&>();
+ test_is_not_fundamental<int&&>();
+ test_is_not_fundamental<Union>();
+ test_is_not_fundamental<Empty>();
+ test_is_not_fundamental<bit_zero>();
+ test_is_not_fundamental<int*>();
+ test_is_not_fundamental<const int*>();
+ test_is_not_fundamental<Enum>();
+ test_is_not_fundamental<NotEmpty>();
+ test_is_not_fundamental<Abstract>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.comp/is_member_pointer.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_member_pointer.pass.cpp
new file mode 100644
index 000000000000..890da659e218
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_member_pointer.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.
+//
+//===----------------------------------------------------------------------===//
+
+// type_traits
+
+// is_member_pointer
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_member_pointer()
+{
+ static_assert( std::is_member_pointer<T>::value, "");
+ static_assert( std::is_member_pointer<const T>::value, "");
+ static_assert( std::is_member_pointer<volatile T>::value, "");
+ static_assert( std::is_member_pointer<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_member_pointer_v<T>, "");
+ static_assert( std::is_member_pointer_v<const T>, "");
+ static_assert( std::is_member_pointer_v<volatile T>, "");
+ static_assert( std::is_member_pointer_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_member_pointer()
+{
+ static_assert(!std::is_member_pointer<T>::value, "");
+ static_assert(!std::is_member_pointer<const T>::value, "");
+ static_assert(!std::is_member_pointer<volatile T>::value, "");
+ static_assert(!std::is_member_pointer<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_member_pointer_v<T>, "");
+ static_assert(!std::is_member_pointer_v<const T>, "");
+ static_assert(!std::is_member_pointer_v<volatile T>, "");
+ static_assert(!std::is_member_pointer_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+
+int main()
+{
+// Arithmetic types (3.9.1), enumeration types, pointer types, pointer to member types (3.9.2),
+// std::nullptr_t, and cv-qualified versions of these types (3.9.3)
+// are collectively called scalar types.
+
+ test_is_member_pointer<int Empty::*>();
+ test_is_member_pointer<void (Empty::*)(int)>();
+
+ test_is_not_member_pointer<std::nullptr_t>();
+ test_is_not_member_pointer<void>();
+ test_is_not_member_pointer<void *>();
+ test_is_not_member_pointer<int>();
+ test_is_not_member_pointer<int*>();
+ test_is_not_member_pointer<const int*>();
+ test_is_not_member_pointer<int&>();
+ test_is_not_member_pointer<int&&>();
+ test_is_not_member_pointer<double>();
+ test_is_not_member_pointer<char[3]>();
+ test_is_not_member_pointer<char[]>();
+ test_is_not_member_pointer<Union>();
+ test_is_not_member_pointer<Empty>();
+ test_is_not_member_pointer<bit_zero>();
+ test_is_not_member_pointer<NotEmpty>();
+ test_is_not_member_pointer<Abstract>();
+ test_is_not_member_pointer<int(int)>();
+ test_is_not_member_pointer<Enum>();
+ test_is_not_member_pointer<FunctionPtr>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.comp/is_object.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_object.pass.cpp
new file mode 100644
index 000000000000..ff7dda30d111
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_object.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.
+//
+//===----------------------------------------------------------------------===//
+
+// type_traits
+
+// is_object
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_object()
+{
+ static_assert( std::is_object<T>::value, "");
+ static_assert( std::is_object<const T>::value, "");
+ static_assert( std::is_object<volatile T>::value, "");
+ static_assert( std::is_object<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_object_v<T>, "");
+ static_assert( std::is_object_v<const T>, "");
+ static_assert( std::is_object_v<volatile T>, "");
+ static_assert( std::is_object_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_object()
+{
+ static_assert(!std::is_object<T>::value, "");
+ static_assert(!std::is_object<const T>::value, "");
+ static_assert(!std::is_object<volatile T>::value, "");
+ static_assert(!std::is_object<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_object_v<T>, "");
+ static_assert(!std::is_object_v<const T>, "");
+ static_assert(!std::is_object_v<volatile T>, "");
+ static_assert(!std::is_object_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+
+int main()
+{
+// An object type is a (possibly cv-qualified) type that is not a function type,
+// not a reference type, and not a void type.
+
+ test_is_object<std::nullptr_t>();
+ test_is_object<void *>();
+ test_is_object<char[3]>();
+ test_is_object<char[]>();
+ test_is_object<int>();
+ test_is_object<int*>();
+ test_is_object<Union>();
+ test_is_object<int*>();
+ test_is_object<const int*>();
+ test_is_object<Enum>();
+ test_is_object<Empty>();
+ test_is_object<bit_zero>();
+ test_is_object<NotEmpty>();
+ test_is_object<Abstract>();
+ test_is_object<FunctionPtr>();
+ test_is_object<int Empty::*>();
+ test_is_object<void (Empty::*)(int)>();
+
+ test_is_not_object<void>();
+ test_is_not_object<int&>();
+ test_is_not_object<int&&>();
+ test_is_not_object<int(int)>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.comp/is_reference.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_reference.pass.cpp
new file mode 100644
index 000000000000..e56c8f761814
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_reference.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.
+//
+//===----------------------------------------------------------------------===//
+
+// type_traits
+
+// is_reference
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_reference()
+{
+ static_assert( std::is_reference<T>::value, "");
+ static_assert( std::is_reference<const T>::value, "");
+ static_assert( std::is_reference<volatile T>::value, "");
+ static_assert( std::is_reference<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_reference_v<T>, "");
+ static_assert( std::is_reference_v<const T>, "");
+ static_assert( std::is_reference_v<volatile T>, "");
+ static_assert( std::is_reference_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_reference()
+{
+ static_assert(!std::is_reference<T>::value, "");
+ static_assert(!std::is_reference<const T>::value, "");
+ static_assert(!std::is_reference<volatile T>::value, "");
+ static_assert(!std::is_reference<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_reference_v<T>, "");
+ static_assert(!std::is_reference_v<const T>, "");
+ static_assert(!std::is_reference_v<volatile T>, "");
+ static_assert(!std::is_reference_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+
+int main()
+{
+ test_is_reference<int&>();
+#if TEST_STD_VER >= 11
+ test_is_reference<int&&>();
+#endif
+
+ test_is_not_reference<std::nullptr_t>();
+ test_is_not_reference<void>();
+ test_is_not_reference<int>();
+ test_is_not_reference<double>();
+ test_is_not_reference<char[3]>();
+ test_is_not_reference<char[]>();
+ test_is_not_reference<void *>();
+ test_is_not_reference<FunctionPtr>();
+ test_is_not_reference<Union>();
+ test_is_not_reference<Empty>();
+ test_is_not_reference<bit_zero>();
+ test_is_not_reference<int*>();
+ test_is_not_reference<const int*>();
+ test_is_not_reference<Enum>();
+ test_is_not_reference<NotEmpty>();
+ test_is_not_reference<Abstract>();
+ test_is_not_reference<int(int)>();
+ test_is_not_reference<int Empty::*>();
+ test_is_not_reference<void (Empty::*)(int)>();
+
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.comp/is_scalar.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_scalar.pass.cpp
new file mode 100644
index 000000000000..2b412a68833b
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_scalar.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.
+//
+//===----------------------------------------------------------------------===//
+
+// type_traits
+
+// is_scalar
+
+#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
+
+template <class T>
+void test_is_scalar()
+{
+ static_assert( std::is_scalar<T>::value, "");
+ static_assert( std::is_scalar<const T>::value, "");
+ static_assert( std::is_scalar<volatile T>::value, "");
+ static_assert( std::is_scalar<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_scalar_v<T>, "");
+ static_assert( std::is_scalar_v<const T>, "");
+ static_assert( std::is_scalar_v<volatile T>, "");
+ static_assert( std::is_scalar_v<const volatile T>, "");
+#endif
+}
+
+template <class T>
+void test_is_not_scalar()
+{
+ static_assert(!std::is_scalar<T>::value, "");
+ static_assert(!std::is_scalar<const T>::value, "");
+ static_assert(!std::is_scalar<volatile T>::value, "");
+ static_assert(!std::is_scalar<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_scalar_v<T>, "");
+ static_assert(!std::is_scalar_v<const T>, "");
+ static_assert(!std::is_scalar_v<volatile T>, "");
+ static_assert(!std::is_scalar_v<const volatile T>, "");
+#endif
+}
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
+
+int main()
+{
+// Arithmetic types (3.9.1), enumeration types, pointer types, pointer to member types (3.9.2),
+// std::nullptr_t, and cv-qualified versions of these types (3.9.3)
+// are collectively called scalar types.
+
+ test_is_scalar<std::nullptr_t>();
+ test_is_scalar<short>();
+ test_is_scalar<unsigned short>();
+ test_is_scalar<int>();
+ test_is_scalar<unsigned int>();
+ test_is_scalar<long>();
+ test_is_scalar<unsigned long>();
+ test_is_scalar<bool>();
+ test_is_scalar<char>();
+ test_is_scalar<signed char>();
+ test_is_scalar<unsigned char>();
+ test_is_scalar<wchar_t>();
+ test_is_scalar<double>();
+ test_is_scalar<int*>();
+ test_is_scalar<const int*>();
+ test_is_scalar<int Empty::*>();
+ test_is_scalar<void (Empty::*)(int)>();
+ test_is_scalar<Enum>();
+ test_is_scalar<FunctionPtr>();
+
+ test_is_not_scalar<void>();
+ test_is_not_scalar<int&>();
+ test_is_not_scalar<int&&>();
+ test_is_not_scalar<char[3]>();
+ test_is_not_scalar<char[]>();
+ test_is_not_scalar<Union>();
+ test_is_not_scalar<Empty>();
+ test_is_not_scalar<bit_zero>();
+ test_is_not_scalar<NotEmpty>();
+ test_is_not_scalar<Abstract>();
+ test_is_not_scalar<int(int)>();
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/has_virtual_destructor.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/has_virtual_destructor.pass.cpp
index 685d30de692f..36020139ec58 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/has_virtual_destructor.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/has_virtual_destructor.pass.cpp
@@ -20,6 +20,12 @@ void test_has_virtual_destructor()
static_assert( std::has_virtual_destructor<const T>::value, "");
static_assert( std::has_virtual_destructor<volatile T>::value, "");
static_assert( std::has_virtual_destructor<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::has_virtual_destructor_v<T>, "");
+ static_assert( std::has_virtual_destructor_v<const T>, "");
+ static_assert( std::has_virtual_destructor_v<volatile T>, "");
+ static_assert( std::has_virtual_destructor_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +35,12 @@ void test_has_not_virtual_destructor()
static_assert(!std::has_virtual_destructor<const T>::value, "");
static_assert(!std::has_virtual_destructor<volatile T>::value, "");
static_assert(!std::has_virtual_destructor<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::has_virtual_destructor_v<T>, "");
+ static_assert(!std::has_virtual_destructor_v<const T>, "");
+ static_assert(!std::has_virtual_destructor_v<volatile T>, "");
+ static_assert(!std::has_virtual_destructor_v<const volatile T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_abstract.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_abstract.pass.cpp
index f2a8c23246b1..a54adf10258f 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_abstract.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_abstract.pass.cpp
@@ -12,6 +12,7 @@
// is_abstract
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_abstract()
@@ -20,6 +21,12 @@ void test_is_abstract()
static_assert( std::is_abstract<const T>::value, "");
static_assert( std::is_abstract<volatile T>::value, "");
static_assert( std::is_abstract<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_abstract_v<T>, "");
+ static_assert( std::is_abstract_v<const T>, "");
+ static_assert( std::is_abstract_v<volatile T>, "");
+ static_assert( std::is_abstract_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +36,12 @@ void test_is_not_abstract()
static_assert(!std::is_abstract<const T>::value, "");
static_assert(!std::is_abstract<volatile T>::value, "");
static_assert(!std::is_abstract<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_abstract_v<T>, "");
+ static_assert(!std::is_abstract_v<const T>, "");
+ static_assert(!std::is_abstract_v<volatile T>, "");
+ static_assert(!std::is_abstract_v<const volatile T>, "");
+#endif
}
class Empty
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 d33019bcba9e..c0f6bb9bdfaf 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
@@ -12,6 +12,7 @@
// is_assignable
#include <type_traits>
+#include "test_macros.h"
struct A
{
@@ -26,12 +27,18 @@ template <class T, class U>
void test_is_assignable()
{
static_assert(( std::is_assignable<T, U>::value), "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_assignable_v<T, U>, "");
+#endif
}
template <class T, class U>
void test_is_not_assignable()
{
static_assert((!std::is_assignable<T, U>::value), "");
+#if TEST_STD_VER > 14
+ static_assert( !std::is_assignable_v<T, U>, "");
+#endif
}
struct D;
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_const.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_const.pass.cpp
index 72f2ff458921..7f63ae40aca7 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_const.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_const.pass.cpp
@@ -12,6 +12,7 @@
// is_const
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_const()
@@ -20,6 +21,12 @@ void test_is_const()
static_assert( std::is_const<const T>::value, "");
static_assert(!std::is_const<volatile T>::value, "");
static_assert( std::is_const<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_const_v<T>, "");
+ static_assert( std::is_const_v<const T>, "");
+ static_assert(!std::is_const_v<volatile T>, "");
+ static_assert( std::is_const_v<const volatile T>, "");
+#endif
}
int main()
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 2b8f7efec602..5401d95532b1 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
@@ -13,6 +13,7 @@
// struct is_constructible;
#include <type_traits>
+#include "test_macros.h"
struct A
{
@@ -38,30 +39,45 @@ template <class T>
void test_is_constructible()
{
static_assert( (std::is_constructible<T>::value), "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_constructible_v<T>, "");
+#endif
}
template <class T, class A0>
void test_is_constructible()
{
- static_assert( (std::is_constructible<T, A0>::value), "");
+ static_assert(( std::is_constructible<T, A0>::value), "");
+#if TEST_STD_VER > 14
+ static_assert(( std::is_constructible_v<T, A0>), "");
+#endif
}
template <class T, class A0, class A1>
void test_is_constructible()
{
- static_assert( (std::is_constructible<T, A0, A1>::value), "");
+ static_assert(( std::is_constructible<T, A0, A1>::value), "");
+#if TEST_STD_VER > 14
+ static_assert(( std::is_constructible_v<T, A0, A1>), "");
+#endif
}
template <class T>
void test_is_not_constructible()
{
static_assert((!std::is_constructible<T>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_constructible_v<T>), "");
+#endif
}
template <class T, class A0>
void test_is_not_constructible()
{
static_assert((!std::is_constructible<T, A0>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_constructible_v<T, A0>), "");
+#endif
}
int main()
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 c43d59479fb2..421f865a623c 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
@@ -12,17 +12,24 @@
// is_copy_assignable
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_copy_assignable()
{
static_assert(( std::is_copy_assignable<T>::value), "");
+#if TEST_STD_VER > 14
+ static_assert(( std::is_copy_assignable_v<T>), "");
+#endif
}
template <class T>
void test_is_not_copy_assignable()
{
static_assert((!std::is_copy_assignable<T>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_copy_assignable_v<T>), "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_constructible.pass.cpp
index f878a50c3af5..fe2e01429b22 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_constructible.pass.cpp
@@ -12,17 +12,24 @@
// is_copy_constructible
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_copy_constructible()
{
static_assert( std::is_copy_constructible<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_copy_constructible_v<T>, "");
+#endif
}
template <class T>
void test_is_not_copy_constructible()
{
static_assert(!std::is_copy_constructible<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_copy_constructible_v<T>, "");
+#endif
}
class Empty
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 c8d5c42fbf89..7b46eeaab66b 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
@@ -12,6 +12,7 @@
// is_default_constructible
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_default_constructible()
@@ -20,6 +21,12 @@ void test_is_default_constructible()
static_assert( std::is_default_constructible<const T>::value, "");
static_assert( std::is_default_constructible<volatile T>::value, "");
static_assert( std::is_default_constructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_default_constructible_v<T>, "");
+ static_assert( std::is_default_constructible_v<const T>, "");
+ static_assert( std::is_default_constructible_v<volatile T>, "");
+ static_assert( std::is_default_constructible_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +36,12 @@ void test_is_not_default_constructible()
static_assert(!std::is_default_constructible<const T>::value, "");
static_assert(!std::is_default_constructible<volatile T>::value, "");
static_assert(!std::is_default_constructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_default_constructible_v<T>, "");
+ static_assert(!std::is_default_constructible_v<const T>, "");
+ static_assert(!std::is_default_constructible_v<volatile T>, "");
+ static_assert(!std::is_default_constructible_v<const volatile T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp
index 807745ef66c1..60d607aba61c 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp
@@ -12,6 +12,7 @@
// is_destructible
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_destructible()
@@ -20,6 +21,12 @@ void test_is_destructible()
static_assert( std::is_destructible<const T>::value, "");
static_assert( std::is_destructible<volatile T>::value, "");
static_assert( std::is_destructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_destructible_v<T>, "");
+ static_assert( std::is_destructible_v<const T>, "");
+ static_assert( std::is_destructible_v<volatile T>, "");
+ static_assert( std::is_destructible_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +36,12 @@ void test_is_not_destructible()
static_assert(!std::is_destructible<const T>::value, "");
static_assert(!std::is_destructible<volatile T>::value, "");
static_assert(!std::is_destructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_destructible_v<T>, "");
+ static_assert(!std::is_destructible_v<const T>, "");
+ static_assert(!std::is_destructible_v<volatile T>, "");
+ static_assert(!std::is_destructible_v<const volatile T>, "");
+#endif
}
class Empty {};
@@ -68,6 +81,7 @@ struct PurePublicDestructor { public: virtual ~PurePublicDestruc
struct PureProtectedDestructor { protected: virtual ~PureProtectedDestructor() = 0; };
struct PurePrivateDestructor { private: virtual ~PurePrivateDestructor() = 0; };
+#if TEST_STD_VER >= 11
struct DeletedPublicDestructor { public: ~DeletedPublicDestructor() = delete; };
struct DeletedProtectedDestructor { protected: ~DeletedProtectedDestructor() = delete; };
struct DeletedPrivateDestructor { private: ~DeletedPrivateDestructor() = delete; };
@@ -75,6 +89,7 @@ struct DeletedPrivateDestructor { private: ~DeletedPrivateDestructor(
struct DeletedVirtualPublicDestructor { public: virtual ~DeletedVirtualPublicDestructor() = delete; };
struct DeletedVirtualProtectedDestructor { protected: virtual ~DeletedVirtualProtectedDestructor() = delete; };
struct DeletedVirtualPrivateDestructor { private: virtual ~DeletedVirtualPrivateDestructor() = delete; };
+#endif
int main()
@@ -99,23 +114,27 @@ int main()
test_is_not_destructible<int[]>();
test_is_not_destructible<void>();
+ test_is_not_destructible<Function>();
+#if TEST_STD_VER >= 11
+ // Test access controlled destructors
test_is_not_destructible<ProtectedDestructor>();
test_is_not_destructible<PrivateDestructor>();
test_is_not_destructible<VirtualProtectedDestructor>();
test_is_not_destructible<VirtualPrivateDestructor>();
test_is_not_destructible<PureProtectedDestructor>();
test_is_not_destructible<PurePrivateDestructor>();
+
+ // Test deleted constructors
test_is_not_destructible<DeletedPublicDestructor>();
test_is_not_destructible<DeletedProtectedDestructor>();
test_is_not_destructible<DeletedPrivateDestructor>();
-
-// test_is_not_destructible<DeletedVirtualPublicDestructor>(); // currently fails due to clang bug #20268
+ //test_is_not_destructible<DeletedVirtualPublicDestructor>(); // previously failed due to clang bug #20268
test_is_not_destructible<DeletedVirtualProtectedDestructor>();
test_is_not_destructible<DeletedVirtualPrivateDestructor>();
-#if __has_feature(cxx_access_control_sfinae)
+ // Test private destructors
test_is_not_destructible<NotEmpty>();
#endif
- test_is_not_destructible<Function>();
+
}
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 47af3c45cdea..410c1db7244d 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
@@ -12,6 +12,7 @@
// is_empty
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_empty()
@@ -20,6 +21,12 @@ void test_is_empty()
static_assert( std::is_empty<const T>::value, "");
static_assert( std::is_empty<volatile T>::value, "");
static_assert( std::is_empty<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_empty_v<T>, "");
+ static_assert( std::is_empty_v<const T>, "");
+ static_assert( std::is_empty_v<volatile T>, "");
+ static_assert( std::is_empty_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +36,12 @@ void test_is_not_empty()
static_assert(!std::is_empty<const T>::value, "");
static_assert(!std::is_empty<volatile T>::value, "");
static_assert(!std::is_empty<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_empty_v<T>, "");
+ static_assert(!std::is_empty_v<const T>, "");
+ static_assert(!std::is_empty_v<volatile T>, "");
+ static_assert(!std::is_empty_v<const volatile T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_final.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_final.pass.cpp
index cf32196213e1..baf85e3e8139 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_final.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_final.pass.cpp
@@ -12,6 +12,7 @@
// is_final
#include <type_traits>
+#include "test_macros.h"
#if _LIBCPP_STD_VER > 11
@@ -26,6 +27,12 @@ void test_is_final()
static_assert( std::is_final<const T>::value, "");
static_assert( std::is_final<volatile T>::value, "");
static_assert( std::is_final<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_final_v<T>, "");
+ static_assert( std::is_final_v<const T>, "");
+ static_assert( std::is_final_v<volatile T>, "");
+ static_assert( std::is_final_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -35,6 +42,12 @@ void test_is_not_final()
static_assert(!std::is_final<const T>::value, "");
static_assert(!std::is_final<volatile T>::value, "");
static_assert(!std::is_final<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_final_v<T>, "");
+ static_assert(!std::is_final_v<const T>, "");
+ static_assert(!std::is_final_v<volatile T>, "");
+ static_assert(!std::is_final_v<const volatile T>, "");
+#endif
}
int main ()
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp
index ce781cd936b0..59aa5e26a292 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp
@@ -12,35 +12,94 @@
// is_literal_type
#include <type_traits>
+#include <cstddef> // for std::nullptr_t
+#include "test_macros.h"
template <class T>
void test_is_literal_type()
{
static_assert( std::is_literal_type<T>::value, "");
+ static_assert( std::is_literal_type<const T>::value, "");
+ static_assert( std::is_literal_type<volatile T>::value, "");
+ static_assert( std::is_literal_type<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_literal_type_v<T>, "");
+ static_assert( std::is_literal_type_v<const T>, "");
+ static_assert( std::is_literal_type_v<volatile T>, "");
+ static_assert( std::is_literal_type_v<const volatile T>, "");
+#endif
}
template <class T>
void test_is_not_literal_type()
{
static_assert(!std::is_literal_type<T>::value, "");
+ static_assert(!std::is_literal_type<const T>::value, "");
+ static_assert(!std::is_literal_type<volatile T>::value, "");
+ static_assert(!std::is_literal_type<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_literal_type_v<T>, "");
+ static_assert(!std::is_literal_type_v<const T>, "");
+ static_assert(!std::is_literal_type_v<volatile T>, "");
+ static_assert(!std::is_literal_type_v<const volatile T>, "");
+#endif
}
-struct A
+class Empty
{
};
-struct B
+class NotEmpty
{
- B();
+ virtual ~NotEmpty();
};
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+ virtual ~Abstract() = 0;
+};
+
+enum Enum {zero, one};
+
+typedef void (*FunctionPtr)();
+
int main()
{
- test_is_literal_type<int> ();
- test_is_literal_type<const int> ();
- test_is_literal_type<int&> ();
- test_is_literal_type<volatile int&> ();
- test_is_literal_type<A> ();
+#if TEST_STD_VER >= 11
+ test_is_literal_type<std::nullptr_t>();
+#endif
+
+// Before C++14, void was not a literal type
+// In C++14, cv-void is is a literal type
+#if TEST_STD_VER < 14
+ test_is_not_literal_type<void>();
+#else
+ test_is_literal_type<void>();
+#endif
+
+ test_is_literal_type<int>();
+ test_is_literal_type<int*>();
+ test_is_literal_type<const int*>();
+ test_is_literal_type<int&>();
+#if TEST_STD_VER >= 11
+ test_is_literal_type<int&&>();
+#endif
+ test_is_literal_type<double>();
+ test_is_literal_type<char[3]>();
+ test_is_literal_type<char[]>();
+ test_is_literal_type<Empty>();
+ test_is_literal_type<bit_zero>();
+ test_is_literal_type<Union>();
+ test_is_literal_type<Enum>();
+ test_is_literal_type<FunctionPtr>();
- test_is_not_literal_type<B> ();
+ test_is_not_literal_type<NotEmpty>();
+ test_is_not_literal_type<Abstract>();
}
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 a89ee7d4e490..613c1123e3fa 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
@@ -12,17 +12,24 @@
// is_move_assignable
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_move_assignable()
{
- static_assert( std::is_move_assignable<T>::value, "");
+ static_assert(( std::is_move_assignable<T>::value), "");
+#if TEST_STD_VER > 14
+ static_assert(( std::is_move_assignable_v<T>), "");
+#endif
}
template <class T>
void test_is_not_move_assignable()
{
- static_assert(!std::is_move_assignable<T>::value, "");
+ static_assert((!std::is_move_assignable<T>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_move_assignable_v<T>), "");
+#endif
}
class Empty
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 7409ebaa56c8..07c283bf8890 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
@@ -12,17 +12,24 @@
// is_move_constructible
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_move_constructible()
{
static_assert( std::is_move_constructible<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_move_constructible_v<T>, "");
+#endif
}
template <class T>
void test_is_not_move_constructible()
{
static_assert(!std::is_move_constructible<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_move_constructible_v<T>, "");
+#endif
}
class Empty
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 8fff5f8b3de3..9d629dc7ef46 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
@@ -12,17 +12,24 @@
// is_nothrow_assignable
#include <type_traits>
+#include "test_macros.h"
template <class T, class U>
void test_is_nothrow_assignable()
{
static_assert(( std::is_nothrow_assignable<T, U>::value), "");
+#if TEST_STD_VER > 14
+ static_assert(( std::is_nothrow_assignable_v<T, U>), "");
+#endif
}
template <class T, class U>
void test_is_not_nothrow_assignable()
{
static_assert((!std::is_nothrow_assignable<T, U>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_nothrow_assignable_v<T, U>), "");
+#endif
}
struct A
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 fe0b5673bc44..c778a5d24b2e 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
@@ -13,35 +13,51 @@
// struct is_nothrow_constructible;
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_nothrow_constructible()
{
static_assert(( std::is_nothrow_constructible<T>::value), "");
+#if TEST_STD_VER > 14
+ static_assert(( std::is_nothrow_constructible_v<T>), "");
+#endif
}
template <class T, class A0>
void test_is_nothrow_constructible()
{
static_assert(( std::is_nothrow_constructible<T, A0>::value), "");
+#if TEST_STD_VER > 14
+ static_assert(( std::is_nothrow_constructible_v<T, A0>), "");
+#endif
}
template <class T>
void test_is_not_nothrow_constructible()
{
static_assert((!std::is_nothrow_constructible<T>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_nothrow_constructible_v<T>), "");
+#endif
}
template <class T, class A0>
void test_is_not_nothrow_constructible()
{
static_assert((!std::is_nothrow_constructible<T, A0>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_nothrow_constructible_v<T, A0>), "");
+#endif
}
template <class T, class A0, class A1>
void test_is_not_nothrow_constructible()
{
static_assert((!std::is_nothrow_constructible<T, A0, A1>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_nothrow_constructible_v<T, A0, A1>), "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_assignable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_assignable.pass.cpp
index d843803cf21d..01c9bd0d0941 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_assignable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_assignable.pass.cpp
@@ -12,17 +12,24 @@
// is_nothrow_copy_assignable
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_has_nothrow_assign()
{
static_assert( std::is_nothrow_copy_assignable<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_nothrow_copy_assignable_v<T>, "");
+#endif
}
template <class T>
void test_has_not_nothrow_assign()
{
static_assert(!std::is_nothrow_copy_assignable<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_nothrow_copy_assignable_v<T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_constructible.pass.cpp
index 99fce65dcc7e..9dbdc4e2acfb 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_constructible.pass.cpp
@@ -12,12 +12,17 @@
// is_nothrow_copy_constructible
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_nothrow_copy_constructible()
{
static_assert( std::is_nothrow_copy_constructible<T>::value, "");
static_assert( std::is_nothrow_copy_constructible<const T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_nothrow_copy_constructible_v<T>, "");
+ static_assert( std::is_nothrow_copy_constructible_v<const T>, "");
+#endif
}
template <class T>
@@ -27,6 +32,12 @@ void test_has_not_nothrow_copy_constructor()
static_assert(!std::is_nothrow_copy_constructible<const T>::value, "");
static_assert(!std::is_nothrow_copy_constructible<volatile T>::value, "");
static_assert(!std::is_nothrow_copy_constructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_nothrow_copy_constructible_v<T>, "");
+ static_assert(!std::is_nothrow_copy_constructible_v<const T>, "");
+ static_assert(!std::is_nothrow_copy_constructible_v<volatile T>, "");
+ static_assert(!std::is_nothrow_copy_constructible_v<const volatile T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp
index 1550dff08bb5..c89ac8944a93 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp
@@ -12,6 +12,7 @@
// is_nothrow_default_constructible
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_nothrow_default_constructible()
@@ -20,6 +21,12 @@ void test_is_nothrow_default_constructible()
static_assert( std::is_nothrow_default_constructible<const T>::value, "");
static_assert( std::is_nothrow_default_constructible<volatile T>::value, "");
static_assert( std::is_nothrow_default_constructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_nothrow_default_constructible_v<T>, "");
+ static_assert( std::is_nothrow_default_constructible_v<const T>, "");
+ static_assert( std::is_nothrow_default_constructible_v<volatile T>, "");
+ static_assert( std::is_nothrow_default_constructible_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +36,12 @@ void test_has_not_nothrow_default_constructor()
static_assert(!std::is_nothrow_default_constructible<const T>::value, "");
static_assert(!std::is_nothrow_default_constructible<volatile T>::value, "");
static_assert(!std::is_nothrow_default_constructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_nothrow_default_constructible_v<T>, "");
+ static_assert(!std::is_nothrow_default_constructible_v<const T>, "");
+ static_assert(!std::is_nothrow_default_constructible_v<volatile T>, "");
+ static_assert(!std::is_nothrow_default_constructible_v<const volatile T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp
index 8fd5bab5a019..42c9807efa83 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp
@@ -12,6 +12,7 @@
// is_nothrow_destructible
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_nothrow_destructible()
@@ -20,6 +21,12 @@ void test_is_nothrow_destructible()
static_assert( std::is_nothrow_destructible<const T>::value, "");
static_assert( std::is_nothrow_destructible<volatile T>::value, "");
static_assert( std::is_nothrow_destructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_nothrow_destructible_v<T>, "");
+ static_assert( std::is_nothrow_destructible_v<const T>, "");
+ static_assert( std::is_nothrow_destructible_v<volatile T>, "");
+ static_assert( std::is_nothrow_destructible_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,16 +36,31 @@ void test_is_not_nothrow_destructible()
static_assert(!std::is_nothrow_destructible<const T>::value, "");
static_assert(!std::is_nothrow_destructible<volatile T>::value, "");
static_assert(!std::is_nothrow_destructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_nothrow_destructible_v<T>, "");
+ static_assert(!std::is_nothrow_destructible_v<const T>, "");
+ static_assert(!std::is_nothrow_destructible_v<volatile T>, "");
+ static_assert(!std::is_nothrow_destructible_v<const volatile T>, "");
+#endif
}
+
+struct PublicDestructor { public: ~PublicDestructor() {}};
+struct ProtectedDestructor { protected: ~ProtectedDestructor() {}};
+struct PrivateDestructor { private: ~PrivateDestructor() {}};
+
+struct VirtualPublicDestructor { public: virtual ~VirtualPublicDestructor() {}};
+struct VirtualProtectedDestructor { protected: virtual ~VirtualProtectedDestructor() {}};
+struct VirtualPrivateDestructor { private: virtual ~VirtualPrivateDestructor() {}};
+
+struct PurePublicDestructor { public: virtual ~PurePublicDestructor() = 0; };
+struct PureProtectedDestructor { protected: virtual ~PureProtectedDestructor() = 0; };
+struct PurePrivateDestructor { private: virtual ~PurePrivateDestructor() = 0; };
+
class Empty
{
};
-class NotEmpty
-{
- virtual ~NotEmpty();
-};
union Union {};
@@ -52,40 +74,36 @@ class Abstract
virtual void foo() = 0;
};
-class AbstractDestructor
-{
- virtual ~AbstractDestructor() = 0;
-};
-
-struct A
-{
- ~A();
-};
int main()
{
test_is_not_nothrow_destructible<void>();
- test_is_not_nothrow_destructible<AbstractDestructor>();
- test_is_not_nothrow_destructible<NotEmpty>();
test_is_not_nothrow_destructible<char[]>();
+ test_is_not_nothrow_destructible<char[][3]>();
-#if __has_feature(cxx_noexcept)
- test_is_nothrow_destructible<A>();
-#endif
test_is_nothrow_destructible<int&>();
-#if __has_feature(cxx_unrestricted_unions)
- test_is_nothrow_destructible<Union>();
-#endif
-#if __has_feature(cxx_access_control_sfinae)
- test_is_nothrow_destructible<Empty>();
-#endif
test_is_nothrow_destructible<int>();
test_is_nothrow_destructible<double>();
test_is_nothrow_destructible<int*>();
test_is_nothrow_destructible<const int*>();
test_is_nothrow_destructible<char[3]>();
- test_is_nothrow_destructible<Abstract>();
-#if __has_feature(cxx_noexcept)
+
+#if TEST_STD_VER >= 11
+ // requires noexcept. These are all destructible.
+ test_is_nothrow_destructible<PublicDestructor>();
+ test_is_nothrow_destructible<VirtualPublicDestructor>();
+ test_is_nothrow_destructible<PurePublicDestructor>();
test_is_nothrow_destructible<bit_zero>();
+ test_is_nothrow_destructible<Abstract>();
+ test_is_nothrow_destructible<Empty>();
+ test_is_nothrow_destructible<Union>();
+
+ // requires access control
+ test_is_not_nothrow_destructible<ProtectedDestructor>();
+ test_is_not_nothrow_destructible<PrivateDestructor>();
+ test_is_not_nothrow_destructible<VirtualProtectedDestructor>();
+ test_is_not_nothrow_destructible<VirtualPrivateDestructor>();
+ test_is_not_nothrow_destructible<PureProtectedDestructor>();
+ test_is_not_nothrow_destructible<PurePrivateDestructor>();
#endif
}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_assignable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_assignable.pass.cpp
index fe51e438864f..11852f6aec98 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_assignable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_assignable.pass.cpp
@@ -12,17 +12,24 @@
// has_nothrow_move_assign
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_has_nothrow_assign()
{
static_assert( std::is_nothrow_move_assignable<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_nothrow_move_assignable_v<T>, "");
+#endif
}
template <class T>
void test_has_not_nothrow_assign()
{
static_assert(!std::is_nothrow_move_assignable<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_nothrow_move_assignable_v<T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_constructible.pass.cpp
index f5a42afe0d50..b93dbb634e4d 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_constructible.pass.cpp
@@ -12,12 +12,17 @@
// has_nothrow_move_constructor
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_nothrow_move_constructible()
{
static_assert( std::is_nothrow_move_constructible<T>::value, "");
static_assert( std::is_nothrow_move_constructible<const T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_nothrow_move_constructible_v<T>, "");
+ static_assert( std::is_nothrow_move_constructible_v<const T>, "");
+#endif
}
template <class T>
@@ -27,6 +32,12 @@ void test_has_not_nothrow_move_constructor()
static_assert(!std::is_nothrow_move_constructible<const T>::value, "");
static_assert(!std::is_nothrow_move_constructible<volatile T>::value, "");
static_assert(!std::is_nothrow_move_constructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_nothrow_move_constructible_v<T>, "");
+ static_assert(!std::is_nothrow_move_constructible_v<const T>, "");
+ static_assert(!std::is_nothrow_move_constructible_v<volatile T>, "");
+ static_assert(!std::is_nothrow_move_constructible_v<const volatile T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_pod.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_pod.pass.cpp
index 4ec1ae9949ef..2ca2b8640141 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_pod.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_pod.pass.cpp
@@ -12,6 +12,7 @@
// is_pod
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_pod()
@@ -20,6 +21,12 @@ void test_is_pod()
static_assert( std::is_pod<const T>::value, "");
static_assert( std::is_pod<volatile T>::value, "");
static_assert( std::is_pod<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_pod_v<T>, "");
+ static_assert( std::is_pod_v<const T>, "");
+ static_assert( std::is_pod_v<volatile T>, "");
+ static_assert( std::is_pod_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +36,12 @@ void test_is_not_pod()
static_assert(!std::is_pod<const T>::value, "");
static_assert(!std::is_pod<volatile T>::value, "");
static_assert(!std::is_pod<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_pod_v<T>, "");
+ static_assert(!std::is_pod_v<const T>, "");
+ static_assert(!std::is_pod_v<volatile T>, "");
+ static_assert(!std::is_pod_v<const volatile T>, "");
+#endif
}
class Class
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp
index 6e82cddc5166..b66e7a296f39 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_polymorphic.pass.cpp
@@ -12,6 +12,7 @@
// is_polymorphic
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_polymorphic()
@@ -20,6 +21,12 @@ void test_is_polymorphic()
static_assert( std::is_polymorphic<const T>::value, "");
static_assert( std::is_polymorphic<volatile T>::value, "");
static_assert( std::is_polymorphic<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_polymorphic_v<T>, "");
+ static_assert( std::is_polymorphic_v<const T>, "");
+ static_assert( std::is_polymorphic_v<volatile T>, "");
+ static_assert( std::is_polymorphic_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +36,12 @@ void test_is_not_polymorphic()
static_assert(!std::is_polymorphic<const T>::value, "");
static_assert(!std::is_polymorphic<volatile T>::value, "");
static_assert(!std::is_polymorphic<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_polymorphic_v<T>, "");
+ static_assert(!std::is_polymorphic_v<const T>, "");
+ static_assert(!std::is_polymorphic_v<volatile T>, "");
+ static_assert(!std::is_polymorphic_v<const volatile T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_signed.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_signed.pass.cpp
index 479c2529f02a..94bf7fb58041 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_signed.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_signed.pass.cpp
@@ -12,6 +12,7 @@
// is_signed
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_signed()
@@ -20,6 +21,12 @@ void test_is_signed()
static_assert( std::is_signed<const T>::value, "");
static_assert( std::is_signed<volatile T>::value, "");
static_assert( std::is_signed<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_signed_v<T>, "");
+ static_assert( std::is_signed_v<const T>, "");
+ static_assert( std::is_signed_v<volatile T>, "");
+ static_assert( std::is_signed_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +36,12 @@ void test_is_not_signed()
static_assert(!std::is_signed<const T>::value, "");
static_assert(!std::is_signed<volatile T>::value, "");
static_assert(!std::is_signed<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_signed_v<T>, "");
+ static_assert(!std::is_signed_v<const T>, "");
+ static_assert(!std::is_signed_v<volatile T>, "");
+ static_assert(!std::is_signed_v<const volatile T>, "");
+#endif
}
class Class
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp
index 668c4cdc7dd6..6e601c1ac04b 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp
@@ -12,6 +12,7 @@
// is_standard_layout
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_standard_layout()
@@ -20,6 +21,12 @@ void test_is_standard_layout()
static_assert( std::is_standard_layout<const T>::value, "");
static_assert( std::is_standard_layout<volatile T>::value, "");
static_assert( std::is_standard_layout<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_standard_layout_v<T>, "");
+ static_assert( std::is_standard_layout_v<const T>, "");
+ static_assert( std::is_standard_layout_v<volatile T>, "");
+ static_assert( std::is_standard_layout_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +36,12 @@ void test_is_not_standard_layout()
static_assert(!std::is_standard_layout<const T>::value, "");
static_assert(!std::is_standard_layout<volatile T>::value, "");
static_assert(!std::is_standard_layout<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_standard_layout_v<T>, "");
+ static_assert(!std::is_standard_layout_v<const T>, "");
+ static_assert(!std::is_standard_layout_v<volatile T>, "");
+ static_assert(!std::is_standard_layout_v<const volatile T>, "");
+#endif
}
template <class T1, class T2>
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp
index af38699d881b..2d2df14d3bbc 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp
@@ -12,6 +12,7 @@
// is_trivial
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_trivial()
@@ -20,6 +21,12 @@ void test_is_trivial()
static_assert( std::is_trivial<const T>::value, "");
static_assert( std::is_trivial<volatile T>::value, "");
static_assert( std::is_trivial<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_trivial_v<T>, "");
+ static_assert( std::is_trivial_v<const T>, "");
+ static_assert( std::is_trivial_v<volatile T>, "");
+ static_assert( std::is_trivial_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +36,12 @@ void test_is_not_trivial()
static_assert(!std::is_trivial<const T>::value, "");
static_assert(!std::is_trivial<volatile T>::value, "");
static_assert(!std::is_trivial<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_trivial_v<T>, "");
+ static_assert(!std::is_trivial_v<const T>, "");
+ static_assert(!std::is_trivial_v<volatile T>, "");
+ static_assert(!std::is_trivial_v<const volatile T>, "");
+#endif
}
struct A {};
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_assignable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_assignable.pass.cpp
index 735d05fa6ee4..3ebb9dba429d 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_assignable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_assignable.pass.cpp
@@ -12,17 +12,24 @@
// is_trivially_assignable
#include <type_traits>
+#include "test_macros.h"
template <class T, class U>
void test_is_trivially_assignable()
{
static_assert(( std::is_trivially_assignable<T, U>::value), "");
+#if TEST_STD_VER > 14
+ static_assert(( std::is_trivially_assignable_v<T, U>), "");
+#endif
}
template <class T, class U>
void test_is_not_trivially_assignable()
{
static_assert((!std::is_trivially_assignable<T, U>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_trivially_assignable_v<T, U>), "");
+#endif
}
struct A
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_constructible.pass.cpp
index 4171d4d32f5d..212245f00691 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_constructible.pass.cpp
@@ -13,35 +13,51 @@
// struct is_trivially_constructible;
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_trivially_constructible()
{
static_assert(( std::is_trivially_constructible<T>::value), "");
+#if TEST_STD_VER > 14
+ static_assert(( std::is_trivially_constructible_v<T>), "");
+#endif
}
template <class T, class A0>
void test_is_trivially_constructible()
{
static_assert(( std::is_trivially_constructible<T, A0>::value), "");
+#if TEST_STD_VER > 14
+ static_assert(( std::is_trivially_constructible_v<T, A0>), "");
+#endif
}
template <class T>
void test_is_not_trivially_constructible()
{
static_assert((!std::is_trivially_constructible<T>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_trivially_constructible_v<T>), "");
+#endif
}
template <class T, class A0>
void test_is_not_trivially_constructible()
{
static_assert((!std::is_trivially_constructible<T, A0>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_trivially_constructible_v<T, A0>), "");
+#endif
}
template <class T, class A0, class A1>
void test_is_not_trivially_constructible()
{
static_assert((!std::is_trivially_constructible<T, A0, A1>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((!std::is_trivially_constructible_v<T, A0, A1>), "");
+#endif
}
struct A
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copy_assignable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copy_assignable.pass.cpp
index 7d72565e40ca..25429f5470e7 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copy_assignable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copy_assignable.pass.cpp
@@ -12,17 +12,24 @@
// is_trivially_copy_assignable
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_has_trivially_copy_assignable()
{
static_assert( std::is_trivially_copy_assignable<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_trivially_copy_assignable_v<T>, "");
+#endif
}
template <class T>
void test_has_not_trivially_copy_assignable()
{
static_assert(!std::is_trivially_copy_assignable<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_trivially_copy_assignable_v<T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copy_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copy_constructible.pass.cpp
index 6bd78ec9e7a1..9556959e1262 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copy_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copy_constructible.pass.cpp
@@ -12,12 +12,17 @@
// is_trivially_copy_constructible
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_trivially_copy_constructible()
{
static_assert( std::is_trivially_copy_constructible<T>::value, "");
static_assert( std::is_trivially_copy_constructible<const T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_trivially_copy_constructible_v<T>, "");
+ static_assert( std::is_trivially_copy_constructible_v<const T>, "");
+#endif
}
template <class T>
@@ -25,6 +30,10 @@ void test_has_not_trivial_copy_constructor()
{
static_assert(!std::is_trivially_copy_constructible<T>::value, "");
static_assert(!std::is_trivially_copy_constructible<const T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_trivially_copy_constructible_v<T>, "");
+ static_assert(!std::is_trivially_copy_constructible_v<const T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
index d65882378fc4..c19a29ffb586 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
@@ -13,6 +13,7 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
template <class T>
void test_is_trivially_copyable()
@@ -21,6 +22,12 @@ void test_is_trivially_copyable()
static_assert( std::is_trivially_copyable<const T>::value, "");
static_assert(!std::is_trivially_copyable<volatile T>::value, "");
static_assert(!std::is_trivially_copyable<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_trivially_copyable_v<T>, "");
+ static_assert( std::is_trivially_copyable_v<const T>, "");
+ static_assert(!std::is_trivially_copyable_v<volatile T>, "");
+ static_assert(!std::is_trivially_copyable_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -30,6 +37,12 @@ void test_is_not_trivially_copyable()
static_assert(!std::is_trivially_copyable<const T>::value, "");
static_assert(!std::is_trivially_copyable<volatile T>::value, "");
static_assert(!std::is_trivially_copyable<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_trivially_copyable_v<T>, "");
+ static_assert(!std::is_trivially_copyable_v<const T>, "");
+ static_assert(!std::is_trivially_copyable_v<volatile T>, "");
+ static_assert(!std::is_trivially_copyable_v<const volatile T>, "");
+#endif
}
struct A
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_default_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_default_constructible.pass.cpp
index 1f63401dacb7..2d367159ca30 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_default_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_default_constructible.pass.cpp
@@ -12,6 +12,7 @@
// is_trivially_default_constructible
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_trivially_default_constructible()
@@ -20,6 +21,12 @@ void test_is_trivially_default_constructible()
static_assert( std::is_trivially_default_constructible<const T>::value, "");
static_assert( std::is_trivially_default_constructible<volatile T>::value, "");
static_assert( std::is_trivially_default_constructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_trivially_default_constructible_v<T>, "");
+ static_assert( std::is_trivially_default_constructible_v<const T>, "");
+ static_assert( std::is_trivially_default_constructible_v<volatile T>, "");
+ static_assert( std::is_trivially_default_constructible_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +36,12 @@ void test_has_not_trivial_default_constructor()
static_assert(!std::is_trivially_default_constructible<const T>::value, "");
static_assert(!std::is_trivially_default_constructible<volatile T>::value, "");
static_assert(!std::is_trivially_default_constructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_trivially_default_constructible_v<T>, "");
+ static_assert(!std::is_trivially_default_constructible_v<const T>, "");
+ static_assert(!std::is_trivially_default_constructible_v<volatile T>, "");
+ static_assert(!std::is_trivially_default_constructible_v<const volatile T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp
index b18ace44bda1..9e2507067d2d 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp
@@ -12,6 +12,7 @@
// is_trivially_destructible
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_trivially_destructible()
@@ -20,6 +21,12 @@ void test_is_trivially_destructible()
static_assert( std::is_trivially_destructible<const T>::value, "");
static_assert( std::is_trivially_destructible<volatile T>::value, "");
static_assert( std::is_trivially_destructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_trivially_destructible_v<T>, "");
+ static_assert( std::is_trivially_destructible_v<const T>, "");
+ static_assert( std::is_trivially_destructible_v<volatile T>, "");
+ static_assert( std::is_trivially_destructible_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,15 +36,29 @@ void test_is_not_trivially_destructible()
static_assert(!std::is_trivially_destructible<const T>::value, "");
static_assert(!std::is_trivially_destructible<volatile T>::value, "");
static_assert(!std::is_trivially_destructible<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_trivially_destructible_v<T>, "");
+ static_assert(!std::is_trivially_destructible_v<const T>, "");
+ static_assert(!std::is_trivially_destructible_v<volatile T>, "");
+ static_assert(!std::is_trivially_destructible_v<const volatile T>, "");
+#endif
}
-class Empty
-{
-};
+struct PublicDestructor { public: ~PublicDestructor() {}};
+struct ProtectedDestructor { protected: ~ProtectedDestructor() {}};
+struct PrivateDestructor { private: ~PrivateDestructor() {}};
+
+struct VirtualPublicDestructor { public: virtual ~VirtualPublicDestructor() {}};
+struct VirtualProtectedDestructor { protected: virtual ~VirtualProtectedDestructor() {}};
+struct VirtualPrivateDestructor { private: virtual ~VirtualPrivateDestructor() {}};
+
+struct PurePublicDestructor { public: virtual ~PurePublicDestructor() = 0; };
+struct PureProtectedDestructor { protected: virtual ~PureProtectedDestructor() = 0; };
+struct PurePrivateDestructor { private: virtual ~PurePrivateDestructor() = 0; };
-class NotEmpty
+
+class Empty
{
- virtual ~NotEmpty();
};
union Union {};
@@ -66,18 +87,28 @@ int main()
{
test_is_not_trivially_destructible<void>();
test_is_not_trivially_destructible<A>();
- test_is_not_trivially_destructible<AbstractDestructor>();
- test_is_not_trivially_destructible<NotEmpty>();
test_is_not_trivially_destructible<char[]>();
+ test_is_not_trivially_destructible<VirtualPublicDestructor>();
+ test_is_not_trivially_destructible<PurePublicDestructor>();
test_is_trivially_destructible<Abstract>();
- test_is_trivially_destructible<int&>();
test_is_trivially_destructible<Union>();
test_is_trivially_destructible<Empty>();
+ test_is_trivially_destructible<int&>();
test_is_trivially_destructible<int>();
test_is_trivially_destructible<double>();
test_is_trivially_destructible<int*>();
test_is_trivially_destructible<const int*>();
test_is_trivially_destructible<char[3]>();
test_is_trivially_destructible<bit_zero>();
+
+#if TEST_STD_VER >= 11
+ // requires access control sfinae
+ test_is_not_trivially_destructible<ProtectedDestructor>();
+ test_is_not_trivially_destructible<PrivateDestructor>();
+ test_is_not_trivially_destructible<VirtualProtectedDestructor>();
+ test_is_not_trivially_destructible<VirtualPrivateDestructor>();
+ test_is_not_trivially_destructible<PureProtectedDestructor>();
+ test_is_not_trivially_destructible<PurePrivateDestructor>();
+#endif
}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_move_assignable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_move_assignable.pass.cpp
index c3fc7ac0a3df..eca596ee1c19 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_move_assignable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_move_assignable.pass.cpp
@@ -12,17 +12,24 @@
// is_trivially_move_assignable
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_has_trivial_assign()
{
static_assert( std::is_trivially_move_assignable<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_trivially_move_assignable_v<T>, "");
+#endif
}
template <class T>
void test_has_not_trivial_assign()
{
static_assert(!std::is_trivially_move_assignable<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_trivially_move_assignable_v<T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_move_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_move_constructible.pass.cpp
index 54cb5e853a81..313da175f715 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_move_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_move_constructible.pass.cpp
@@ -12,17 +12,24 @@
// is_trivially_move_constructible
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_trivially_move_constructible()
{
static_assert( std::is_trivially_move_constructible<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_trivially_move_constructible_v<T>, "");
+#endif
}
template <class T>
void test_has_not_trivial_move_constructor()
{
static_assert(!std::is_trivially_move_constructible<T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_trivially_move_constructible_v<T>, "");
+#endif
}
class Empty
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_unsigned.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_unsigned.pass.cpp
index dfdb15542610..9ca42432df16 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_unsigned.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_unsigned.pass.cpp
@@ -12,6 +12,7 @@
// is_unsigned
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_unsigned()
@@ -20,6 +21,12 @@ void test_is_unsigned()
static_assert( std::is_unsigned<const T>::value, "");
static_assert( std::is_unsigned<volatile T>::value, "");
static_assert( std::is_unsigned<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert( std::is_unsigned_v<T>, "");
+ static_assert( std::is_unsigned_v<const T>, "");
+ static_assert( std::is_unsigned_v<volatile T>, "");
+ static_assert( std::is_unsigned_v<const volatile T>, "");
+#endif
}
template <class T>
@@ -29,6 +36,12 @@ void test_is_not_unsigned()
static_assert(!std::is_unsigned<const T>::value, "");
static_assert(!std::is_unsigned<volatile T>::value, "");
static_assert(!std::is_unsigned<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_unsigned_v<T>, "");
+ static_assert(!std::is_unsigned_v<const T>, "");
+ static_assert(!std::is_unsigned_v<volatile T>, "");
+ static_assert(!std::is_unsigned_v<const volatile T>, "");
+#endif
}
class Class
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_volatile.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_volatile.pass.cpp
index f6805bc1c4ff..36697a3f3eba 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_volatile.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_volatile.pass.cpp
@@ -12,6 +12,7 @@
// is_volatile
#include <type_traits>
+#include "test_macros.h"
template <class T>
void test_is_volatile()
@@ -20,6 +21,12 @@ void test_is_volatile()
static_assert(!std::is_volatile<const T>::value, "");
static_assert( std::is_volatile<volatile T>::value, "");
static_assert( std::is_volatile<const volatile T>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_volatile_v<T>, "");
+ static_assert(!std::is_volatile_v<const T>, "");
+ static_assert( std::is_volatile_v<volatile T>, "");
+ static_assert( std::is_volatile_v<const volatile T>, "");
+#endif
}
int main()
diff --git a/test/std/utilities/ratio/ratio.comparison/ratio_equal.pass.cpp b/test/std/utilities/ratio/ratio.comparison/ratio_equal.pass.cpp
index 78027f7e48b8..9331b7094f48 100644
--- a/test/std/utilities/ratio/ratio.comparison/ratio_equal.pass.cpp
+++ b/test/std/utilities/ratio/ratio.comparison/ratio_equal.pass.cpp
@@ -11,46 +11,57 @@
#include <ratio>
+#include "test_macros.h"
+
+template <class Rat1, class Rat2, bool result>
+void test()
+{
+ static_assert((result == std::ratio_equal<Rat1, Rat2>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((result == std::ratio_equal_v<Rat1, Rat2>), "");
+#endif
+}
+
int main()
{
{
typedef std::ratio<1, 1> R1;
typedef std::ratio<1, 1> R2;
- static_assert((std::ratio_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((std::ratio_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((std::ratio_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2;
- static_assert((std::ratio_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<1, 1> R1;
typedef std::ratio<1, -1> R2;
- static_assert((!std::ratio_equal<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((!std::ratio_equal<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((!std::ratio_equal<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2;
- static_assert((!std::ratio_equal<R1, R2>::value), "");
+ test<R1, R2, false>();
}
}
diff --git a/test/std/utilities/ratio/ratio.comparison/ratio_greater.pass.cpp b/test/std/utilities/ratio/ratio.comparison/ratio_greater.pass.cpp
index 9182a9ec503c..7f7a74068299 100644
--- a/test/std/utilities/ratio/ratio.comparison/ratio_greater.pass.cpp
+++ b/test/std/utilities/ratio/ratio.comparison/ratio_greater.pass.cpp
@@ -11,46 +11,57 @@
#include <ratio>
+#include "test_macros.h"
+
+template <class Rat1, class Rat2, bool result>
+void test()
+{
+ static_assert((result == std::ratio_greater<Rat1, Rat2>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((result == std::ratio_greater_v<Rat1, Rat2>), "");
+#endif
+}
+
int main()
{
{
typedef std::ratio<1, 1> R1;
typedef std::ratio<1, 1> R2;
- static_assert((!std::ratio_greater<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((!std::ratio_greater<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((!std::ratio_greater<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2;
- static_assert((!std::ratio_greater<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<1, 1> R1;
typedef std::ratio<1, -1> R2;
- static_assert((std::ratio_greater<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((std::ratio_greater<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((!std::ratio_greater<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2;
- static_assert((std::ratio_greater<R1, R2>::value), "");
+ test<R1, R2, true>();
}
}
diff --git a/test/std/utilities/ratio/ratio.comparison/ratio_greater_equal.pass.cpp b/test/std/utilities/ratio/ratio.comparison/ratio_greater_equal.pass.cpp
index a1f5a185e621..db78557ec4c1 100644
--- a/test/std/utilities/ratio/ratio.comparison/ratio_greater_equal.pass.cpp
+++ b/test/std/utilities/ratio/ratio.comparison/ratio_greater_equal.pass.cpp
@@ -11,46 +11,57 @@
#include <ratio>
+#include "test_macros.h"
+
+template <class Rat1, class Rat2, bool result>
+void test()
+{
+ static_assert((result == std::ratio_greater_equal<Rat1, Rat2>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((result == std::ratio_greater_equal_v<Rat1, Rat2>), "");
+#endif
+}
+
int main()
{
{
typedef std::ratio<1, 1> R1;
typedef std::ratio<1, 1> R2;
- static_assert((std::ratio_greater_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((std::ratio_greater_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((std::ratio_greater_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2;
- static_assert((std::ratio_greater_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<1, 1> R1;
typedef std::ratio<1, -1> R2;
- static_assert((std::ratio_greater_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((std::ratio_greater_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((!std::ratio_greater_equal<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2;
- static_assert((std::ratio_greater_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
}
diff --git a/test/std/utilities/ratio/ratio.comparison/ratio_less.pass.cpp b/test/std/utilities/ratio/ratio.comparison/ratio_less.pass.cpp
index db53ab0ad448..a428be28aa56 100644
--- a/test/std/utilities/ratio/ratio.comparison/ratio_less.pass.cpp
+++ b/test/std/utilities/ratio/ratio.comparison/ratio_less.pass.cpp
@@ -11,76 +11,87 @@
#include <ratio>
+#include "test_macros.h"
+
+template <class Rat1, class Rat2, bool result>
+void test()
+{
+ static_assert((result == std::ratio_less<Rat1, Rat2>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((result == std::ratio_less_v<Rat1, Rat2>), "");
+#endif
+}
+
int main()
{
{
typedef std::ratio<1, 1> R1;
typedef std::ratio<1, 1> R2;
- static_assert((!std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((!std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((!std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2;
- static_assert((!std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<1, 1> R1;
typedef std::ratio<1, -1> R2;
- static_assert((!std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((!std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2;
- static_assert((!std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R2;
- static_assert((std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R2;
- static_assert((!std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R2;
- static_assert((std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFELL, 0x7FFFFFFFFFFFFFFDLL> R2;
- static_assert((std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<641981, 1339063> R1;
typedef std::ratio<1291640, 2694141LL> R2;
- static_assert((!std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<1291640, 2694141LL> R1;
typedef std::ratio<641981, 1339063> R2;
- static_assert((std::ratio_less<R1, R2>::value), "");
+ test<R1, R2, true>();
}
}
diff --git a/test/std/utilities/ratio/ratio.comparison/ratio_less_equal.pass.cpp b/test/std/utilities/ratio/ratio.comparison/ratio_less_equal.pass.cpp
index 5b148f0e1435..7b224ab7c892 100644
--- a/test/std/utilities/ratio/ratio.comparison/ratio_less_equal.pass.cpp
+++ b/test/std/utilities/ratio/ratio.comparison/ratio_less_equal.pass.cpp
@@ -11,46 +11,57 @@
#include <ratio>
+#include "test_macros.h"
+
+template <class Rat1, class Rat2, bool result>
+void test()
+{
+ static_assert((result == std::ratio_less_equal<Rat1, Rat2>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((result == std::ratio_less_equal_v<Rat1, Rat2>), "");
+#endif
+}
+
int main()
{
{
typedef std::ratio<1, 1> R1;
typedef std::ratio<1, 1> R2;
- static_assert((std::ratio_less_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((std::ratio_less_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((std::ratio_less_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2;
- static_assert((std::ratio_less_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<1, 1> R1;
typedef std::ratio<1, -1> R2;
- static_assert((!std::ratio_less_equal<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((!std::ratio_less_equal<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((std::ratio_less_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2;
- static_assert((!std::ratio_less_equal<R1, R2>::value), "");
+ test<R1, R2, false>();
}
}
diff --git a/test/std/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp b/test/std/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp
index ebf930746585..fcd31207fdbf 100644
--- a/test/std/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp
+++ b/test/std/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp
@@ -11,46 +11,57 @@
#include <ratio>
+#include "test_macros.h"
+
+template <class Rat1, class Rat2, bool result>
+void test()
+{
+ static_assert((result == std::ratio_not_equal<Rat1, Rat2>::value), "");
+#if TEST_STD_VER > 14
+ static_assert((result == std::ratio_not_equal_v<Rat1, Rat2>), "");
+#endif
+}
+
int main()
{
{
typedef std::ratio<1, 1> R1;
typedef std::ratio<1, 1> R2;
- static_assert((!std::ratio_not_equal<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((!std::ratio_not_equal<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((!std::ratio_not_equal<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2;
- static_assert((!std::ratio_not_equal<R1, R2>::value), "");
+ test<R1, R2, false>();
}
{
typedef std::ratio<1, 1> R1;
typedef std::ratio<1, -1> R2;
- static_assert((std::ratio_not_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((std::ratio_not_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
- static_assert((std::ratio_not_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
{
typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2;
- static_assert((std::ratio_not_equal<R1, R2>::value), "");
+ test<R1, R2, true>();
}
}
diff --git a/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp b/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
index 7fe78bad1cc6..9411435e29e8 100644
--- a/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// template <class charT>
// explicit bitset(const charT* str,
// typename basic_string<charT>::size_type n = basic_string<charT>::npos,
@@ -14,6 +15,8 @@
#include <bitset>
#include <cassert>
+#include <algorithm> // for 'min' and 'max'
+#include <stdexcept> // for 'invalid_argument'
#pragma clang diagnostic ignored "-Wtautological-compare"
diff --git a/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp b/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
index bcee50c4c63a..b08720f57ee3 100644
--- a/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
@@ -7,10 +7,13 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// test bitset(string, pos, n, zero, one);
#include <bitset>
#include <cassert>
+#include <algorithm> // for 'min' and 'max'
+#include <stdexcept> // for 'invalid_argument'
#pragma clang diagnostic ignored "-Wtautological-compare"
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 023fedc25839..f232447e08c3 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
@@ -11,6 +11,7 @@
#include <bitset>
#include <cassert>
+#include <algorithm> // for 'min' and 'max'
#pragma clang diagnostic ignored "-Wtautological-compare"
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 3e09b202097d..cffca68fb1ea 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// test bitset<N>& flip(size_t pos);
#include <bitset>
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 ebaa9e7a8d72..6de256b00cc5 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// test bitset<N>& reset(size_t pos);
#include <bitset>
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 116eaf3f46e0..debe5431d8d0 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,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// test bitset<N>& set(size_t pos, bool val = true);
#include <bitset>
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 5102b46171a2..ce594d0ae891 100644
--- a/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-no-exceptions
// test constexpr bool test(size_t pos) const;
#include <bitset>
diff --git a/test/std/utilities/date.time/tested_elsewhere.pass.cpp b/test/std/utilities/time/date.time/ctime.pass.cpp
index 419f415dee19..d0a838e0c271 100644
--- a/test/std/utilities/date.time/tested_elsewhere.pass.cpp
+++ b/test/std/utilities/time/date.time/ctime.pass.cpp
@@ -30,9 +30,11 @@ int main()
static_assert((std::is_same<decltype(std::difftime(t,t)), double>::value), "");
static_assert((std::is_same<decltype(std::mktime(&tm)), std::time_t>::value), "");
static_assert((std::is_same<decltype(std::time(&t)), std::time_t>::value), "");
+#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
static_assert((std::is_same<decltype(std::asctime(&tm)), char*>::value), "");
static_assert((std::is_same<decltype(std::ctime(&t)), char*>::value), "");
static_assert((std::is_same<decltype(std::gmtime(&t)), std::tm*>::value), "");
static_assert((std::is_same<decltype(std::localtime(&t)), std::tm*>::value), "");
+#endif
static_assert((std::is_same<decltype(std::strftime(str,s,"",&tm)), std::size_t>::value), "");
}
diff --git a/test/std/utilities/time/time.duration/time.duration.alg/abs.fail.cpp b/test/std/utilities/time/time.duration/time.duration.alg/abs.fail.cpp
new file mode 100644
index 000000000000..221004c568ce
--- /dev/null
+++ b/test/std/utilities/time/time.duration/time.duration.alg/abs.fail.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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, c++11, c++14
+// <chrono>
+
+// ceil
+
+// template <class Rep, class Period>
+// constexpr duration<Rep, Period> abs(duration<Rep, Period> d)
+
+// This function shall not participate in overload resolution unless numeric_limits<Rep>::is_signed is true.
+
+#include <chrono>
+
+typedef std::chrono::duration<unsigned> unsigned_secs;
+
+int main()
+{
+ std::chrono::abs(unsigned_secs(0));
+}
diff --git a/test/std/utilities/time/time.duration/time.duration.alg/abs.pass.cpp b/test/std/utilities/time/time.duration/time.duration.alg/abs.pass.cpp
new file mode 100644
index 000000000000..ec32c37a9423
--- /dev/null
+++ b/test/std/utilities/time/time.duration/time.duration.alg/abs.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++03, c++11, c++14
+
+// <chrono>
+
+// abs
+
+// template <class Rep, class Period>
+// constexpr duration<Rep, Period> abs(duration<Rep, Period> d)
+
+#include <chrono>
+#include <type_traits>
+#include <cassert>
+
+template <class Duration>
+void
+test(const Duration& f, const Duration& d)
+{
+ {
+ typedef decltype(std::chrono::abs(f)) R;
+ static_assert((std::is_same<R, Duration>::value), "");
+ assert(std::chrono::abs(f) == d);
+ }
+}
+
+int main()
+{
+// 7290000ms is 2 hours, 1 minute, and 30 seconds
+ test(std::chrono::milliseconds( 7290000), std::chrono::milliseconds( 7290000));
+ test(std::chrono::milliseconds(-7290000), std::chrono::milliseconds( 7290000));
+ test(std::chrono::minutes( 122), std::chrono::minutes( 122));
+ test(std::chrono::minutes(-122), std::chrono::minutes( 122));
+ test(std::chrono::hours(0), std::chrono::hours(0));
+
+ {
+// 9000000ms is 2 hours and 30 minutes
+ constexpr std::chrono::hours h1 = std::chrono::abs(std::chrono::hours(-3));
+ static_assert(h1.count() == 3, "");
+ constexpr std::chrono::hours h2 = std::chrono::abs(std::chrono::hours(3));
+ static_assert(h2.count() == 3, "");
+ }
+}
diff --git a/test/std/utilities/time/time.duration/time.duration.cast/ceil.fail.cpp b/test/std/utilities/time/time.duration/time.duration.cast/ceil.fail.cpp
new file mode 100644
index 000000000000..909e8573247c
--- /dev/null
+++ b/test/std/utilities/time/time.duration/time.duration.cast/ceil.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++03, c++11, c++14
+// <chrono>
+
+// ceil
+
+// template <class ToDuration, class Rep, class Period>
+// ToDuration
+// ceil(const duration<Rep, Period>& d);
+
+// ToDuration shall be an instantiation of duration.
+
+#include <chrono>
+
+int main()
+{
+ std::chrono::ceil<int>(std::chrono::milliseconds(3));
+}
diff --git a/test/std/utilities/time/time.duration/time.duration.cast/ceil.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cast/ceil.pass.cpp
new file mode 100644
index 000000000000..6fb73b97db17
--- /dev/null
+++ b/test/std/utilities/time/time.duration/time.duration.cast/ceil.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, c++11, c++14
+
+// <chrono>
+
+// ceil
+
+// template <class ToDuration, class Rep, class Period>
+// constexpr
+// ToDuration
+// ceil(const duration<Rep, Period>& d);
+
+#include <chrono>
+#include <type_traits>
+#include <cassert>
+
+template <class ToDuration, class FromDuration>
+void
+test(const FromDuration& f, const ToDuration& d)
+{
+ {
+ typedef decltype(std::chrono::ceil<ToDuration>(f)) R;
+ static_assert((std::is_same<R, ToDuration>::value), "");
+ assert(std::chrono::ceil<ToDuration>(f) == d);
+ }
+}
+
+int main()
+{
+// 7290000ms is 2 hours, 1 minute, and 30 seconds
+ test(std::chrono::milliseconds( 7290000), std::chrono::hours( 3));
+ test(std::chrono::milliseconds(-7290000), std::chrono::hours(-2));
+ test(std::chrono::milliseconds( 7290000), std::chrono::minutes( 122));
+ test(std::chrono::milliseconds(-7290000), std::chrono::minutes(-121));
+
+ {
+// 9000000ms is 2 hours and 30 minutes
+ constexpr std::chrono::hours h1 = std::chrono::ceil<std::chrono::hours>(std::chrono::milliseconds(9000000));
+ static_assert(h1.count() == 3, "");
+ constexpr std::chrono::hours h2 = std::chrono::ceil<std::chrono::hours>(std::chrono::milliseconds(-9000000));
+ static_assert(h2.count() == -2, "");
+ }
+}
diff --git a/test/std/utilities/time/time.duration/time.duration.cast/floor.fail.cpp b/test/std/utilities/time/time.duration/time.duration.cast/floor.fail.cpp
new file mode 100644
index 000000000000..14d9ca878df8
--- /dev/null
+++ b/test/std/utilities/time/time.duration/time.duration.cast/floor.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++03, c++11, c++14
+// <chrono>
+
+// floor
+
+// template <class ToDuration, class Rep, class Period>
+// ToDuration
+// floor(const duration<Rep, Period>& d);
+
+// ToDuration shall be an instantiation of duration.
+
+#include <chrono>
+
+int main()
+{
+ std::chrono::floor<int>(std::chrono::milliseconds(3));
+}
diff --git a/test/std/utilities/time/time.duration/time.duration.cast/floor.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cast/floor.pass.cpp
new file mode 100644
index 000000000000..57929dd91228
--- /dev/null
+++ b/test/std/utilities/time/time.duration/time.duration.cast/floor.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++03, c++11, c++14
+// <chrono>
+
+// floor
+
+// template <class ToDuration, class Rep, class Period>
+// constexpr
+// ToDuration
+// floor(const duration<Rep, Period>& d);
+
+#include <chrono>
+#include <type_traits>
+#include <cassert>
+
+template <class ToDuration, class FromDuration>
+void
+test(const FromDuration& f, const ToDuration& d)
+{
+ {
+ typedef decltype(std::chrono::floor<ToDuration>(f)) R;
+ static_assert((std::is_same<R, ToDuration>::value), "");
+ assert(std::chrono::floor<ToDuration>(f) == d);
+ }
+}
+
+int main()
+{
+// 7290000ms is 2 hours, 1 minute, and 30 seconds
+ test(std::chrono::milliseconds( 7290000), std::chrono::hours( 2));
+ test(std::chrono::milliseconds(-7290000), std::chrono::hours(-3));
+ test(std::chrono::milliseconds( 7290000), std::chrono::minutes( 121));
+ test(std::chrono::milliseconds(-7290000), std::chrono::minutes(-122));
+
+ {
+// 9000000ms is 2 hours and 30 minutes
+ constexpr std::chrono::hours h1 = std::chrono::floor<std::chrono::hours>(std::chrono::milliseconds(9000000));
+ static_assert(h1.count() == 2, "");
+ constexpr std::chrono::hours h2 = std::chrono::floor<std::chrono::hours>(std::chrono::milliseconds(-9000000));
+ static_assert(h2.count() == -3, "");
+ }
+}
diff --git a/test/std/utilities/time/time.duration/time.duration.cast/round.fail.cpp b/test/std/utilities/time/time.duration/time.duration.cast/round.fail.cpp
new file mode 100644
index 000000000000..6f9f5bd29b63
--- /dev/null
+++ b/test/std/utilities/time/time.duration/time.duration.cast/round.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++03, c++11, c++14
+// <chrono>
+
+// round
+
+// template <class ToDuration, class Rep, class Period>
+// ToDuration
+// round(const duration<Rep, Period>& d);
+
+// ToDuration shall be an instantiation of duration.
+
+#include <chrono>
+
+int main()
+{
+ std::chrono::round<int>(std::chrono::milliseconds(3));
+}
diff --git a/test/std/utilities/time/time.duration/time.duration.cast/round.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cast/round.pass.cpp
new file mode 100644
index 000000000000..e50b85c991a2
--- /dev/null
+++ b/test/std/utilities/time/time.duration/time.duration.cast/round.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++03, c++11, c++14
+// <chrono>
+
+// round
+
+// template <class ToDuration, class Rep, class Period>
+// constexpr
+// ToDuration
+// ceil(const duration<Rep, Period>& d);
+
+#include <chrono>
+#include <type_traits>
+#include <cassert>
+
+template <class ToDuration, class FromDuration>
+void
+test(const FromDuration& f, const ToDuration& d)
+{
+ {
+ typedef decltype(std::chrono::round<ToDuration>(f)) R;
+ static_assert((std::is_same<R, ToDuration>::value), "");
+ assert(std::chrono::round<ToDuration>(f) == d);
+ }
+}
+
+int main()
+{
+// 7290000ms is 2 hours, 1 minute, and 30 seconds
+ test(std::chrono::milliseconds( 7290000), std::chrono::hours( 2));
+ test(std::chrono::milliseconds(-7290000), std::chrono::hours(-2));
+ test(std::chrono::milliseconds( 7290000), std::chrono::minutes( 122));
+ test(std::chrono::milliseconds(-7290000), std::chrono::minutes(-122));
+
+ {
+// 9000000ms is 2 hours and 30 minutes
+ constexpr std::chrono::hours h1 = std::chrono::round<std::chrono::hours>(std::chrono::milliseconds(9000000));
+ static_assert(h1.count() == 2, "");
+ constexpr std::chrono::hours h2 = std::chrono::round<std::chrono::hours>(std::chrono::milliseconds(-9000000));
+ static_assert(h2.count() == -2, "");
+ }
+}
diff --git a/test/std/utilities/time/time.point/time.point.cast/ceil.fail.cpp b/test/std/utilities/time/time.point/time.point.cast/ceil.fail.cpp
new file mode 100644
index 000000000000..1c92d75b97ca
--- /dev/null
+++ b/test/std/utilities/time/time.point/time.point.cast/ceil.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++03, c++11, c++14
+// <chrono>
+
+// ceil
+
+// template <class ToDuration, class Clock, class Duration>
+// time_point<Clock, ToDuration>
+// ceil(const time_point<Clock, Duration>& t);
+
+// ToDuration shall be an instantiation of duration.
+
+#include <chrono>
+
+int main()
+{
+ std::chrono::ceil<int>(std::chrono::system_clock::now());
+}
diff --git a/test/std/utilities/time/time.point/time.point.cast/ceil.pass.cpp b/test/std/utilities/time/time.point/time.point.cast/ceil.pass.cpp
new file mode 100644
index 000000000000..379929c7f2d8
--- /dev/null
+++ b/test/std/utilities/time/time.point/time.point.cast/ceil.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++03, c++11, c++14
+// <chrono>
+
+// ceil
+
+// template <class ToDuration, class Clock, class Duration>
+// time_point<Clock, ToDuration>
+// ceil(const time_point<Clock, Duration>& t);
+
+#include <chrono>
+#include <type_traits>
+#include <cassert>
+
+template <class FromDuration, class ToDuration>
+void
+test(const FromDuration& df, const ToDuration& d)
+{
+ typedef std::chrono::system_clock Clock;
+ typedef std::chrono::time_point<Clock, FromDuration> FromTimePoint;
+ typedef std::chrono::time_point<Clock, ToDuration> ToTimePoint;
+ {
+ FromTimePoint f(df);
+ ToTimePoint t(d);
+ typedef decltype(std::chrono::ceil<ToDuration>(f)) R;
+ static_assert((std::is_same<R, ToTimePoint>::value), "");
+ assert(std::chrono::ceil<ToDuration>(f) == t);
+ }
+}
+
+template<class FromDuration, long long From, class ToDuration, long long To>
+void test_constexpr ()
+{
+ typedef std::chrono::system_clock Clock;
+ typedef std::chrono::time_point<Clock, FromDuration> FromTimePoint;
+ typedef std::chrono::time_point<Clock, ToDuration> ToTimePoint;
+ {
+ constexpr FromTimePoint f{FromDuration{From}};
+ constexpr ToTimePoint t{ToDuration{To}};
+ static_assert(std::chrono::ceil<ToDuration>(f) == t, "");
+ }
+}
+
+
+int main()
+{
+// 7290000ms is 2 hours, 1 minute, and 30 seconds
+ test(std::chrono::milliseconds( 7290000), std::chrono::hours( 3));
+ test(std::chrono::milliseconds(-7290000), std::chrono::hours(-2));
+ test(std::chrono::milliseconds( 7290000), std::chrono::minutes( 122));
+ test(std::chrono::milliseconds(-7290000), std::chrono::minutes(-121));
+
+// 9000000ms is 2 hours and 30 minutes
+ test_constexpr<std::chrono::milliseconds, 9000000, std::chrono::hours, 3> ();
+ test_constexpr<std::chrono::milliseconds,-9000000, std::chrono::hours, -2> ();
+ test_constexpr<std::chrono::milliseconds, 9000001, std::chrono::minutes, 151> ();
+ test_constexpr<std::chrono::milliseconds,-9000001, std::chrono::minutes,-150> ();
+
+ test_constexpr<std::chrono::milliseconds, 9000000, std::chrono::seconds, 9000> ();
+ test_constexpr<std::chrono::milliseconds,-9000000, std::chrono::seconds,-9000> ();
+}
diff --git a/test/std/utilities/time/time.point/time.point.cast/floor.fail.cpp b/test/std/utilities/time/time.point/time.point.cast/floor.fail.cpp
new file mode 100644
index 000000000000..ea48e1219e34
--- /dev/null
+++ b/test/std/utilities/time/time.point/time.point.cast/floor.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++03, c++11, c++14
+// <chrono>
+
+// floor
+
+// template <class ToDuration, class Clock, class Duration>
+// time_point<Clock, ToDuration>
+// floor(const time_point<Clock, Duration>& t);
+
+// ToDuration shall be an instantiation of duration.
+
+#include <chrono>
+
+int main()
+{
+ std::chrono::floor<int>(std::chrono::system_clock::now());
+}
diff --git a/test/std/utilities/time/time.point/time.point.cast/floor.pass.cpp b/test/std/utilities/time/time.point/time.point.cast/floor.pass.cpp
new file mode 100644
index 000000000000..d0a908fa932a
--- /dev/null
+++ b/test/std/utilities/time/time.point/time.point.cast/floor.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++03, c++11, c++14
+// <chrono>
+
+// floor
+
+// template <class ToDuration, class Clock, class Duration>
+// time_point<Clock, ToDuration>
+// floor(const time_point<Clock, Duration>& t);
+
+#include <chrono>
+#include <type_traits>
+#include <cassert>
+
+template <class FromDuration, class ToDuration>
+void
+test(const FromDuration& df, const ToDuration& d)
+{
+ typedef std::chrono::system_clock Clock;
+ typedef std::chrono::time_point<Clock, FromDuration> FromTimePoint;
+ typedef std::chrono::time_point<Clock, ToDuration> ToTimePoint;
+ {
+ FromTimePoint f(df);
+ ToTimePoint t(d);
+ typedef decltype(std::chrono::floor<ToDuration>(f)) R;
+ static_assert((std::is_same<R, ToTimePoint>::value), "");
+ assert(std::chrono::floor<ToDuration>(f) == t);
+ }
+}
+
+template<class FromDuration, long long From, class ToDuration, long long To>
+void test_constexpr ()
+{
+ typedef std::chrono::system_clock Clock;
+ typedef std::chrono::time_point<Clock, FromDuration> FromTimePoint;
+ typedef std::chrono::time_point<Clock, ToDuration> ToTimePoint;
+ {
+ constexpr FromTimePoint f{FromDuration{From}};
+ constexpr ToTimePoint t{ToDuration{To}};
+ static_assert(std::chrono::floor<ToDuration>(f) == t, "");
+ }
+}
+
+int main()
+{
+// 7290000ms is 2 hours, 1 minute, and 30 seconds
+ test(std::chrono::milliseconds( 7290000), std::chrono::hours( 2));
+ test(std::chrono::milliseconds(-7290000), std::chrono::hours(-3));
+ test(std::chrono::milliseconds( 7290000), std::chrono::minutes( 121));
+ test(std::chrono::milliseconds(-7290000), std::chrono::minutes(-122));
+
+// 9000000ms is 2 hours and 30 minutes
+ test_constexpr<std::chrono::milliseconds, 9000000, std::chrono::hours, 2> ();
+ test_constexpr<std::chrono::milliseconds,-9000000, std::chrono::hours, -3> ();
+ test_constexpr<std::chrono::milliseconds, 9000001, std::chrono::minutes, 150> ();
+ test_constexpr<std::chrono::milliseconds,-9000001, std::chrono::minutes,-151> ();
+
+ test_constexpr<std::chrono::milliseconds, 9000000, std::chrono::seconds, 9000> ();
+ test_constexpr<std::chrono::milliseconds,-9000000, std::chrono::seconds,-9000> ();
+}
diff --git a/test/std/utilities/time/time.point/time.point.cast/round.fail.cpp b/test/std/utilities/time/time.point/time.point.cast/round.fail.cpp
new file mode 100644
index 000000000000..53c14f47de69
--- /dev/null
+++ b/test/std/utilities/time/time.point/time.point.cast/round.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++03, c++11, c++14
+// <chrono>
+
+// round
+
+// template <class ToDuration, class Clock, class Duration>
+// time_point<Clock, ToDuration>
+// round(const time_point<Clock, Duration>& t);
+
+// ToDuration shall be an instantiation of duration.
+
+#include <chrono>
+
+int main()
+{
+ std::chrono::round<int>(std::chrono::system_clock::now());
+}
diff --git a/test/std/utilities/time/time.point/time.point.cast/round.pass.cpp b/test/std/utilities/time/time.point/time.point.cast/round.pass.cpp
new file mode 100644
index 000000000000..ab8bf3a75e79
--- /dev/null
+++ b/test/std/utilities/time/time.point/time.point.cast/round.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++03, c++11, c++14
+// <chrono>
+
+// round
+
+// template <class ToDuration, class Clock, class Duration>
+// time_point<Clock, ToDuration>
+// round(const time_point<Clock, Duration>& t);
+
+#include <chrono>
+#include <type_traits>
+#include <cassert>
+
+template <class FromDuration, class ToDuration>
+void
+test(const FromDuration& df, const ToDuration& d)
+{
+ typedef std::chrono::system_clock Clock;
+ typedef std::chrono::time_point<Clock, FromDuration> FromTimePoint;
+ typedef std::chrono::time_point<Clock, ToDuration> ToTimePoint;
+ {
+ FromTimePoint f(df);
+ ToTimePoint t(d);
+ typedef decltype(std::chrono::round<ToDuration>(f)) R;
+ static_assert((std::is_same<R, ToTimePoint>::value), "");
+ assert(std::chrono::round<ToDuration>(f) == t);
+ }
+}
+
+template<class FromDuration, long long From, class ToDuration, long long To>
+void test_constexpr ()
+{
+ typedef std::chrono::system_clock Clock;
+ typedef std::chrono::time_point<Clock, FromDuration> FromTimePoint;
+ typedef std::chrono::time_point<Clock, ToDuration> ToTimePoint;
+ {
+ constexpr FromTimePoint f{FromDuration{From}};
+ constexpr ToTimePoint t{ToDuration{To}};
+ static_assert(std::chrono::round<ToDuration>(f) == t, "");
+ }
+}
+
+int main()
+{
+// 7290000ms is 2 hours, 1 minute, and 30 seconds
+ test(std::chrono::milliseconds( 7290000), std::chrono::hours( 2));
+ test(std::chrono::milliseconds(-7290000), std::chrono::hours(-2));
+ test(std::chrono::milliseconds( 7290000), std::chrono::minutes( 122));
+ test(std::chrono::milliseconds(-7290000), std::chrono::minutes(-122));
+
+// 9000000ms is 2 hours and 30 minutes
+ test_constexpr<std::chrono::milliseconds, 9000000, std::chrono::hours, 2> ();
+ test_constexpr<std::chrono::milliseconds,-9000000, std::chrono::hours, -2> ();
+ test_constexpr<std::chrono::milliseconds, 9000001, std::chrono::minutes, 150> ();
+ test_constexpr<std::chrono::milliseconds,-9000001, std::chrono::minutes,-150> ();
+
+ test_constexpr<std::chrono::milliseconds, 9000000, std::chrono::seconds, 9000> ();
+ test_constexpr<std::chrono::milliseconds,-9000000, std::chrono::seconds,-9000> ();
+}
diff --git a/test/std/utilities/time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp b/test/std/utilities/time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp
index c32350faa83b..f9ddc87a7a14 100644
--- a/test/std/utilities/time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp
+++ b/test/std/utilities/time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp
@@ -20,6 +20,10 @@ test()
{
static_assert((std::is_base_of<std::is_floating_point<T>,
std::chrono::treat_as_floating_point<T> >::value), "");
+#if TEST_STD_VER > 14
+ static_assert((std::is_base_of<std::is_floating_point<T>,
+ std::chrono::treat_as_floating_point_v<T> >), "");
+#endif
}
struct A {};
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
new file mode 100644
index 000000000000..58df2df7679a
--- /dev/null
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.fail.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.
+//
+//===----------------------------------------------------------------------===//
+
+// <tuple>
+
+// template <class... Types> class tuple;
+
+// template <size_t I, class... Types>
+// const typename tuple_element<I, tuple<Types...> >::type&&
+// get(const tuple<Types...>&& t);
+
+// UNSUPPORTED: c++98, c++03
+
+#include <tuple>
+
+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); }
+
+int main()
+{
+ // LWG2485: tuple should not open a hole in the type system, get() should
+ // imitate [expr.ref]'s rules for accessing data members
+ {
+ cref(std::get<0>(tup4())); // expected-error {{call to deleted function 'cref'}}
+ }
+}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.pass.cpp
new file mode 100644
index 000000000000..720a9064015d
--- /dev/null
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.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.
+//
+//===----------------------------------------------------------------------===//
+
+// <tuple>
+
+// template <class... Types> class tuple;
+
+// template <size_t I, class... Types>
+// const typename tuple_element<I, tuple<Types...> >::type&&
+// get(const tuple<Types...>&& t);
+
+// UNSUPPORTED: c++98, c++03
+
+#include <tuple>
+#include <utility>
+#include <string>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main()
+{
+ {
+ typedef std::tuple<int> T;
+ const T t(3);
+ static_assert(std::is_same<const int&&, decltype(std::get<0>(std::move(t)))>::value, "");
+ static_assert(noexcept(std::get<0>(std::move(t))), "");
+ const int&& i = std::get<0>(std::move(t));
+ assert(i == 3);
+ }
+
+ {
+ typedef std::tuple<std::string, int> T;
+ const T t("high", 5);
+ static_assert(std::is_same<const std::string&&, decltype(std::get<0>(std::move(t)))>::value, "");
+ static_assert(noexcept(std::get<0>(std::move(t))), "");
+ static_assert(std::is_same<const int&&, decltype(std::get<1>(std::move(t)))>::value, "");
+ static_assert(noexcept(std::get<1>(std::move(t))), "");
+ const std::string&& s = std::get<0>(std::move(t));
+ const int&& i = std::get<1>(std::move(t));
+ assert(s == "high");
+ assert(i == 5);
+ }
+
+ {
+ int x = 42;
+ int const y = 43;
+ std::tuple<int&, int const&> const p(x, y);
+ static_assert(std::is_same<int&, decltype(std::get<0>(std::move(p)))>::value, "");
+ static_assert(noexcept(std::get<0>(std::move(p))), "");
+ static_assert(std::is_same<int const&, decltype(std::get<1>(std::move(p)))>::value, "");
+ static_assert(noexcept(std::get<1>(std::move(p))), "");
+ }
+
+ {
+ int x = 42;
+ int const y = 43;
+ std::tuple<int&&, int const&&> const p(std::move(x), std::move(y));
+ static_assert(std::is_same<int&&, decltype(std::get<0>(std::move(p)))>::value, "");
+ static_assert(noexcept(std::get<0>(std::move(p))), "");
+ static_assert(std::is_same<int const&&, decltype(std::get<1>(std::move(p)))>::value, "");
+ static_assert(noexcept(std::get<1>(std::move(p))), "");
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::tuple<double, int> T;
+ constexpr const T t(2.718, 5);
+ static_assert(std::get<0>(std::move(t)) == 2.718, "");
+ static_assert(std::get<1>(std::move(t)) == 5, "");
+ }
+#endif
+}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp
index aa020dab47c7..b661a78de8db 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp
@@ -10,30 +10,31 @@
// UNSUPPORTED: c++98, c++03, c++11
#include <tuple>
+#include <utility>
#include <string>
#include <complex>
+#include <type_traits>
#include <cassert>
int main()
{
-#if _LIBCPP_STD_VER > 11
typedef std::complex<float> cf;
{
auto t1 = std::tuple<int, std::string, cf> { 42, "Hi", { 1,2 }};
- assert ( std::get<int>(t1) == 42 ); // find at the beginning
+ assert ( std::get<int>(t1) == 42 ); // find at the beginning
assert ( std::get<std::string>(t1) == "Hi" ); // find in the middle
assert ( std::get<cf>(t1).real() == 1 ); // find at the end
assert ( std::get<cf>(t1).imag() == 2 );
}
-
+
{
auto t2 = std::tuple<int, std::string, int, cf> { 42, "Hi", 23, { 1,2 }};
// get<int> would fail!
assert ( std::get<std::string>(t2) == "Hi" );
assert (( std::get<cf>(t2) == cf{ 1,2 } ));
}
-
+
{
constexpr std::tuple<int, const int, double, double> p5 { 1, 2, 3.4, 5.6 };
static_assert ( std::get<int>(p5) == 1, "" );
@@ -53,8 +54,40 @@ int main()
std::tuple<upint> t(upint(new int(4)));
upint p = std::get<upint>(std::move(t)); // get rvalue
assert(*p == 4);
- assert(std::get<0>(t) == nullptr); // has been moved from
+ assert(std::get<upint>(t) == nullptr); // has been moved from
+ }
+
+ {
+ typedef std::unique_ptr<int> upint;
+ const std::tuple<upint> t(upint(new int(4)));
+ const upint&& p = std::get<upint>(std::move(t)); // get const rvalue
+ assert(*p == 4);
+ assert(std::get<upint>(t) != nullptr);
}
-#endif
+ {
+ int x = 42;
+ int y = 43;
+ std::tuple<int&, int const&> const t(x, y);
+ static_assert(std::is_same<int&, decltype(std::get<int&>(std::move(t)))>::value, "");
+ static_assert(noexcept(std::get<int&>(std::move(t))), "");
+ static_assert(std::is_same<int const&, decltype(std::get<int const&>(std::move(t)))>::value, "");
+ static_assert(noexcept(std::get<int const&>(std::move(t))), "");
+ }
+
+ {
+ int x = 42;
+ int y = 43;
+ std::tuple<int&&, int const&&> const t(std::move(x), std::move(y));
+ static_assert(std::is_same<int&&, decltype(std::get<int&&>(std::move(t)))>::value, "");
+ static_assert(noexcept(std::get<int&&>(std::move(t))), "");
+ static_assert(std::is_same<int const&&, decltype(std::get<int const&&>(std::move(t)))>::value, "");
+ static_assert(noexcept(std::get<int const&&>(std::move(t))), "");
+ }
+
+ {
+ constexpr const std::tuple<int, const int, double, double> t { 1, 2, 3.4, 5.6 };
+ static_assert(std::get<int>(std::move(t)) == 1, "");
+ static_assert(std::get<const int>(std::move(t)) == 2, "");
+ }
}
diff --git a/test/std/utilities/utility/as_const/as_const.fail.cpp b/test/std/utilities/utility/as_const/as_const.fail.cpp
new file mode 100644
index 000000000000..6334e1460259
--- /dev/null
+++ b/test/std/utilities/utility/as_const/as_const.fail.cpp
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// template <class T> constexpr add_const<T>& as_const(T& t) noexcept; // C++17
+// template <class T> add_const<T>& as_const(const T&&) = delete; // C++17
+
+#include <utility>
+
+struct S {int i;};
+
+int main()
+{
+ std::as_const(S{});
+}
diff --git a/test/std/utilities/utility/as_const/as_const.pass.cpp b/test/std/utilities/utility/as_const/as_const.pass.cpp
new file mode 100644
index 000000000000..ff3f84a5532f
--- /dev/null
+++ b/test/std/utilities/utility/as_const/as_const.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.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// template <class T> constexpr add_const<T>& as_const(T& t) noexcept; // C++17
+// template <class T> add_const<T>& as_const(const T&&) = delete; // C++17
+
+#include <utility>
+#include <cassert>
+
+struct S {int i;};
+bool operator==(const S& x, const S& y) { return x.i == y.i; }
+bool operator==(const volatile S& x, const volatile S& y) { return x.i == y.i; }
+
+template<typename T>
+void test(T& t)
+{
+ static_assert(std::is_const<typename std::remove_reference<decltype(std::as_const (t))>::type>::value, "");
+ static_assert(std::is_const<typename std::remove_reference<decltype(std::as_const< T>(t))>::type>::value, "");
+ static_assert(std::is_const<typename std::remove_reference<decltype(std::as_const<const T>(t))>::type>::value, "");
+ static_assert(std::is_const<typename std::remove_reference<decltype(std::as_const<volatile T>(t))>::type>::value, "");
+ static_assert(std::is_const<typename std::remove_reference<decltype(std::as_const<const volatile T>(t))>::type>::value, "");
+
+ assert(std::as_const(t) == t);
+ assert(std::as_const< T>(t) == t);
+ assert(std::as_const<const T>(t) == t);
+ assert(std::as_const<volatile T>(t) == t);
+ assert(std::as_const<const volatile T>(t) == t);
+}
+
+int main()
+{
+ int i = 3;
+ double d = 4.0;
+ S s{2};
+ test(i);
+ test(d);
+ test(s);
+}
diff --git a/test/std/utilities/utility/declval/declval.pass.cpp b/test/std/utilities/utility/declval/declval.pass.cpp
index 81f4df8e8b2b..aabd0e6f6c74 100644
--- a/test/std/utilities/utility/declval/declval.pass.cpp
+++ b/test/std/utilities/utility/declval/declval.pass.cpp
@@ -14,6 +14,8 @@
#include <utility>
#include <type_traits>
+#include "test_macros.h"
+
class A
{
A(const A&);
@@ -22,9 +24,9 @@ class A
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
static_assert((std::is_same<decltype(std::declval<A>()), A&&>::value), "");
#else
- static_assert((std::is_same<decltype(std::declval<A>()), A>::value), "");
+ static_assert((std::is_same<decltype(std::declval<A>()), A&>::value), "");
#endif
}
diff --git a/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp b/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp
index c8375e9d7238..bc60d3d27614 100644
--- a/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp
+++ b/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp
@@ -56,13 +56,14 @@ int main()
static_assert((std::is_same<decltype(std::move_if_noexcept(ca)), const A&&>::value), "");
static_assert((std::is_same<decltype(std::move_if_noexcept(l)), const legacy&>::value), "");
#else // C++ < 11
- // libc++ defines decltype to be __typeof__ in C++03. __typeof__ does not
- // deduce the reference qualifiers.
- static_assert((std::is_same<decltype(std::move_if_noexcept(i)), const int>::value), "");
- static_assert((std::is_same<decltype(std::move_if_noexcept(ci)), const int>::value), "");
- static_assert((std::is_same<decltype(std::move_if_noexcept(a)), const A>::value), "");
- static_assert((std::is_same<decltype(std::move_if_noexcept(ca)), const A>::value), "");
- static_assert((std::is_same<decltype(std::move_if_noexcept(l)), const legacy>::value), "");
+ // In C++03 libc++ #define's decltype to be __decltype on clang and
+ // __typeof__ for other compilers. __typeof__ does not deduce the reference
+ // qualifiers and will cause this test to fail.
+ static_assert((std::is_same<decltype(std::move_if_noexcept(i)), const int&>::value), "");
+ static_assert((std::is_same<decltype(std::move_if_noexcept(ci)), const int&>::value), "");
+ static_assert((std::is_same<decltype(std::move_if_noexcept(a)), const A&>::value), "");
+ static_assert((std::is_same<decltype(std::move_if_noexcept(ca)), const A&>::value), "");
+ static_assert((std::is_same<decltype(std::move_if_noexcept(l)), const legacy&>::value), "");
#endif
#if TEST_STD_VER > 11
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
new file mode 100644
index 000000000000..edd2f3d0752f
--- /dev/null
+++ b/test/std/utilities/utility/pairs/pair.astuple/get_const_rv.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.
+//
+//===----------------------------------------------------------------------===//
+
+// <utility>
+
+// template <class T1, class T2> struct pair
+
+// template<size_t I, class T1, class T2>
+// const typename tuple_element<I, std::pair<T1, T2> >::type&&
+// get(const pair<T1, T2>&&);
+
+// UNSUPPORTED: c++98, c++03
+
+#include <utility>
+#include <memory>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main()
+{
+ {
+ typedef std::pair<std::unique_ptr<int>, short> P;
+ const P p(std::unique_ptr<int>(new int(3)), 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));
+ assert(*ptr == 3);
+ }
+
+ {
+ int x = 42;
+ int const y = 43;
+ std::pair<int&, int const&> const p(x, y);
+ static_assert(std::is_same<int&, decltype(std::get<0>(std::move(p)))>::value, "");
+ static_assert(noexcept(std::get<0>(std::move(p))), "");
+ static_assert(std::is_same<int const&, decltype(std::get<1>(std::move(p)))>::value, "");
+ static_assert(noexcept(std::get<1>(std::move(p))), "");
+ }
+
+ {
+ int x = 42;
+ int const y = 43;
+ std::pair<int&&, int const&&> const p(std::move(x), std::move(y));
+ static_assert(std::is_same<int&&, decltype(std::get<0>(std::move(p)))>::value, "");
+ static_assert(noexcept(std::get<0>(std::move(p))), "");
+ static_assert(std::is_same<int const&&, decltype(std::get<1>(std::move(p)))>::value, "");
+ static_assert(noexcept(std::get<1>(std::move(p))), "");
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::pair<int, short> P;
+ constexpr const P p1(3, 4);
+ static_assert(std::get<0>(std::move(p1)) == 3, "");
+ static_assert(std::get<1>(std::move(p1)) == 4, "");
+ }
+#endif
+}
diff --git a/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type.pass.cpp b/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type.pass.cpp
index 176d58330d16..efcc2cedc6e1 100644
--- a/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type.pass.cpp
+++ b/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type.pass.cpp
@@ -7,15 +7,17 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11
+
#include <utility>
#include <string>
+#include <type_traits>
#include <complex>
#include <cassert>
int main()
{
-#if _LIBCPP_STD_VER > 11
typedef std::complex<float> cf;
{
auto t1 = std::make_pair<int, cf> ( 42, { 1,2 } );
@@ -23,7 +25,7 @@ int main()
assert ( std::get<cf>(t1).real() == 1 );
assert ( std::get<cf>(t1).imag() == 2 );
}
-
+
{
const std::pair<int, const int> p1 { 1, 2 };
const int &i1 = std::get<int>(p1);
@@ -35,10 +37,48 @@ int main()
{
typedef std::unique_ptr<int> upint;
std::pair<upint, int> t(upint(new int(4)), 42);
- upint p = std::get<0>(std::move(t)); // get rvalue
+ upint p = std::get<upint>(std::move(t)); // get rvalue
+ assert(*p == 4);
+ assert(std::get<upint>(t) == nullptr); // has been moved from
+ }
+
+ {
+ typedef std::unique_ptr<int> upint;
+ const std::pair<upint, int> t(upint(new int(4)), 42);
+ static_assert(std::is_same<const upint&&, decltype(std::get<upint>(std::move(t)))>::value, "");
+ static_assert(noexcept(std::get<upint>(std::move(t))), "");
+ static_assert(std::is_same<const int&&, decltype(std::get<int>(std::move(t)))>::value, "");
+ static_assert(noexcept(std::get<int>(std::move(t))), "");
+ auto&& p = std::get<upint>(std::move(t)); // get const rvalue
+ auto&& i = std::get<int>(std::move(t)); // get const rvalue
assert(*p == 4);
- assert(std::get<0>(t) == nullptr); // has been moved from
+ assert(i == 42);
+ assert(std::get<upint>(t) != nullptr);
}
-#endif
+ {
+ int x = 42;
+ int const y = 43;
+ std::pair<int&, int const&> const p(x, y);
+ static_assert(std::is_same<int&, decltype(std::get<int&>(std::move(p)))>::value, "");
+ static_assert(noexcept(std::get<int&>(std::move(p))), "");
+ static_assert(std::is_same<int const&, decltype(std::get<int const&>(std::move(p)))>::value, "");
+ static_assert(noexcept(std::get<int const&>(std::move(p))), "");
+ }
+
+ {
+ int x = 42;
+ int const y = 43;
+ std::pair<int&&, int const&&> const p(std::move(x), std::move(y));
+ static_assert(std::is_same<int&&, decltype(std::get<int&&>(std::move(p)))>::value, "");
+ static_assert(noexcept(std::get<int&&>(std::move(p))), "");
+ static_assert(std::is_same<int const&&, decltype(std::get<int const&&>(std::move(p)))>::value, "");
+ static_assert(noexcept(std::get<int const&&>(std::move(p))), "");
+ }
+
+ {
+ constexpr const std::pair<int, const int> p { 1, 2 };
+ static_assert(std::get<int>(std::move(p)) == 1, "");
+ static_assert(std::get<const int>(std::move(p)) == 2, "");
+ }
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/default-sfinae.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/default-sfinae.pass.cpp
new file mode 100644
index 000000000000..8f9fc669251a
--- /dev/null
+++ b/test/std/utilities/utility/pairs/pairs.pair/default-sfinae.pass.cpp
@@ -0,0 +1,164 @@
+//===----------------------------------------------------------------------===//
+//
+// The 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
+
+// Test the SFINAE required by LWG Issue #2367.
+// is_default_constructible<pair>
+
+// UNSUPPORTED: c++98, c++03
+
+#include <utility>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+#if TEST_STD_VER > 11
+#define CONSTEXPR_CXX14 constexpr
+#define STATIC_ASSERT_CXX14(Pred) static_assert(Pred, "")
+#else
+#define CONSTEXPR_CXX14
+#define STATIC_ASSERT_CXX14(Pred) assert(Pred)
+#endif
+
+struct DeletedDefault {
+ // A class with a deleted default constructor. Used to test the SFINAE
+ // on std::pairs default constructor.
+ constexpr explicit DeletedDefault(int x) : value(x) {}
+ constexpr DeletedDefault() = delete;
+ int value;
+};
+
+template <class Tp, bool>
+struct DependantType: public Tp {};
+
+template <class T, bool Val>
+using DependantIsDefault = DependantType<std::is_default_constructible<T>, Val>;
+
+template <class T>
+struct DefaultSFINAES {
+ template <bool Dummy = false, class = typename std::enable_if<
+ DependantIsDefault<T, Dummy>::value
+ >::type
+ >
+ constexpr DefaultSFINAES() : value() {}
+ constexpr explicit DefaultSFINAES(T const& x) : value(x) {}
+ T value;
+};
+
+struct NoDefault {
+ constexpr NoDefault(int v) : value(v) {}
+ int value;
+};
+
+template <class Tp>
+void test_not_is_default_constructible()
+{
+ {
+ typedef std::pair<int, Tp> P;
+ static_assert(!std::is_default_constructible<P>::value, "");
+ static_assert(std::is_constructible<P, int, Tp>::value, "");
+ }
+ {
+ typedef std::pair<Tp, int> P;
+ static_assert(!std::is_default_constructible<P>::value, "");
+ static_assert(std::is_constructible<P, Tp, int>::value, "");
+ }
+ {
+ typedef std::pair<Tp, Tp> P;
+ static_assert(!std::is_default_constructible<P>::value, "");
+ static_assert(std::is_constructible<P, Tp, Tp>::value, "");
+ }
+}
+
+template <class Tp>
+void test_is_default_constructible()
+{
+ {
+ typedef std::pair<int, Tp> P;
+ static_assert(std::is_default_constructible<P>::value, "");
+ }
+ {
+ typedef std::pair<Tp, int> P;
+ static_assert(std::is_default_constructible<P>::value, "");
+ }
+ {
+ typedef std::pair<Tp, Tp> P;
+ static_assert(std::is_default_constructible<P>::value, "");
+ }
+}
+
+template <class T>
+struct IllFormedDefaultImp {
+ constexpr explicit IllFormedDefaultImp(int v) : value(v) {}
+ constexpr IllFormedDefaultImp() : value(T::DoesNotExistAndShouldNotCompile) {}
+ int value;
+};
+
+typedef IllFormedDefaultImp<int> IllFormedDefault;
+ // A class which provides a constexpr default constructor with a valid
+ // signature but an ill-formed body. The A compile error will be emitted if
+ // the default constructor is instantiated.
+
+
+// Check that the SFINAE on the default constructor is not evaluated when
+// it isn't needed. If the default constructor of 'IllFormedDefault' is evaluated
+// in C++11, even with is_default_constructible, then this test should fail to
+// compile. In C++14 and greater evaluate each test is evaluated as a constant
+// expression.
+// See LWG issue #2367
+void test_illformed_default()
+{
+ {
+ typedef std::pair<IllFormedDefault, int> P;
+ static_assert((std::is_constructible<P, IllFormedDefault, int>::value), "");
+ CONSTEXPR_CXX14 P p(IllFormedDefault(42), -5);
+ STATIC_ASSERT_CXX14(p.first.value == 42 && p.second == -5);
+ }
+ {
+ typedef std::pair<int, IllFormedDefault> P;
+ static_assert((std::is_constructible<P, int, IllFormedDefault>::value), "");
+ CONSTEXPR_CXX14 IllFormedDefault dd(-5);
+ CONSTEXPR_CXX14 P p(42, dd);
+ STATIC_ASSERT_CXX14(p.first == 42 && p.second.value == -5);
+ }
+ {
+ typedef std::pair<IllFormedDefault, IllFormedDefault> P;
+ static_assert((std::is_constructible<P, IllFormedDefault, IllFormedDefault>::value), "");
+ CONSTEXPR_CXX14 P p(IllFormedDefault(42), IllFormedDefault(-5));
+ STATIC_ASSERT_CXX14(p.first.value == 42 && p.second.value == -5);
+ }
+}
+
+
+int main()
+{
+ {
+ // Check that pair<T, U> can still be used even if
+ // is_default_constructible<T> or is_default_constructible<U> cause
+ // a compilation error.
+ test_illformed_default();
+ }
+ {
+ // pair::pair() is only disable in C++11 and beyond.
+ test_not_is_default_constructible<NoDefault>();
+ test_not_is_default_constructible<DeletedDefault>();
+ test_not_is_default_constructible<DefaultSFINAES<int&>>();
+ test_not_is_default_constructible<DefaultSFINAES<int&&>>();
+ test_not_is_default_constructible<int&>();
+ test_not_is_default_constructible<int&&>();
+ }
+ {
+ test_is_default_constructible<int>();
+ test_is_default_constructible<DefaultSFINAES<int>>();
+ }
+}
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 bb6661f7966c..d83328b8f2d0 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
@@ -13,9 +13,15 @@
// constexpr pair();
+// NOTE: The SFINAE on the default constructor is tested in
+// default-sfinae.pass.cpp
+
#include <utility>
+#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -24,13 +30,12 @@ int main()
assert(p.first == 0.0f);
assert(p.second == nullptr);
}
-
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 11
{
- typedef std::pair<float, short*> P;
- constexpr P p;
- static_assert(p.first == 0.0f, "");
- static_assert(p.second == nullptr, "");
+ typedef std::pair<float, short*> P;
+ constexpr P p;
+ static_assert(p.first == 0.0f, "");
+ static_assert(p.second == nullptr, "");
}
#endif
}
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 a912df00d7bb..0ad5786bce29 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/swap.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/swap.pass.cpp
@@ -16,6 +16,15 @@
#include <utility>
#include <cassert>
+struct S {
+ int i;
+ S() : i(0) {}
+ S(int j) : i(j) {}
+ S * operator& () { assert(false); return this; }
+ S const * operator& () const { assert(false); return this; }
+ bool operator==(int x) const { return i == x; }
+ };
+
int main()
{
{
@@ -28,4 +37,14 @@ int main()
assert(p2.first == 3);
assert(p2.second == 4);
}
+ {
+ typedef std::pair<int, S> P1;
+ P1 p1(3, S(4));
+ P1 p2(5, S(6));
+ p1.swap(p2);
+ assert(p1.first == 5);
+ assert(p1.second == 6);
+ assert(p2.first == 3);
+ assert(p2.second == 4);
+ }
}
diff --git a/test/support/allocators.h b/test/support/allocators.h
index b7aba12e21fd..7c2103ff2721 100644
--- a/test/support/allocators.h
+++ b/test/support/allocators.h
@@ -35,6 +35,8 @@ public:
A1(const A1& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;}
A1(A1&& a) TEST_NOEXCEPT : id_(a.id()) {move_called = true;}
+ A1& operator=(const A1& a) TEST_NOEXCEPT { id_ = a.id(); copy_called = true; return *this;}
+ A1& operator=(A1&& a) TEST_NOEXCEPT { id_ = a.id(); move_called = true; return *this;}
template <class U>
A1(const A1<U>& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;}
@@ -96,6 +98,8 @@ public:
A2(const A2& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;}
A2(A2&& a) TEST_NOEXCEPT : id_(a.id()) {move_called = true;}
+ A2& operator=(const A2& a) TEST_NOEXCEPT { id_ = a.id(); copy_called = true; return *this;}
+ A2& operator=(A2&& a) TEST_NOEXCEPT { id_ = a.id(); move_called = true; return *this;}
T* allocate(std::size_t n, const void* hint)
{
@@ -142,7 +146,9 @@ public:
static bool destroy_called;
A3(const A3& a) TEST_NOEXCEPT : id_(a.id()) {copy_called = true;}
- A3(A3&& a) TEST_NOEXCEPT: id_(a.id()) {move_called = true;}
+ A3(A3&& a) TEST_NOEXCEPT : id_(a.id()) {move_called = true;}
+ A3& operator=(const A3& a) TEST_NOEXCEPT { id_ = a.id(); copy_called = true; return *this;}
+ A3& operator=(A3&& a) TEST_NOEXCEPT { id_ = a.id(); move_called = true; return *this;}
template <class U, class ...Args>
void construct(U* p, Args&& ...args)
diff --git a/test/support/any_helpers.h b/test/support/any_helpers.h
new file mode 100644
index 000000000000..76b1922fb1f1
--- /dev/null
+++ b/test/support/any_helpers.h
@@ -0,0 +1,318 @@
+#ifndef ANY_HELPERS_H
+#define 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/count_new.hpp b/test/support/count_new.hpp
index ddaf036f7d16..57aca7def335 100644
--- a/test/support/count_new.hpp
+++ b/test/support/count_new.hpp
@@ -30,6 +30,10 @@ public:
// All checks return true when disable_checking is enabled.
static const bool disable_checking;
+ // Disallow any allocations from occurring. Useful for testing that
+ // code doesn't perform any allocations.
+ bool disable_allocations;
+
int outstanding_new;
int new_called;
int delete_called;
@@ -43,6 +47,7 @@ public:
public:
void newCalled(std::size_t s)
{
+ assert(disable_allocations == false);
assert(s);
++new_called;
++outstanding_new;
@@ -58,6 +63,7 @@ public:
void newArrayCalled(std::size_t s)
{
+ assert(disable_allocations == false);
assert(s);
++outstanding_array_new;
++new_array_called;
@@ -71,8 +77,20 @@ public:
++delete_array_called;
}
+ void disableAllocations()
+ {
+ disable_allocations = true;
+ }
+
+ void enableAllocations()
+ {
+ disable_allocations = false;
+ }
+
void reset()
{
+ disable_allocations = false;
+
outstanding_new = 0;
new_called = 0;
delete_called = 0;
@@ -203,4 +221,29 @@ void operator delete[](void* p) throw()
#endif // DISABLE_NEW_COUNT
+
+struct DisableAllocationGuard {
+ explicit DisableAllocationGuard(bool disable = true) : m_disabled(disable)
+ {
+ // Don't re-disable if already disabled.
+ if (globalMemCounter.disable_allocations == true) m_disabled = false;
+ if (m_disabled) globalMemCounter.disableAllocations();
+ }
+
+ void release() {
+ if (m_disabled) globalMemCounter.enableAllocations();
+ m_disabled = false;
+ }
+
+ ~DisableAllocationGuard() {
+ release();
+ }
+
+private:
+ bool m_disabled;
+
+ DisableAllocationGuard(DisableAllocationGuard const&);
+ DisableAllocationGuard& operator=(DisableAllocationGuard const&);
+};
+
#endif /* COUNT_NEW_HPP */
diff --git a/test/support/disable_missing_braces_warning.h b/test/support/disable_missing_braces_warning.h
new file mode 100644
index 000000000000..967a87ab3a2e
--- /dev/null
+++ b/test/support/disable_missing_braces_warning.h
@@ -0,0 +1,8 @@
+#ifndef SUPPORT_DISABLE_MISSING_BRACES_WARNING_H
+#define SUPPORT_DISABLE_MISSING_BRACES_WARNING_H
+
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#pragma GCC diagnostic ignored "-Wmissing-braces"
+
+#endif // SUPPORT_DISABLE_MISSING_BRACES_WARNING_H
diff --git a/test/support/test_allocator.h b/test/support/test_allocator.h
index 47ef1d556784..3ca672f89a9b 100644
--- a/test/support/test_allocator.h
+++ b/test/support/test_allocator.h
@@ -171,13 +171,13 @@ public:
template <class U> struct rebind {typedef test_allocator<U> other;};
- test_allocator() throw() : data_(-1) {}
+ 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_ = 0;}
+ ~test_allocator() throw() {data_ = -1;}
friend bool operator==(const test_allocator& x, const test_allocator& y)
{return x.data_ == y.data_;}
diff --git a/test/support/test_macros.h b/test/support/test_macros.h
index a08ca87be935..c34e8cf7ef14 100644
--- a/test/support/test_macros.h
+++ b/test/support/test_macros.h
@@ -14,12 +14,24 @@
#define TEST_CONCAT1(X, Y) X##Y
#define TEST_CONCAT(X, Y) TEST_CONCAT1(X, Y)
+#ifdef __has_feature
+#define TEST_HAS_FEATURE(X) __has_feature(X)
+#else
+#define TEST_HAS_FEATURE(X) 0
+#endif
+
#ifdef __has_extension
#define TEST_HAS_EXTENSION(X) __has_extension(X)
#else
#define TEST_HAS_EXTENSION(X) 0
#endif
+#ifdef __has_builtin
+#define TEST_HAS_BUILTIN(X) __has_builtin(X)
+#else
+#define TEST_HAS_BUILTIN(X) 0
+#endif
+
/* Make a nice name for the standard version */
#if __cplusplus <= 199711L
# define TEST_STD_VER 3
@@ -56,8 +68,10 @@
#endif
#if TEST_STD_VER >= 11
+#define TEST_CONSTEXPR constexpr
#define TEST_NOEXCEPT noexcept
#else
+#define TEST_CONSTEXPR
#define TEST_NOEXCEPT
#endif
@@ -80,4 +94,17 @@ template <unsigned> struct static_assert_check {};
} // end namespace test_detail
+#if !TEST_HAS_FEATURE(cxx_rtti) && !defined(__cxx_rtti)
+#define TEST_HAS_NO_RTTI
+#endif
+
+#if !TEST_HAS_FEATURE(cxx_exceptions) && !defined(__cxx_exceptions)
+#define TEST_HAS_NO_EXCEPTIONS
+#endif
+
+#if TEST_HAS_FEATURE(address_sanitizer) || TEST_HAS_FEATURE(memory_sanitizer) || \
+ TEST_HAS_FEATURE(thread_sanitizer)
+#define TEST_HAS_SANITIZERS
+#endif
+
#endif // SUPPORT_TEST_MACROS_HPP
diff --git a/test/testit b/test/testit
index 821292efb5a3..cac668497fa5 100755
--- a/test/testit
+++ b/test/testit
@@ -42,7 +42,7 @@ then
fi
if [ -z "$OPTIONS" ]
then
- OPTIONS="-std=${CXX_LANG} -stdlib=libc++"
+ OPTIONS="-std=${CXX_LANG} -stdlib=libc++ -nostdinc++"
fi
OPTIONS="$OPTIONS -I$LIBCXX_ROOT/test/support"
diff --git a/utils/gen_link_script/gen_link_script.py b/utils/gen_link_script/gen_link_script.py
new file mode 100755
index 000000000000..5de18f9129c6
--- /dev/null
+++ b/utils/gen_link_script/gen_link_script.py
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+import os
+import sys
+
+def print_and_exit(msg):
+ sys.stderr.write(msg + '\n')
+ sys.exit(1)
+
+def usage_and_exit():
+ print_and_exit("Usage: ./gen_link_script.py [--help] [--dryrun] <path/to/libcxx.so> <abi_libname>")
+
+def help_and_exit():
+ help_msg = \
+"""Usage
+
+ gen_link_script.py [--help] [--dryrun] <path/to/libcxx.so> <abi_libname>
+
+ Generate a linker script that links libc++ to the proper ABI library.
+ The script replaces the specified libc++ symlink.
+ An example script for c++abi would look like "INPUT(libc++.so.1 -lc++abi)".
+
+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].
+
+Exit Status:
+ 0 if OK,
+ 1 if the action failed.
+"""
+ print_and_exit(help_msg)
+
+def parse_args():
+ args = list(sys.argv)
+ del args[0]
+ if len(args) == 0:
+ usage_and_exit()
+ if args[0] == '--help':
+ help_and_exit()
+ dryrun = '--dryrun' == args[0]
+ if dryrun:
+ del args[0]
+ if len(args) != 2:
+ usage_and_exit()
+ symlink_file = args[0]
+ abi_libname = args[1]
+ return dryrun, symlink_file, abi_libname
+
+def main():
+ dryrun, symlink_file, abi_libname = parse_args()
+
+ # Check that the given libc++.so file is a valid symlink.
+ if not os.path.islink(symlink_file):
+ print_and_exit("symlink file %s is not a symlink" % symlink_file)
+
+ # 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))
+
+ # Generate the linker script contents and print the script and destination
+ # information.
+ contents = "INPUT(%s -l%s)" % (linked_libcxx, abi_libname)
+ print("GENERATING SCRIPT: '%s' as file %s" % (contents, symlink_file))
+
+ # Remove the existing libc++ symlink and replace it with the script.
+ if not dryrun:
+ os.unlink(symlink_file)
+ with open(symlink_file, 'w') as f:
+ f.write(contents + "\n")
+
+
+if __name__ == '__main__':
+ main()
diff --git a/www/cxx1y_status.html b/www/cxx1y_status.html
index 2b9c05ae1e2f..f28d67a7dd3e 100644
--- a/www/cxx1y_status.html
+++ b/www/cxx1y_status.html
@@ -109,165 +109,165 @@
<!-- <I>Note: "NAD" means that the issue was deemed "Not a defect"</I> -->
<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://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#1214">1214</a></td><td>Insufficient/inconsistent key immutability requirements for associative containers</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2009">2009</a></td><td>Reporting out-of-bound values on numeric string conversions</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2010">2010</a></td><td>is_* traits for binding operations can't be meaningfully specialized</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2015">2015</a></td><td>Incorrect pre-conditions for some type traits</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2021">2021</a></td><td>Further incorrect usages of result_of</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2028">2028</a></td><td>messages_base::catalog overspecified</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2033">2033</a></td><td>Preconditions of reserve, shrink_to_fit, and resize functions</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2039">2039</a></td><td>Issues with std::reverse and std::copy_if</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2044">2044</a></td><td>No definition of "Stable" for copy algorithms</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2045">2045</a></td><td>forward_list::merge and forward_list::splice_after with unequal allocators</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2047">2047</a></td><td>Incorrect "mixed" move-assignment semantics of unique_ptr</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2050">2050</a></td><td>Unordered associative containers do not use allocator_traits to define member types</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2053">2053</a></td><td>Errors in regex bitmask types</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2061">2061</a></td><td>make_move_iterator and arrays</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2064">2064</a></td><td>More noexcept issues in basic_string</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2065">2065</a></td><td>Minimal allocator interface</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2067">2067</a></td><td>packaged_task should have deleted copy c'tor with const parameter</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2069">2069</a></td><td>Inconsistent exception spec for basic_string move constructor</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2096">2096</a></td><td>Incorrect constraints of future::get in regard to MoveAssignable</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2102">2102</a></td><td>Why is std::launch an implementation-defined type?</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#1214">1214</a></td><td>Insufficient/inconsistent key immutability requirements for associative containers</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2009">2009</a></td><td>Reporting out-of-bound values on numeric string conversions</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2010">2010</a></td><td>is_* traits for binding operations can't be meaningfully specialized</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2015">2015</a></td><td>Incorrect pre-conditions for some type traits</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2021">2021</a></td><td>Further incorrect usages of result_of</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2028">2028</a></td><td>messages_base::catalog overspecified</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2033">2033</a></td><td>Preconditions of reserve, shrink_to_fit, and resize functions</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2039">2039</a></td><td>Issues with std::reverse and std::copy_if</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2044">2044</a></td><td>No definition of "Stable" for copy algorithms</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2045">2045</a></td><td>forward_list::merge and forward_list::splice_after with unequal allocators</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2047">2047</a></td><td>Incorrect "mixed" move-assignment semantics of unique_ptr</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2050">2050</a></td><td>Unordered associative containers do not use allocator_traits to define member types</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2053">2053</a></td><td>Errors in regex bitmask types</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2061">2061</a></td><td>make_move_iterator and arrays</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2064">2064</a></td><td>More noexcept issues in basic_string</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2065">2065</a></td><td>Minimal allocator interface</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2067">2067</a></td><td>packaged_task should have deleted copy c'tor with const parameter</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2069">2069</a></td><td>Inconsistent exception spec for basic_string move constructor</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2096">2096</a></td><td>Incorrect constraints of future::get in regard to MoveAssignable</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2102">2102</a></td><td>Why is std::launch an implementation-defined type?</td><td>Kona</td><td>Complete</td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2071">2071</a></td><td>std::valarray move-assignment</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2074">2074</a></td><td>Off by one error in std::reverse_copy</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2081">2081</a></td><td>Allocator requirements should include CopyConstructible</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2083">2083</a></td><td>const-qualification on weak_ptr::owner_before</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2086">2086</a></td><td>Overly generic type support for math functions</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2099">2099</a></td><td>Unnecessary constraints of va_start() usage</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2103">2103</a></td><td>std::allocator_traits&lt;std::allocator&lt;T&gt;&gt;::propagate_on_container_move_assignment</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2105">2105</a></td><td>Inconsistent requirements on const_iterator's value_type</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2110">2110</a></td><td>remove can't swap but note says it might</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2123">2123</a></td><td>merge() allocator requirements for lists versus forward lists</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2005">2005</a></td><td>unordered_map::insert(T&&) protection should apply to map too</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2011">2011</a></td><td>Unexpected output required of strings</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2048">2048</a></td><td>Unnecessary mem_fn overloads</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2049">2049</a></td><td>is_destructible is underspecified</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2056">2056</a></td><td>future_errc enums start with value 0 (invalid value for broken_promise)</td><td>Portland</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2058">2058</a></td><td>valarray and begin/end</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2071">2071</a></td><td>std::valarray move-assignment</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2074">2074</a></td><td>Off by one error in std::reverse_copy</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2081">2081</a></td><td>Allocator requirements should include CopyConstructible</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2083">2083</a></td><td>const-qualification on weak_ptr::owner_before</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2086">2086</a></td><td>Overly generic type support for math functions</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2099">2099</a></td><td>Unnecessary constraints of va_start() usage</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2103">2103</a></td><td>std::allocator_traits&lt;std::allocator&lt;T&gt;&gt;::propagate_on_container_move_assignment</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2105">2105</a></td><td>Inconsistent requirements on const_iterator's value_type</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2110">2110</a></td><td>remove can't swap but note says it might</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2123">2123</a></td><td>merge() allocator requirements for lists versus forward lists</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2005">2005</a></td><td>unordered_map::insert(T&&) protection should apply to map too</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2011">2011</a></td><td>Unexpected output required of strings</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2048">2048</a></td><td>Unnecessary mem_fn overloads</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2049">2049</a></td><td>is_destructible is underspecified</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2056">2056</a></td><td>future_errc enums start with value 0 (invalid value for broken_promise)</td><td>Portland</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2058">2058</a></td><td>valarray and begin/end</td><td>Portland</td><td>Complete</td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2091">2091</a></td><td>Misplaced effect in m.try_lock_for()</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2092">2092</a></td><td>Vague Wording for condition_variable_any</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2093">2093</a></td><td>Throws clause of condition_variable::wait with predicate</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2094">2094</a></td><td>duration conversion overflow shouldn't participate in overload resolution</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2122">2122</a></td><td>merge() stability for lists versus forward lists</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2128">2128</a></td><td>Absence of global functions cbegin/cend</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2145">2145</a></td><td>error_category default constructor</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2147">2147</a></td><td>Unclear hint type in Allocator's allocate function</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148">2148</a></td><td>Hashing enums should be supported directly by std::hash</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2149">2149</a></td><td>Concerns about 20.8/5</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2162">2162</a></td><td>allocator_traits::max_size missing noexcept</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2163">2163</a></td><td>nth_element requires inconsistent post-conditions</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2169">2169</a></td><td>Missing reset() requirements in unique_ptr specialization</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2172">2172</a></td><td>Does atomic_compare_exchange_* accept v == nullptr arguments?</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2080">2080</a></td><td>Specify when once_flag becomes invalid</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2098">2098</a></td><td>promise throws clauses</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2109">2109</a></td><td>Incorrect requirements for hash specializations</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2130">2130</a></td><td>missing ordering constraints for fences</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2138">2138</a></td><td>atomic_flag::clear ordering constraints</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2140">2140</a></td><td>notify_all_at_thread_exit synchronization</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2144">2144</a></td><td>Missing noexcept specification in type_index</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2174">2174</a></td><td>wstring_convert::converted() should be noexcept</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2175">2175</a></td><td>string_convert and wbuffer_convert validity</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2176">2176</a></td><td>Special members for wstring_convert and wbuffer_convert</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2177">2177</a></td><td>Requirements on Copy/MoveInsertable</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2185">2185</a></td><td>Missing throws clause for future/shared_future::wait_for/wait_until</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2187">2187</a></td><td>vector&lt;bool&gt; is missing emplace and emplace_back member functions</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2190">2190</a></td><td>ordering of condition variable operations, reflects Posix discussion</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2196">2196</a></td><td>Specification of is_*[copy/move]_[constructible/assignable] unclear for non-referencable types</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2197">2197</a></td><td>Specification of is_[un]signed unclear for non-arithmetic types</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2200">2200</a></td><td>Data race avoidance for all containers, not only for sequences</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2203">2203</a></td><td>scoped_allocator_adaptor uses wrong argument types for piecewise construction</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2207">2207</a></td><td>basic_string::at should not have a Requires clause</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2209">2209</a></td><td>assign() overspecified for sequence containers</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2210">2210</a></td><td>Missing allocator-extended constructor for allocator-aware containers</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2211">2211</a></td><td>Replace ambiguous use of "Allocator" in container requirements</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2222">2222</a></td><td>Inconsistency in description of forward_list::splice_after single-element overload</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2225">2225</a></td><td>Unrealistic header inclusion checks required</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2229">2229</a></td><td>Standard code conversion facets underspecified</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2231">2231</a></td><td>DR 704 removes complexity guarantee for clear()</td><td>Bristol</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2235">2235</a></td><td>Undefined behavior without proper requirements on basic_string constructors</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2091">2091</a></td><td>Misplaced effect in m.try_lock_for()</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2092">2092</a></td><td>Vague Wording for condition_variable_any</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2093">2093</a></td><td>Throws clause of condition_variable::wait with predicate</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2094">2094</a></td><td>duration conversion overflow shouldn't participate in overload resolution</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2122">2122</a></td><td>merge() stability for lists versus forward lists</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2128">2128</a></td><td>Absence of global functions cbegin/cend</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2145">2145</a></td><td>error_category default constructor</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2147">2147</a></td><td>Unclear hint type in Allocator's allocate function</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2148">2148</a></td><td>Hashing enums should be supported directly by std::hash</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2149">2149</a></td><td>Concerns about 20.8/5</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2162">2162</a></td><td>allocator_traits::max_size missing noexcept</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2163">2163</a></td><td>nth_element requires inconsistent post-conditions</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2169">2169</a></td><td>Missing reset() requirements in unique_ptr specialization</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2172">2172</a></td><td>Does atomic_compare_exchange_* accept v == nullptr arguments?</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2080">2080</a></td><td>Specify when once_flag becomes invalid</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2098">2098</a></td><td>promise throws clauses</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2109">2109</a></td><td>Incorrect requirements for hash specializations</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2130">2130</a></td><td>missing ordering constraints for fences</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2138">2138</a></td><td>atomic_flag::clear ordering constraints</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2140">2140</a></td><td>notify_all_at_thread_exit synchronization</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2144">2144</a></td><td>Missing noexcept specification in type_index</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2174">2174</a></td><td>wstring_convert::converted() should be noexcept</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2175">2175</a></td><td>string_convert and wbuffer_convert validity</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2176">2176</a></td><td>Special members for wstring_convert and wbuffer_convert</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2177">2177</a></td><td>Requirements on Copy/MoveInsertable</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2185">2185</a></td><td>Missing throws clause for future/shared_future::wait_for/wait_until</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2187">2187</a></td><td>vector&lt;bool&gt; is missing emplace and emplace_back member functions</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2190">2190</a></td><td>ordering of condition variable operations, reflects Posix discussion</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2196">2196</a></td><td>Specification of is_*[copy/move]_[constructible/assignable] unclear for non-referencable types</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2197">2197</a></td><td>Specification of is_[un]signed unclear for non-arithmetic types</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2200">2200</a></td><td>Data race avoidance for all containers, not only for sequences</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2203">2203</a></td><td>scoped_allocator_adaptor uses wrong argument types for piecewise construction</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2207">2207</a></td><td>basic_string::at should not have a Requires clause</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2209">2209</a></td><td>assign() overspecified for sequence containers</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2210">2210</a></td><td>Missing allocator-extended constructor for allocator-aware containers</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2211">2211</a></td><td>Replace ambiguous use of "Allocator" in container requirements</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2222">2222</a></td><td>Inconsistency in description of forward_list::splice_after single-element overload</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2225">2225</a></td><td>Unrealistic header inclusion checks required</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2229">2229</a></td><td>Standard code conversion facets underspecified</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2231">2231</a></td><td>DR 704 removes complexity guarantee for clear()</td><td>Bristol</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2235">2235</a></td><td>Undefined behavior without proper requirements on basic_string constructors</td><td>Bristol</td><td>Complete</td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2141">2141</a></td><td>common_type trait produces reference types</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2246">2246</a></td><td>unique_ptr assignment effects w.r.t. deleter</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2247">2247</a></td><td>Type traits and std::nullptr_t</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2085">2085</a></td><td>Wrong description of effect 1 of basic_istream::ignore</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2087">2087</a></td><td>iostream_category() and noexcept</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2143">2143</a></td><td>ios_base::xalloc should be thread-safe</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2150">2150</a></td><td>Unclear specification of find_end</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2180">2180</a></td><td>Exceptions from std::seed_seq operations</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2194">2194</a></td><td>Impossible container requirements for adaptor types</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2013">2013</a></td><td>Do library implementers have the freedom to add constexpr?</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2018">2018</a></td><td>regex_traits::isctype Returns clause is wrong</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2078">2078</a></td><td>Throw specification of async() incomplete</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2097">2097</a></td><td>packaged_task constructors should be constrained</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2100">2100</a></td><td>Timed waiting functions cannot timeout if launch::async policy used</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2120">2120</a></td><td>What should async do if neither 'async' nor 'deferred' is set in policy?</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2159">2159</a></td><td>atomic_flag initialization</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2275">2275</a></td><td>Why is forward_as_tuple not constexpr?</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2284">2284</a></td><td>Inconsistency in allocator_traits::max_size</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2298">2298</a></td><td>is_nothrow_constructible is always false because of create&lt;&gt;</td><td>Chicago</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2300">2300</a></td><td>Redundant sections for map and multimap members should be removed</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2141">2141</a></td><td>common_type trait produces reference types</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2246">2246</a></td><td>unique_ptr assignment effects w.r.t. deleter</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2247">2247</a></td><td>Type traits and std::nullptr_t</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2085">2085</a></td><td>Wrong description of effect 1 of basic_istream::ignore</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2087">2087</a></td><td>iostream_category() and noexcept</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2143">2143</a></td><td>ios_base::xalloc should be thread-safe</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2150">2150</a></td><td>Unclear specification of find_end</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2180">2180</a></td><td>Exceptions from std::seed_seq operations</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2194">2194</a></td><td>Impossible container requirements for adaptor types</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2013">2013</a></td><td>Do library implementers have the freedom to add constexpr?</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2018">2018</a></td><td>regex_traits::isctype Returns clause is wrong</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2078">2078</a></td><td>Throw specification of async() incomplete</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2097">2097</a></td><td>packaged_task constructors should be constrained</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2100">2100</a></td><td>Timed waiting functions cannot timeout if launch::async policy used</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2120">2120</a></td><td>What should async do if neither 'async' nor 'deferred' is set in policy?</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2159">2159</a></td><td>atomic_flag initialization</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2275">2275</a></td><td>Why is forward_as_tuple not constexpr?</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2284">2284</a></td><td>Inconsistency in allocator_traits::max_size</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2298">2298</a></td><td>is_nothrow_constructible is always false because of create&lt;&gt;</td><td>Chicago</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2300">2300</a></td><td>Redundant sections for map and multimap members should be removed</td><td>Chicago</td><td>Complete</td></tr>
<tr><td>NB comment: GB9</td> <td>Remove gets from C++14</td><td>Chicago</td><td>Complete</td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2135">2135</a></td><td>Unclear requirement for exceptions thrown in condition_variable::wait()</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2291">2291</a></td><td>std::hash is vulnerable to collision DoS attack</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2142">2142</a></td><td>packaged_task::operator() synchronization too broad?</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2240">2240</a></td><td>Probable misuse of term "function scope" in [thread.condition]</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252">2252</a></td><td>Strong guarantee on vector::push_back() still broken with C++11?</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2257">2257</a></td><td>Simplify container requirements with the new algorithms</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2268">2268</a></td><td>Setting a default argument in the declaration of a member function assign of std::basic_string</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2271">2271</a></td><td>regex_traits::lookup_classname specification unclear</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2272">2272</a></td><td>quoted should use char_traits::eq for character comparison</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2278">2278</a></td><td>User-defined literals for Standard Library types</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2280">2280</a></td><td>begin / end for arrays should be constexpr and noexcept</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2285">2285</a></td><td>make_reverse_iterator</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2135">2135</a></td><td>Unclear requirement for exceptions thrown in condition_variable::wait()</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2291">2291</a></td><td>std::hash is vulnerable to collision DoS attack</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2142">2142</a></td><td>packaged_task::operator() synchronization too broad?</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2240">2240</a></td><td>Probable misuse of term "function scope" in [thread.condition]</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2252">2252</a></td><td>Strong guarantee on vector::push_back() still broken with C++11?</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2257">2257</a></td><td>Simplify container requirements with the new algorithms</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2268">2268</a></td><td>Setting a default argument in the declaration of a member function assign of std::basic_string</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2271">2271</a></td><td>regex_traits::lookup_classname specification unclear</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2272">2272</a></td><td>quoted should use char_traits::eq for character comparison</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2278">2278</a></td><td>User-defined literals for Standard Library types</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2280">2280</a></td><td>begin / end for arrays should be constexpr and noexcept</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2285">2285</a></td><td>make_reverse_iterator</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2299">2299</a></td><td>Effects of inaccessible key_compare::is_transparent type are not clear</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2299">2299</a></td><td>Effects of inaccessible key_compare::is_transparent type are not clear</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#1450">1450</a></td><td>Contradiction in regex_constants</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2003">2003</a></td><td>String exception inconsistency in erase.</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2112">2112</a></td><td>User-defined classes that cannot be derived from</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2132">2132</a></td><td>std::function ambiguity</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2182">2182</a></td><td>Container::[const_]reference types are misleadingly specified</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2188">2188</a></td><td>Reverse iterator does not fully support targets that overload operator&</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2193">2193</a></td><td>Default constructors for standard library containers are explicit</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2205">2205</a></td><td>Problematic postconditions of regex_match and regex_search</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2213">2213</a></td><td>Return value of std::regex_replace</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#1450">1450</a></td><td>Contradiction in regex_constants</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2003">2003</a></td><td>String exception inconsistency in erase.</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2112">2112</a></td><td>User-defined classes that cannot be derived from</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2132">2132</a></td><td>std::function ambiguity</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2182">2182</a></td><td>Container::[const_]reference types are misleadingly specified</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2188">2188</a></td><td>Reverse iterator does not fully support targets that overload operator&</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2193">2193</a></td><td>Default constructors for standard library containers are explicit</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2205">2205</a></td><td>Problematic postconditions of regex_match and regex_search</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2213">2213</a></td><td>Return value of std::regex_replace</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2258">2258</a></td><td>a.erase(q1, q2) unable to directly return q2</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2263">2263</a></td><td>Comparing iterators and allocator pointers with different const-character</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2293">2293</a></td><td>Wrong facet used by num_put::do_put</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2301">2301</a></td><td>Why is std::tie not constexpr?</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2304">2304</a></td><td>Complexity of count in unordered associative containers</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2306">2306</a></td><td>match_results::reference should be value_type&, not const value_type&</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2308">2308</a></td><td>Clarify container destructor requirements w.r.t. std::array</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2313">2313</a></td><td>tuple_size should always derive from integral_constant<size_t, N></td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2314">2314</a></td><td>apply() should return decltype(auto) and use decay_t before tuple_size</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2315">2315</a></td><td>weak_ptr should be movable</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2316">2316</a></td><td>weak_ptr::lock() should be atomic</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2317">2317</a></td><td>The type property queries should be UnaryTypeTraits returning size_t</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2320">2320</a></td><td>select_on_container_copy_construction() takes allocators, not containers</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2322">2322</a></td><td>Associative(initializer_list, stuff) constructors are underspecified</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2323">2323</a></td><td>vector::resize(n, t)'s specification should be simplified</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2324">2324</a></td><td>Insert iterator constructors should use addressof()</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2329">2329</a></td><td>regex_match()/regex_search() with match_results should forbid temporary strings</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2330">2330</a></td><td>regex("meow", regex::icase) is technically forbidden but should be permitted</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2332">2332</a></td><td>regex_iterator/regex_token_iterator should forbid temporary regexes</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2339">2339</a></td><td>Wording issue in nth_element</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2341">2341</a></td><td>Inconsistency between basic_ostream::seekp(pos) and basic_ostream::seekp(off, dir)</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2344">2344</a></td><td>quoted()'s interaction with padding is unclear</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2346">2346</a></td><td>integral_constant's member functions should be marked noexcept</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2350">2350</a></td><td>min, max, and minmax should be constexpr</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2356">2356</a></td><td>Stability of erasure in unordered associative containers</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2357">2357</a></td><td>Remaining "Assignable" requirement</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2359">2359</a></td><td>How does regex_constants::nosubs affect basic_regex::mark_count()?</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2360">2360</a></td><td>reverse_iterator::operator*() is unimplementable</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2104">2104</a></td><td>unique_lock move-assignment should not be noexcept</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2186">2186</a></td><td>Incomplete action on async/launch::deferred</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2075">2075</a></td><td>Progress guarantees, lock-free property, and scheduling assumptions</td><td>Issaquah</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2288">2288</a></td><td>Inconsistent requirements for shared mutexes</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2258">2258</a></td><td>a.erase(q1, q2) unable to directly return q2</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2263">2263</a></td><td>Comparing iterators and allocator pointers with different const-character</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2293">2293</a></td><td>Wrong facet used by num_put::do_put</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2301">2301</a></td><td>Why is std::tie not constexpr?</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2304">2304</a></td><td>Complexity of count in unordered associative containers</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2306">2306</a></td><td>match_results::reference should be value_type&, not const value_type&</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2308">2308</a></td><td>Clarify container destructor requirements w.r.t. std::array</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2313">2313</a></td><td>tuple_size should always derive from integral_constant<size_t, N></td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2314">2314</a></td><td>apply() should return decltype(auto) and use decay_t before tuple_size</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2315">2315</a></td><td>weak_ptr should be movable</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2316">2316</a></td><td>weak_ptr::lock() should be atomic</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2317">2317</a></td><td>The type property queries should be UnaryTypeTraits returning size_t</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2320">2320</a></td><td>select_on_container_copy_construction() takes allocators, not containers</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2322">2322</a></td><td>Associative(initializer_list, stuff) constructors are underspecified</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2323">2323</a></td><td>vector::resize(n, t)'s specification should be simplified</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2324">2324</a></td><td>Insert iterator constructors should use addressof()</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2329">2329</a></td><td>regex_match()/regex_search() with match_results should forbid temporary strings</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2330">2330</a></td><td>regex("meow", regex::icase) is technically forbidden but should be permitted</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2332">2332</a></td><td>regex_iterator/regex_token_iterator should forbid temporary regexes</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2339">2339</a></td><td>Wording issue in nth_element</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2341">2341</a></td><td>Inconsistency between basic_ostream::seekp(pos) and basic_ostream::seekp(off, dir)</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2344">2344</a></td><td>quoted()'s interaction with padding is unclear</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2346">2346</a></td><td>integral_constant's member functions should be marked noexcept</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2350">2350</a></td><td>min, max, and minmax should be constexpr</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2356">2356</a></td><td>Stability of erasure in unordered associative containers</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2357">2357</a></td><td>Remaining "Assignable" requirement</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2359">2359</a></td><td>How does regex_constants::nosubs affect basic_regex::mark_count()?</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2360">2360</a></td><td>reverse_iterator::operator*() is unimplementable</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2104">2104</a></td><td>unique_lock move-assignment should not be noexcept</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2186">2186</a></td><td>Incomplete action on async/launch::deferred</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2075">2075</a></td><td>Progress guarantees, lock-free property, and scheduling assumptions</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2288">2288</a></td><td>Inconsistent requirements for shared mutexes</td><td>Issaquah</td><td>Complete</td></tr>
<!-- <tr><td></td><td></td><td></td><td></td></tr> -->
</table>
diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html
index 436981087d82..42bc3d76032a 100644
--- a/www/cxx1z_status.html
+++ b/www/cxx1z_status.html
@@ -69,6 +69,14 @@
<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>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4510">N4510</a></td><td>LWG</td></td><td>Minimal incomplete type support for standard containers, revision 4</td><td>Lenexa</td><td>Complete</td><td>3.6</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/P0004R1.html">P0004R1</a></td><td>LWG</td><td>Remove Deprecated iostreams aliases.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0006R0.html">P0006R0</a></td><td>LWG</td><td>Adopt Type Traits Variable Templates for C++17.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0092R1.html">P0092R1</a></td><td>LWG</td><td>Polishing &lt;chrono&gt;</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0007R1.html">P0007R1</a></td><td>LWG</td><td>Constant View: A proposal for a <tt>std::as_const</tt> helper function template.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0156R0.htm" >P0156R0</a></td><td>LWG</td><td>Variadic lock_guard(rev 3).</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0074R0.html">P0074R0</a></td><td>LWG</td><td>Making <tt>std::owner_less</tt> more flexible</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0013R1.html">P0013R1</a></td><td>LWG</td><td>Logical type traits rev 2</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
<!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> -->
</table>
@@ -76,76 +84,115 @@
<!-- <I>Note: "NAD" means that the issue was deemed "Not a defect"</I> -->
<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://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2016">2016</a></td><td>Allocators must be no-throw swappable</td><td>Urbana</td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2376">2118</td><td><code>unique_ptr</code> for array does not support cv qualification conversion of actual argument</td><td>Urbana</td><td>Will be resolved by N4089</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2170">2170</a></td><td>Aggregates cannot be <code>DefaultConstructible</code></td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2308">2308</td><td>Clarify container destructor requirements w.r.t. <code>std::array</code></td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2340">2340</a></td><td>Replacement allocation functions declared as inline</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2354">2354</a></td><td>Unnecessary copying when inserting into maps with braced-init syntax</td><td>Urbana</td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2377">2377</a></td><td><code>std::align</code> requirements overly strict</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2396">2396</a></td><td><code>underlying_type</code> doesn't say what to do for an incomplete enumeration type</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2399">2399</a></td><td><code>shared_ptr</code>'s constructor from <code>unique_ptr</code> should be constrained</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2400">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://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2401">2401</a></td><td><code>std::function</code> needs more noexcept</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2404">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://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2408">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://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2465">LWG#2465</a></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2016">2016</a></td><td>Allocators must be no-throw swappable</td><td>Urbana</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2376">2118</td><td><code>unique_ptr</code> for array does not support cv qualification conversion of actual argument</td><td>Urbana</td><td>Will be resolved by N4089</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2170">2170</a></td><td>Aggregates cannot be <code>DefaultConstructible</code></td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2308">2308</td><td>Clarify container destructor requirements w.r.t. <code>std::array</code></td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2340">2340</a></td><td>Replacement allocation functions declared as inline</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2354">2354</a></td><td>Unnecessary copying when inserting into maps with braced-init syntax</td><td>Urbana</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2377">2377</a></td><td><code>std::align</code> requirements overly strict</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2396">2396</a></td><td><code>underlying_type</code> doesn't say what to do for an incomplete enumeration type</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2399">2399</a></td><td><code>shared_ptr</code>'s constructor from <code>unique_ptr</code> should be constrained</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2400">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://cplusplus.github.io/LWG/lwg-defects.html#2401">2401</a></td><td><code>std::function</code> needs more noexcept</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2404">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://cplusplus.github.io/LWG/lwg-defects.html#2408">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://cplusplus.github.io/LWG/lwg-defects.html#2465">LWG#2465</a></td></tr>
+ <tr><td></td><td></td><td></td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2106">2106</td><td><code>move_iterator</code> wrapping iterators returning prvalues</td><td>Urbana</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2129">2129</td><td>User specializations of <code>std::initializer_list</code></td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2212">2212</td><td><code>tuple_size</code> for <code>const pair</code> request <tuple> header</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2217">2217</td><td><code>operator==(sub_match, string)</code> slices on embedded '\0's</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2230">2230</td><td>"see below" for <code>initializer_list</code> constructors of unordered containers</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2233">2233</td><td><code>bad_function_call::what()</code> unhelpful</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2266">2266</td><td><code>vector</code> and <code>deque</code> have incorrect insert requirements</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2325">2325</td><td><code>minmax_element()</code>'s behavior differing from <code>max_element()</code>'s should be noted</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2361">2361</td><td>Apply 2299 resolution throughout library</td><td>Urbana</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2365">2365</td><td>Missing noexcept in <code>shared_ptr::shared_ptr(nullptr_t)</code></td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2376">2376</td><td><code>bad_weak_ptr::what()</code> overspecified</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2387">2387</td><td>More nested types that must be accessible and unambiguous</td><td>Urbana</td><td>Complete</td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2106">2106</td><td><code>move_iterator</code> wrapping iterators returning prvalues</td><td>Urbana</td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2129">2129</td><td>User specializations of <code>std::initializer_list</code></td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2212">2212</td><td><code>tuple_size</code> for <code>const pair</code> request <tuple> header</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2217">2217</td><td><code>operator==(sub_match, string)</code> slices on embedded '\0's</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2230">2230</td><td>"see below" for <code>initializer_list</code> constructors of unordered containers</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2233">2233</td><td><code>bad_function_call::what()</code> unhelpful</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2266">2266</td><td><code>vector</code> and <code>deque</code> have incorrect insert requirements</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2325">2325</td><td><code>minmax_element()</code>'s behavior differing from <code>max_element()</code>'s should be noted</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2361">2361</td><td>Apply 2299 resolution throughout library</td><td>Urbana</td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2365">2365</td><td>Missing noexcept in <code>shared_ptr::shared_ptr(nullptr_t)</code></td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2376">2376</td><td><code>bad_weak_ptr::what()</code> overspecified</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2387">2387</td><td>More nested types that must be accessible and unambiguous</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2059">2059</td><td>C++0x ambiguity problem with map::erase</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2063">2063</td><td>Contradictory requirements for string move assignment</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2076">2076</td><td>Bad CopyConstructible requirement in set constructors</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2160">2160</td><td>Unintended destruction ordering-specification of resize</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2168">2168</td><td>Inconsistent specification of uniform_real_distribution constructor</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2239">2239</td><td>min/max/minmax requirements</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2364">2364</td><td>deque and vector pop_back don't specify iterator invalidation requirements</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2369">2369</td><td>constexpr max(initializer_list) vs max_element</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2378">2378</td><td>Behaviour of standard exception types</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2403">2403</td><td>stof() should call strtof() and wcstof()</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2406">2406</td><td>negative_binomial_distribution should reject p == 1</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2407">2407</td><td>packaged_task(allocator_arg_t, const Allocator&, F&&) should neither be constrained nor explicit</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2411">2411</td><td>shared_ptr is only contextually convertible to bool</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2415">2415</td><td>Inconsistency between unique_ptr and shared_ptr</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2420">2420</td><td>function<void(ArgTypes...)> does not discard the return value of the target object</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2425">2425</td><td>operator delete(void*, size_t) doesn't invalidate pointers sufficiently</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2427">2427</td><td>Container adaptors as sequence containers, redux</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2428">2428</td><td>"External declaration" used without being defined</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2433">2433</td><td>uninitialized_copy()/etc. should tolerate overloaded operator&</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2434">2434</td><td>shared_ptr::use_count() is efficient</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2437">2437</td><td>iterator_traits::reference can and can't be void</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2438">2438</td><td>std::iterator inheritance shouldn't be mandated</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2439">2439</td><td>unique_copy() sometimes can't fall back to reading its output</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2440">2440</td><td>seed_seq::size() should be noexcept</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2442">2442</td><td>call_once() shouldn't DECAY_COPY()</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2448">2448</td><td>Non-normative Container destructor specification</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2454">2454</td><td>Add raw_storage_iterator::base() member</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2455">2455</td><td>Allocator default construction should be allowed to throw</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2458">2458</td><td>N3778 and new library deallocation signatures</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2459">2459</td><td>std::polar should require a non-negative rho</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2464">2464</td><td>try_emplace and insert_or_assign misspecified</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2467">2467</td><td>is_always_equal has slightly inconsistent default</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2470">2470</td><td>Allocator's destroy function should be allowed to fail to instantiate</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2482">2482</td><td>[c.strings] Table 73 mentions nonexistent functions</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2488">2488</td><td>Placeholders should be allowed and encouraged to be constexpr</td><td>Lenexa</td><td></td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2059">2059</td><td>C++0x ambiguity problem with map::erase</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2063">2063</td><td>Contradictory requirements for string move assignment</td><td>Lenexa</td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2076">2076</td><td>Bad CopyConstructible requirement in set constructors</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2160">2160</td><td>Unintended destruction ordering-specification of resize</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2168">2168</td><td>Inconsistent specification of uniform_real_distribution constructor</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2239">2239</td><td>min/max/minmax requirements</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2364">2364</td><td>deque and vector pop_back don't specify iterator invalidation requirements</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2369">2369</td><td>constexpr max(initializer_list) vs max_element</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2378">2378</td><td>Behaviour of standard exception types</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2403">2403</td><td>stof() should call strtof() and wcstof()</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2406">2406</td><td>negative_binomial_distribution should reject p == 1</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2407">2407</td><td>packaged_task(allocator_arg_t, const Allocator&, F&&) should neither be constrained nor explicit</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2411">2411</td><td>shared_ptr is only contextually convertible to bool</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2415">2415</td><td>Inconsistency between unique_ptr and shared_ptr</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2420">2420</td><td>function<void(ArgTypes...)> does not discard the return value of the target object</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2425">2425</td><td>operator delete(void*, size_t) doesn't invalidate pointers sufficiently</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2427">2427</td><td>Container adaptors as sequence containers, redux</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2428">2428</td><td>"External declaration" used without being defined</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2433">2433</td><td>uninitialized_copy()/etc. should tolerate overloaded operator&</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2434">2434</td><td>shared_ptr::use_count() is efficient</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2437">2437</td><td>iterator_traits::reference can and can't be void</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2438">2438</td><td>std::iterator inheritance shouldn't be mandated</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2439">2439</td><td>unique_copy() sometimes can't fall back to reading its output</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2440">2440</td><td>seed_seq::size() should be noexcept</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2442">2442</td><td>call_once() shouldn't DECAY_COPY()</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2448">2448</td><td>Non-normative Container destructor specification</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2454">2454</td><td>Add raw_storage_iterator::base() member</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2455">2455</td><td>Allocator default construction should be allowed to throw</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2458">2458</td><td>N3778 and new library deallocation signatures</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2459">2459</td><td>std::polar should require a non-negative rho</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2464">2464</td><td>try_emplace and insert_or_assign misspecified</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2467">2467</td><td>is_always_equal has slightly inconsistent default</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2470">2470</td><td>Allocator's destroy function should be allowed to fail to instantiate</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2482">2482</td><td>[c.strings] Table 73 mentions nonexistent functions</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2488">2488</td><td>Placeholders should be allowed and encouraged to be constexpr</td><td>Lenexa</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#1169">1169</a></td><td><tt>num_get</tt> not fully compatible with <tt>strto*</tt></td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2072">2072</a></td><td>Unclear wording about capacity of temporary buffers</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2101">2101</a></td><td>Some transformation types can produce impossible types</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2111">2111</a></td><td>Which <tt>unexpected</tt>&#47;<tt>terminate</tt> handler is called from the exception handling runtime?</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2119">2119</a></td><td>Missing <tt>hash</tt> specializations for extended integer types</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2127">2127</a></td><td>Move-construction with <tt>raw_storage_iterator</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2133">2133</a></td><td>Attitude to overloaded comma for iterators</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2156">2156</a></td><td>Unordered containers' <tt>reserve(n)</tt> reserves for <tt>n-1</tt> elements</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2218">2218</a></td><td>Unclear how containers use <tt>allocator_traits::construct()</tt></td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2219">2219</a></td><td><tt><i>INVOKE</i></tt>-ing a pointer to member with a <tt>reference_wrapper</tt> as the object expression</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2224">2224</a></td><td>Ambiguous status of access to non-live objects</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2234">2234</a></td><td><tt>assert()</tt> should allow usage in constant expressions</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2244">2244</a></td><td>Issue on <tt>basic_istream::seekg</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2250">2250</a></td><td>Follow-up On Library Issue 2207</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2259">2259</a></td><td>Issues in 17.6.5.5 rules for member functions</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2273">2273</a></td><td><tt>regex_match</tt> ambiguity</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2336">2336</a></td><td><tt>is_trivially_constructible/is_trivially_assignable</tt> traits are always false</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2353">2353</a></td><td><tt>std::next</tt> is over-constrained</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2367">2367</a></td><td><tt>pair</tt> and <tt>tuple</tt> are not correctly implemented for <tt>is_constructible</tt> with no args</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2380">2380</a></td><td>May <tt>&lt;cstdlib&gt;</tt> provide <tt>long ::abs(long)</tt> and <tt>long long ::abs(long long)</tt>?</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2384">2384</a></td><td>Allocator's <tt>deallocate</tt> function needs better specification</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2385">2385</a></td><td><tt>function::assign</tt> allocator argument doesn't make sense</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2435">2435</a></td><td><tt>reference_wrapper::operator()</tt>'s Remark should be deleted</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2447">2447</a></td><td>Allocators and <tt>volatile</tt>-qualified value types</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2462">2462</a></td><td><tt>std::ios_base::failure</tt> is overspecified</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2466">2466</a></td><td><tt>allocator_traits::max_size()</tt> default behavior is incorrect</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2469">2469</a></td><td>Wrong specification of Requires clause of <tt>operator[]</tt> for <tt>map</tt> and <tt>unordered_map</tt></td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2473">2473</a></td><td><tt>basic_filebuf</tt>'s relation to C <tt>FILE</tt> semantics</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2476">2476</a></td><td><tt>scoped_allocator_adaptor</tt> is not assignable</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2477">2477</a></td><td>Inconsistency of wordings in <tt>std::vector::erase()</tt> and <tt>std::deque::erase()</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2483">2483</a></td><td><tt>throw_with_nested()</tt> should use <tt>is_final</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2484">2484</a></td><td><tt>rethrow_if_nested()</tt> is doubly unimplementable</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2485">2485</a></td><td><tt>get()</tt> should be overloaded for <tt>const tuple&amp;&amp;</tt></td><td>Kona</td><td>Completed</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2486">2486</a></td><td><tt>mem_fn()</tt> should be required to use perfect forwarding</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2487">2487</a></td><td><tt>bind()</tt> should be <tt>const</tt>-overloaded, not <i>cv</i>-overloaded</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2489">2489</a></td><td><tt>mem_fn()</tt> should be <tt>noexcept</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2492">2492</a></td><td>Clarify requirements for <tt>comp</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2495">2495</a></td><td>There is no such thing as an Exception Safety element</td><td>Kona</td><td>Complete</td></tr>
<!--
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#1214">1214</a></td><td>Insufficient/inconsistent key immutability requirements for associative containers</td><td>Urbana</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#1214">1214</a></td><td>Insufficient/inconsistent key immutability requirements for associative containers</td><td>Urbana</td><td></td></tr>
-->
<!-- <tr><td></td><td></td><td></td><td></td></tr> -->
</table>
- <p>Last Updated: 27-May-2015</p>
+ <p>Last Updated: 5-Oct-2015</p>
</div>
</body>
</html>
diff --git a/www/index.html b/www/index.html
index 8f1489e84553..821f25d7e04f 100644
--- a/www/index.html
+++ b/www/index.html
@@ -43,6 +43,16 @@
under the MIT license and the UIUC License (a BSD-like license).</p>
<!--=====================================================================-->
+ <h2>New Documentation Coming Soon!</h2>
+ <!--=====================================================================-->
+
+ <p> Looking for documentation on how to use, build and test libc++? If so
+ checkout the new libc++ documentation.</p>
+
+ <p><a href="http://libcxx.llvm.org/docs/">
+ Click here for the new libc++ documentation.</a></p>
+
+ <!--=====================================================================-->
<h2 id="goals">Features and Goals</h2>
<!--=====================================================================-->
@@ -184,26 +194,30 @@
<p>In-tree build:</p>
<ul>
+ <li><code>cd where-you-want-to-live</code></li>
<li>Check out libcxx and <a href="http://libcxxabi.llvm.org/">libcxxabi</a>
into llvm/projects</li>
- <li><code>cd llvm</code></li>
+ <li><code>cd where-you-want-to-build</code></li>
<li><code>mkdir build &amp;&amp; cd build</code></li>
- <li><code>cmake .. # Linux may require -DCMAKE_C_COMPILER=clang
+ <li><code>cmake path/to/llvm # Linux may require -DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++</code></li>
<li><code>make cxx</code></li>
</ul>
- <p>Out-of-tree build:</p>
+ <p>Out-of-tree buildc:</p>
<ul>
- <li>Check out libcxx</li>
+ <li><code>cd where-you-want-to-live</code></li>
+ <li>Check out libcxx and llvm</li>
<li>If not on a Mac, also check out
<a href="http://libcxxabi.llvm.org/">libcxxabi</a></li>
- <li><code>cd libcxx</code></li>
+ <li><code>cd where-you-want-to-build</code></li>
<li><code>mkdir build &amp;&amp; cd build</code></li>
- <li><code>cmake -DLIBCXX_CXX_ABI=libcxxabi
+ <li><code>cmake -DLLVM_PATH=path/to/llvm
+ -DLIBCXX_CXX_ABI=libcxxabi
-DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxabi/include
- -DLIT_EXECUTABLE=path/to/llvm/utils/lit/lit.py .. # Linux may require
- -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++</code></li>
+ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
+ path/to/libcxx
+ </code></li>
<li><code>make</code></li>
</ul>
diff --git a/www/kona.html b/www/kona.html
new file mode 100644
index 000000000000..8fdfba163e4a
--- /dev/null
+++ b/www/kona.html
@@ -0,0 +1,154 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<!-- 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">
+ <title>libc++ Kona Status</title>
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
+</head>
+
+<body>
+<div id="menu">
+ <div>
+ <a href="http://llvm.org/">LLVM Home</a>
+ </div>
+
+ <div class="submenu">
+ <label>libc++ Info</label>
+ <a href="/index.html">About</a>
+ </div>
+
+ <div class="submenu">
+ <label>Quick Links</label>
+ <a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
+ <a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
+ <a href="http://llvm.org/bugs/">Bug Reports</a>
+ <a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
+ <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
+ </div>
+</div>
+
+<div id="content">
+ <!--*********************************************************************-->
+ <h1>libc++ Kona 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 Kona.</p>
+
+ <p>The groups that have contributed papers:
+ <ul>
+ <li>LWG - Library working group</li>
+ <li>CWG - Core Language Working group</li>
+ <li>SG1 - Study group #1 (Concurrency working group)</li>
+ </ul>
+ </p>
+
+ <h3>Paper Status</h3>
+ <table id="papers" border="1">
+ <tr><th>Paper #</th><th>Group</th><th>Paper Name</th><th>Meeting</th><th>Status</th><th>First released version</th></tr>
+<!--
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3346.pdf">3346</a></td><td>LWG</td><td>Terminology for Container Element Requirements - Rev 1</td><td>Kona</td><td>Complete</td><td>3.4</td></tr>
+-->
+<!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> -->
+ </table>
+
+ <h3>Library Working group Issues Status</h3>
+ <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://cplusplus.github.io/LWG/lwg-defects.html#1169">1169</a></td><td><tt>num_get</tt> not fully compatible with <tt>strto*</tt></td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2072">2072</a></td><td>Unclear wording about capacity of temporary buffers</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2101">2101</a></td><td>Some transformation types can produce impossible types</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2111">2111</a></td><td>Which <tt>unexpected</tt>&#47;<tt>terminate</tt> handler is called from the exception handling runtime?</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2119">2119</a></td><td>Missing <tt>hash</tt> specializations for extended integer types</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2127">2127</a></td><td>Move-construction with <tt>raw_storage_iterator</tt></td><td>Kona</td><td>Patch Ready</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2133">2133</a></td><td>Attitude to overloaded comma for iterators</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2156">2156</a></td><td>Unordered containers' <tt>reserve(n)</tt> reserves for <tt>n-1</tt> elements</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2218">2218</a></td><td>Unclear how containers use <tt>allocator_traits::construct()</tt></td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2219">2219</a></td><td><tt><i>INVOKE</i></tt>-ing a pointer to member with a <tt>reference_wrapper</tt> as the object expression</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2224">2224</a></td><td>Ambiguous status of access to non-live objects</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2234">2234</a></td><td><tt>assert()</tt> should allow usage in constant expressions</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2244">2244</a></td><td>Issue on <tt>basic_istream::seekg</tt></td><td>Kona</td><td>Patch Ready</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2250">2250</a></td><td>Follow-up On Library Issue 2207</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2259">2259</a></td><td>Issues in 17.6.5.5 rules for member functions</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2273">2273</a></td><td><tt>regex_match</tt> ambiguity</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2336">2336</a></td><td><tt>is_trivially_constructible/is_trivially_assignable</tt> traits are always false</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2353">2353</a></td><td><tt>std::next</tt> is over-constrained</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2367">2367</a></td><td><tt>pair</tt> and <tt>tuple</tt> are not correctly implemented for <tt>is_constructible</tt> with no args</td><td>Kona</td><td>Patch Ready</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2380">2380</a></td><td>May <tt>&lt;cstdlib&gt;</tt> provide <tt>long ::abs(long)</tt> and <tt>long long ::abs(long long)</tt>?</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2384">2384</a></td><td>Allocator's <tt>deallocate</tt> function needs better specification</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2385">2385</a></td><td><tt>function::assign</tt> allocator argument doesn't make sense</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2435">2435</a></td><td><tt>reference_wrapper::operator()</tt>'s Remark should be deleted</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2447">2447</a></td><td>Allocators and <tt>volatile</tt>-qualified value types</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2462">2462</a></td><td><tt>std::ios_base::failure</tt> is overspecified</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2466">2466</a></td><td><tt>allocator_traits::max_size()</tt> default behavior is incorrect</td><td>Kona</td><td>Patch Ready</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2469">2469</a></td><td>Wrong specification of Requires clause of <tt>operator[]</tt> for <tt>map</tt> and <tt>unordered_map</tt></td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2473">2473</a></td><td><tt>basic_filebuf</tt>'s relation to C <tt>FILE</tt> semantics</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2476">2476</a></td><td><tt>scoped_allocator_adaptor</tt> is not assignable</td><td>Kona</td><td>Patch Ready</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2477">2477</a></td><td>Inconsistency of wordings in <tt>std::vector::erase()</tt> and <tt>std::deque::erase()</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2483">2483</a></td><td><tt>throw_with_nested()</tt> should use <tt>is_final</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2484">2484</a></td><td><tt>rethrow_if_nested()</tt> is doubly unimplementable</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2485">2485</a></td><td><tt>get()</tt> should be overloaded for <tt>const tuple&amp;&amp;</tt></td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2486">2486</a></td><td><tt>mem_fn()</tt> should be required to use perfect forwarding</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2487">2487</a></td><td><tt>bind()</tt> should be <tt>const</tt>-overloaded, not <i>cv</i>-overloaded</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2489">2489</a></td><td><tt>mem_fn()</tt> should be <tt>noexcept</tt></td><td>Kona</td><td>Patch Ready</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2492">2492</a></td><td>Clarify requirements for <tt>comp</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2494">2494</a></td><td>[fund.ts.v2] <tt>ostream_joiner</tt> needs <tt>noexcept</tt></td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2495">2495</a></td><td>There is no such thing as an Exception Safety element</td><td>Kona</td><td></td></tr>
+
+<!--
+ <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#1214">1214</a></td><td>Insufficient/inconsistent key immutability requirements for associative containers</td><td>Urbana</td><td></td></tr>
+-->
+<!-- <tr><td></td><td></td><td></td><td></td></tr> -->
+ </table>
+
+<h3>Comments about the issues</h3>
+<ul>
+<li>1169 - We currently have a single function __num_get_float that calls strtold_l, and then casts down to the appropriate floating point type. That will have to change.</li>
+<li><i>2072 - We already do this; this is just making the wording better.</i></li>
+<li>2101 - Need to write some careful test cases. In particular, need to check function types with/without const/ref qualifiers. Currently we get this wrong. Installing metashell to play with these.</li>
+<li><i>2111 - Resolved an ambiguity by calling it out. No code change required.</i></li>
+<li>2119 - Hashes for all integral and enumeration types. Research needed</li>
+<li><i>2127 - Add a new member to raw_storage_iterator. Looks simple.</i> <b>Patch Available</b></li>
+<li><i>2133 - We do this already; thanks Eric.</i></li>
+<li>2156 - check and make sure that we already do this. Write a test.</li>
+<li>2181 - I suspect that this will not require any code changes, but will need to be read carefully.</li>
+<li>2218 - Shouldn't require any code changes.</li>
+<li>2219 - Sizable changes required. INVOKE needs 2 additional overloads and plenty of tests. I'm not going to back port this to C++03. (Eric)</li>
+<li>2224 - </li>
+<li>2234 - </li>
+<li><i>2244 - We don't do this; easy fix. <b>Patch Available</b></i></li>
+<li>2250 - Looks like wording cleanup. Need to check more closely, but I think there's no code changes here.</li>
+<li><i>2259 - No code changes needed here.</i></li>
+<li>2273 - </li>
+<li>2336 - <b>Check later</b></li>
+<li>2353 - Simple change, needs a test. (test probably used to exist)</li>
+<li><i>2367 - <b>Patch Available as D13750</b> (Eric)</i></li>
+<li><i>2380 - No code changes here; we already do this.</i></li>
+<li><i>2384 - Wording cleanup; no code change required</i></li>
+<li>2385 - Removing broken signatures. Only question is "how far back"?</li>
+<li><i>2435 - Wording cleanup; no code change required</i></li>
+<li><i>2447 - This is a relaxation of a requirement that we satisfy. No changes needed.</i>.</li>
+<li><i>2462 - Added a simple test. No code change needed</i> <b>Patch Available</b></li>
+<li><i>2466 - Simple change; need a test.</i> <b>Patch Available</b></li>
+<li>2469 - This is a follow on to 2464, which we're done. This restates a bunch of operations in terms of newer ops. Probably refactoring to do here, but tests shouldn't change.</li>
+<li><i>2473 - There are two changes here; one to <tt>filebuf::seekpos</tt> and the other to <tt>filebuf::sync</tt>. We do both of these already.</i></li>
+<li><i>2476 - Just needed tests.</i> <b>Patch Available</b></li>
+<li><i>2477 - Wording cleanup.</i></li>
+<li><i>2483 - We already do this.</i></li>
+<li><i>2484 - We already do this.</i></li>
+<li>2485 - Ask Eric to do it. </li>
+<li>2486 - Lots of code changes, all mechanical. Tests will be sizable.</li>
+<li><i>2487 - This is removing a requirement on bind(), which we don't currently satisfy. So, nothing to do.</i></li>
+<li><i>2489 - Looks easy. Just add some NOEXCEPT, and tests.</i> <b>Patch Available</b></li>
+<li><i>2492 - Wording cleanup; no code changes needed.</i></li>
+<li>2494 - My implementation of this (not checked in) already has these.</li>
+<li>2494 - </li>
+</ul>
+
+<p>Last Updated: 5-Oct-2015</p>
+</div>
+</body>
+</html>
diff --git a/www/ts1z_status.html b/www/ts1z_status.html
index 698996f845f0..9d4a000b0b99 100644
--- a/www/ts1z_status.html
+++ b/www/ts1z_status.html
@@ -35,8 +35,8 @@
<h1>Post-C++14 TS Implementation Status</h1>
<!--*********************************************************************-->
- <p>In April 2013, the C++ standard committee approved the draft for the next version of the C++ standard, known as "C++1Y" (probably to be C++14)</p>
- <p>The draft standard includes papers and issues that were voted on at the previous three meetings (Kona, Portland, and Bristol)</p>
+ <p>In November 2014, the C++ standard committee approved the draft for the next version of the C++ standard, known as "C++1z" (probably to be C++17)</p>
+ <p>In addition, there are several "Technical Specifications", that consist of new features that are proposed, but not yet accepted for C++1z.</p>
<p>This page shows the status of libc++; the status of clang's support of the language features is <a href="http://clang.llvm.org/cxx_status.html">here</a>.</p>
<h3>Technical Specifications</h3>
@@ -47,10 +47,10 @@
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3940.html">3940</a></td><td>Technical Specification - File System</td><td>File System</td></tr>
<tr><td></td><td></td><td></td></tr>
- <tr><td><a href="http://wiki.edg.com/twiki/pub/Wg21urbana-champaign/StrawPolls/n4273.txt">4273</a></td><td>Uniform Container Erasure.</td><td>Library Fundamentals 2</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4273">4273</a></td><td>Uniform Container Erasure.</td><td>Library Fundamentals 2</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4061">4061</a></td><td>Greatest Common Divisor and Least Common Multiple.</td><td>Library Fundamentals 2</td></tr>
- <tr><td><a href="http://wiki.edg.com/twiki/pub/Wg21urbana-champaign/StrawPolls/N4257.htm">4257</a></td><td>Delimited iterators.</td><td>Library Fundamentals 2</td></tr>
- <tr><td><a href="http://wiki.edg.com/twiki/pub/Wg21urbana-champaign/StrawPolls/N4282.pdf">4282</a></td><td>The World's Dumbest Smart Pointer.</td><td>Library Fundamentals 2</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4257">4257</a></td><td>Delimited iterators.</td><td>Library Fundamentals 2</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4282">4282</a></td><td>The World's Dumbest Smart Pointer.</td><td>Library Fundamentals 2</td></tr>
<tr><td></td><td></td><td></td></tr>
</table>
@@ -61,24 +61,23 @@
<tr><td>Uses-allocator construction</td><td>Not started</td></tr>
<tr><td>Changes to std::shared_ptr and weak_ptr</td><td>Not started</td></tr>
<tr><td>Additions to std::function</td><td>Not started</td></tr>
- <tr><td>Changes to std::common_type</td><td>Not started</td></tr>
- <tr><td>Changes to std::iterator_traits</td><td>Not started</td></tr>
<tr><td>Additions to std::promise</td><td>Not started</td></tr>
<tr><td>Additions to std::packaged_task</td><td>Not started</td></tr>
<tr><td></td><td></td></tr>
<tr><td>Class erased_type</td><td>Complete</td></tr>
<tr><td>Calling a function with a tuple of arguments</td><td>Complete</td></tr>
+ <tr><td>Type traits (_v)</td><td>Complete</td></tr>
<tr><td>Other type transformations</td><td>Not started</td></tr>
<tr><td>Compile-time Rational Arithmetic</td><td>Implementation in progress</td></tr>
<tr><td>Time Utilities</td><td>Complete</td></tr>
<tr><td>System Error Support</td><td>Complete</td></tr>
<tr><td></td><td></td></tr>
- <tr><td>Searchers</td><td>Not started</td></tr>
+ <tr><td>Searchers</td><td>Complete</td></tr>
<tr><td>Optional Objects</td><td>Initial implementation complete</td></tr>
- <tr><td>class any</td><td>Implementation in progress</td></tr>
- <tr><td>string_view</td><td>Implementation in progress</td></tr>
+ <tr><td>class any</td><td>Complete</td></tr>
+ <tr><td>string_view</td><td>Complete</td></tr>
<tr><td>memory</td><td>Implementation in progress</td></tr>
- <tr><td>Algorithms library</td><td>Implementation in progress</td></tr>
+ <tr><td>Algorithms library</td><td>Complete</td></tr>
</table>
@@ -96,7 +95,7 @@
</table>
- <p>Last Updated: 2-June-2014</p>
+ <p>Last Updated: 7-Dec-2015</p>
</div>
</body>
</html>