summaryrefslogtreecommitdiff
path: root/test/std/containers/sequences
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:47:26 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:47:26 +0000
commit51072bd6bf79ef2bc6a922079bff57c31c1effbc (patch)
tree91a2effbc9e6f80bdbbf9eb70e06c51ad0867ea0 /test/std/containers/sequences
parentbb5e33f003797b67974a8893f7f2930fc51b8210 (diff)
Notes
Diffstat (limited to 'test/std/containers/sequences')
-rw-r--r--test/std/containers/sequences/array/array.cons/initializer_list.pass.cpp14
-rw-r--r--test/std/containers/sequences/array/array.special/swap.pass.cpp38
-rw-r--r--test/std/containers/sequences/array/array.swap/swap.pass.cpp48
-rw-r--r--test/std/containers/sequences/array/at.pass.cpp4
-rw-r--r--test/std/containers/sequences/array/front_back.pass.cpp2
-rw-r--r--test/std/containers/sequences/array/indexing.pass.cpp2
-rw-r--r--test/std/containers/sequences/array/iterators.pass.cpp2
-rw-r--r--test/std/containers/sequences/array/types.pass.cpp43
-rw-r--r--test/std/containers/sequences/array/version.pass.cpp20
-rw-r--r--test/std/containers/sequences/deque/deque.capacity/access.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/copy.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/copy_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/default.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp9
-rw-r--r--test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp8
-rw-r--r--test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.cons/op_equal.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/size.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp14
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/erase_iter.invalidation.pass.cpp8
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp8
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/pop_back.invalidation.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/pop_front.invalidation.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_back.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_back_exception_safety.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.special/copy.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.special/copy_backward.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.special/move.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.special/move_backward.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.special/swap.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp9
-rw-r--r--test/std/containers/sequences/deque/iterators.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/types.pass.cpp16
-rw-r--r--test/std/containers/sequences/deque/version.pass.cpp20
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.access/front.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/assign_copy.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/assign_range.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/assign_size_value.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/copy.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/copy_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/default.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp9
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp8
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/range.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/range_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/size_value.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/size_value_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.iter/before_begin.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.iter/iterators.pass.cpp4
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/clear.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_many.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_const.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_range.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_size_value.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_const.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size_value.pass.cpp21
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/merge.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/merge_pred.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/remove.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/reverse.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/sort_pred.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_flist.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_range.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/unique.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp10
-rw-r--r--test/std/containers/sequences/forwardlist/incomplete.pass.cpp53
-rw-r--r--test/std/containers/sequences/forwardlist/max_size.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/types.pass.cpp16
-rw-r--r--test/std/containers/sequences/forwardlist/version.pass.cpp20
-rw-r--r--test/std/containers/sequences/list/db_back.pass.cpp56
-rw-r--r--test/std/containers/sequences/list/db_cback.pass.cpp52
-rw-r--r--test/std/containers/sequences/list/db_cfront.pass.cpp52
-rw-r--r--test/std/containers/sequences/list/db_front.pass.cpp56
-rw-r--r--test/std/containers/sequences/list/db_iterators_6.pass.cpp58
-rw-r--r--test/std/containers/sequences/list/db_iterators_7.pass.cpp58
-rw-r--r--test/std/containers/sequences/list/db_iterators_8.pass.cpp54
-rw-r--r--test/std/containers/sequences/list/db_iterators_9.pass.cpp67
-rw-r--r--test/std/containers/sequences/list/iterators.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.capacity/resize_size.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.capacity/resize_size_value.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/assign_copy.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/assign_move.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/copy.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/copy_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/default.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp9
-rw-r--r--test/std/containers/sequences/list/list.cons/default_stack_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp8
-rw-r--r--test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/move.pass.cpp15
-rw-r--r--test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/size_type.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/size_value_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.modifiers/clear.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp29
-rw-r--r--test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.modifiers/erase_iter.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp51
-rw-r--r--test/std/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp53
-rw-r--r--test/std/containers/sequences/list/list.modifiers/erase_iter_iter.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp51
-rw-r--r--test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp51
-rw-r--r--test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp51
-rw-r--r--test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp49
-rw-r--r--test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.modifiers/insert_iter_iter_iter.pass.cpp133
-rw-r--r--test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp28
-rw-r--r--test/std/containers/sequences/list/list.modifiers/insert_iter_size_value.pass.cpp89
-rw-r--r--test/std/containers/sequences/list/list.modifiers/insert_iter_value.pass.cpp97
-rw-r--r--test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp15
-rw-r--r--test/std/containers/sequences/list/list.modifiers/pop_front.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.modifiers/push_back.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.modifiers/push_front.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.ops/merge.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.ops/merge_comp.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.ops/remove.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.ops/remove_if.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.ops/reverse.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.ops/sort.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.ops/splice_pos_list.pass.cpp23
-rw-r--r--test/std/containers/sequences/list/list.ops/splice_pos_list_iter.pass.cpp23
-rw-r--r--test/std/containers/sequences/list/list.ops/splice_pos_list_iter_iter.pass.cpp23
-rw-r--r--test/std/containers/sequences/list/list.ops/unique.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.special/db_swap_1.pass.cpp59
-rw-r--r--test/std/containers/sequences/list/list.special/swap.pass.cpp12
-rw-r--r--test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp9
-rw-r--r--test/std/containers/sequences/list/types.pass.cpp47
-rw-r--r--test/std/containers/sequences/list/version.pass.cpp20
-rw-r--r--test/std/containers/sequences/vector.bool/assign_copy.pass.cpp8
-rw-r--r--test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/assign_move.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/capacity.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/construct_default.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector.bool/construct_iter_iter.pass.cpp5
-rw-r--r--test/std/containers/sequences/vector.bool/construct_iter_iter_alloc.pass.cpp5
-rw-r--r--test/std/containers/sequences/vector.bool/construct_size.pass.cpp14
-rw-r--r--test/std/containers/sequences/vector.bool/construct_size_value.pass.cpp9
-rw-r--r--test/std/containers/sequences/vector.bool/construct_size_value_alloc.pass.cpp9
-rw-r--r--test/std/containers/sequences/vector.bool/copy.pass.cpp14
-rw-r--r--test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp20
-rw-r--r--test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp9
-rw-r--r--test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp8
-rw-r--r--test/std/containers/sequences/vector.bool/emplace.pass.cpp5
-rw-r--r--test/std/containers/sequences/vector.bool/emplace_back.pass.cpp5
-rw-r--r--test/std/containers/sequences/vector.bool/erase_iter.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/erase_iter_iter.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/initializer_list.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/iterators.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/move.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/move_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp9
-rw-r--r--test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/push_back.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/reference.swap.pass.cpp39
-rw-r--r--test/std/containers/sequences/vector.bool/reserve.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/resize_size.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/resize_size_value.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/shrink_to_fit.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/swap.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp10
-rw-r--r--test/std/containers/sequences/vector.bool/types.pass.cpp12
-rw-r--r--test/std/containers/sequences/vector.bool/vector_bool.pass.cpp8
-rw-r--r--test/std/containers/sequences/vector/const_value_type.pass.cpp22
-rw-r--r--test/std/containers/sequences/vector/contiguous.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/db_back.pass.cpp56
-rw-r--r--test/std/containers/sequences/vector/db_cback.pass.cpp52
-rw-r--r--test/std/containers/sequences/vector/db_cfront.pass.cpp52
-rw-r--r--test/std/containers/sequences/vector/db_cindex.pass.cpp54
-rw-r--r--test/std/containers/sequences/vector/db_front.pass.cpp56
-rw-r--r--test/std/containers/sequences/vector/db_index.pass.cpp56
-rw-r--r--test/std/containers/sequences/vector/db_iterators_2.pass.cpp54
-rw-r--r--test/std/containers/sequences/vector/db_iterators_3.pass.cpp54
-rw-r--r--test/std/containers/sequences/vector/db_iterators_4.pass.cpp56
-rw-r--r--test/std/containers/sequences/vector/db_iterators_5.pass.cpp60
-rw-r--r--test/std/containers/sequences/vector/db_iterators_6.pass.cpp58
-rw-r--r--test/std/containers/sequences/vector/db_iterators_7.pass.cpp58
-rw-r--r--test/std/containers/sequences/vector/db_iterators_8.pass.cpp54
-rw-r--r--test/std/containers/sequences/vector/iterators.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/types.pass.cpp36
-rw-r--r--test/std/containers/sequences/vector/vector.capacity/capacity.pass.cpp10
-rw-r--r--test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp12
-rw-r--r--test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp22
-rw-r--r--test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp14
-rw-r--r--test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp20
-rw-r--r--test/std/containers/sequences/vector/vector.capacity/swap.pass.cpp18
-rw-r--r--test/std/containers/sequences/vector/vector.cons/assign_copy.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp4
-rw-r--r--test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp38
-rw-r--r--test/std/containers/sequences/vector/vector.cons/assign_size_value.pass.cpp4
-rw-r--r--test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp12
-rw-r--r--test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp7
-rw-r--r--test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp11
-rw-r--r--test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp19
-rw-r--r--test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp7
-rw-r--r--test/std/containers/sequences/vector/vector.cons/construct_size_value_alloc.pass.cpp8
-rw-r--r--test/std/containers/sequences/vector/vector.cons/copy.pass.cpp34
-rw-r--r--test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp8
-rw-r--r--test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp8
-rw-r--r--test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.cons/move.pass.cpp44
-rw-r--r--test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp42
-rw-r--r--test/std/containers/sequences/vector/vector.cons/move_assign_noexcept.pass.cpp9
-rw-r--r--test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.data/data.pass.cpp33
-rw-r--r--test/std/containers/sequences/vector/vector.data/data_const.pass.cpp31
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp14
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp23
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp18
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp18
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_db1.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_db2.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp58
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db1.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db2.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db3.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db4.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp14
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp8
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp14
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp12
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp8
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/push_back.pass.cpp32
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/push_back_exception_safety.pass.cpp8
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp32
-rw-r--r--test/std/containers/sequences/vector/vector.special/db_swap_1.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/vector.special/swap.pass.cpp82
-rw-r--r--test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp10
-rw-r--r--test/std/containers/sequences/vector/version.pass.cpp20
297 files changed, 1172 insertions, 2785 deletions
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 5e429adb6fc9..64ea75a40064 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
@@ -35,4 +35,18 @@ int main()
C c = {};
assert(c.size() == 0);
}
+
+ {
+ typedef double T;
+ typedef std::array<T, 3> C;
+ C c = {1};
+ assert(c.size() == 3.0);
+ assert(c[0] == 1);
+ }
+ {
+ typedef int T;
+ typedef std::array<T, 1> C;
+ C c = {};
+ assert(c.size() == 1);
+ }
}
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 c1b0b235ab34..413f291a2a36 100644
--- a/test/std/containers/sequences/array/array.special/swap.pass.cpp
+++ b/test/std/containers/sequences/array/array.special/swap.pass.cpp
@@ -14,10 +14,28 @@
#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"
+struct NonSwappable {
+ NonSwappable() {}
+private:
+ NonSwappable(NonSwappable const&);
+ NonSwappable& operator=(NonSwappable const&);
+};
+
+template <class Tp>
+decltype(swap(std::declval<Tp>(), std::declval<Tp>()))
+can_swap_imp(int);
+
+template <class Tp>
+std::false_type can_swap_imp(...);
+
+template <class Tp>
+struct can_swap : std::is_same<decltype(can_swap_imp<Tp>(0)), void> {};
+
int main()
{
{
@@ -44,4 +62,24 @@ int main()
assert(c1.size() == 0);
assert(c2.size() == 0);
}
+ {
+ typedef NonSwappable T;
+ typedef std::array<T, 0> C0;
+ static_assert(can_swap<C0&>::value, "");
+ C0 l = {};
+ C0 r = {};
+ swap(l, r);
+#if TEST_STD_VER >= 11
+ static_assert(noexcept(swap(l, r)), "");
+#endif
+ }
+#if TEST_STD_VER >= 11
+ {
+ // NonSwappable is still considered swappable in C++03 because there
+ // is no access control SFINAE.
+ typedef NonSwappable T;
+ typedef std::array<T, 42> C1;
+ static_assert(!can_swap<C1&>::value, "");
+ }
+#endif
}
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 651798e1e790..8d01dbf959ce 100644
--- a/test/std/containers/sequences/array/array.swap/swap.pass.cpp
+++ b/test/std/containers/sequences/array/array.swap/swap.pass.cpp
@@ -10,14 +10,24 @@
// <array>
// void swap(array& a);
+// namespace std { void swap(array<T, N> &x, array<T, N> &y);
-#include <array>
#include <cassert>
+#include <array>
+
+#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"
+struct NonSwappable {
+ NonSwappable() {}
+private:
+ NonSwappable(NonSwappable const&);
+ NonSwappable& operator=(NonSwappable const&);
+};
+
int main()
{
{
@@ -37,6 +47,22 @@ int main()
}
{
typedef double T;
+ typedef std::array<T, 3> C;
+ C c1 = {1, 2, 3.5};
+ C c2 = {4, 5, 6.5};
+ std::swap(c1, c2);
+ assert(c1.size() == 3);
+ assert(c1[0] == 4);
+ assert(c1[1] == 5);
+ assert(c1[2] == 6.5);
+ assert(c2.size() == 3);
+ assert(c2[0] == 1);
+ assert(c2[1] == 2);
+ assert(c2[2] == 3.5);
+ }
+
+ {
+ typedef double T;
typedef std::array<T, 0> C;
C c1 = {};
C c2 = {};
@@ -44,4 +70,24 @@ int main()
assert(c1.size() == 0);
assert(c2.size() == 0);
}
+ {
+ typedef double T;
+ typedef std::array<T, 0> C;
+ C c1 = {};
+ C c2 = {};
+ std::swap(c1, c2);
+ assert(c1.size() == 0);
+ assert(c2.size() == 0);
+ }
+ {
+ typedef NonSwappable T;
+ typedef std::array<T, 0> C0;
+ C0 l = {};
+ C0 r = {};
+ l.swap(r);
+#if TEST_STD_VER >= 11
+ static_assert(noexcept(l.swap(r)), "");
+#endif
+ }
+
}
diff --git a/test/std/containers/sequences/array/at.pass.cpp b/test/std/containers/sequences/array/at.pass.cpp
index 5cb89dfeeb9a..9707beeb3946 100644
--- a/test/std/containers/sequences/array/at.pass.cpp
+++ b/test/std/containers/sequences/array/at.pass.cpp
@@ -49,14 +49,14 @@ int main()
const C c = {1, 2, 3.5};
C::const_reference r1 = c.at(0);
assert(r1 == 1);
-
+
C::const_reference r2 = c.at(2);
assert(r2 == 3.5);
try { (void) c.at(3); }
catch (const std::out_of_range &) {}
}
-
+
#if TEST_STD_VER > 11
{
typedef double T;
diff --git a/test/std/containers/sequences/array/front_back.pass.cpp b/test/std/containers/sequences/array/front_back.pass.cpp
index bccaade986ea..7d53b8265e96 100644
--- a/test/std/containers/sequences/array/front_back.pass.cpp
+++ b/test/std/containers/sequences/array/front_back.pass.cpp
@@ -34,7 +34,7 @@ int main()
assert(r1 == 1);
r1 = 5.5;
assert(c[0] == 5.5);
-
+
C::reference r2 = c.back();
assert(r2 == 3.5);
r2 = 7.5;
diff --git a/test/std/containers/sequences/array/indexing.pass.cpp b/test/std/containers/sequences/array/indexing.pass.cpp
index 5ccb0b487b95..64d2716a7592 100644
--- a/test/std/containers/sequences/array/indexing.pass.cpp
+++ b/test/std/containers/sequences/array/indexing.pass.cpp
@@ -33,7 +33,7 @@ int main()
assert(r1 == 1);
r1 = 5.5;
assert(c.front() == 5.5);
-
+
C::reference r2 = c[2];
assert(r2 == 3.5);
r2 = 7.5;
diff --git a/test/std/containers/sequences/array/iterators.pass.cpp b/test/std/containers/sequences/array/iterators.pass.cpp
index 98997d8c26d5..233e9328c4ed 100644
--- a/test/std/containers/sequences/array/iterators.pass.cpp
+++ b/test/std/containers/sequences/array/iterators.pass.cpp
@@ -59,7 +59,7 @@ int main()
assert ( c.cend() == std::cend(c));
assert ( c.rend() == std::rend(c));
assert ( c.crend() == std::crend(c));
-
+
assert ( std::begin(c) != std::end(c));
assert ( std::rbegin(c) != std::rend(c));
assert ( std::cbegin(c) != std::cend(c));
diff --git a/test/std/containers/sequences/array/types.pass.cpp b/test/std/containers/sequences/array/types.pass.cpp
index 065ade959d05..9cf390c4eacb 100644
--- a/test/std/containers/sequences/array/types.pass.cpp
+++ b/test/std/containers/sequences/array/types.pass.cpp
@@ -29,6 +29,25 @@
#include <iterator>
#include <type_traits>
+#include "test_macros.h"
+
+template <class C>
+void test_iterators() {
+ typedef std::iterator_traits<typename C::iterator> ItT;
+ typedef std::iterator_traits<typename C::const_iterator> CItT;
+ static_assert((std::is_same<typename ItT::iterator_category, std::random_access_iterator_tag>::value), "");
+ static_assert((std::is_same<typename ItT::value_type, typename C::value_type>::value), "");
+ static_assert((std::is_same<typename ItT::reference, typename C::reference>::value), "");
+ static_assert((std::is_same<typename ItT::pointer, typename C::pointer>::value), "");
+ static_assert((std::is_same<typename ItT::difference_type, typename C::difference_type>::value), "");
+
+ static_assert((std::is_same<typename CItT::iterator_category, std::random_access_iterator_tag>::value), "");
+ static_assert((std::is_same<typename CItT::value_type, typename C::value_type>::value), "");
+ static_assert((std::is_same<typename CItT::reference, typename C::const_reference>::value), "");
+ static_assert((std::is_same<typename CItT::pointer, typename C::const_pointer>::value), "");
+ static_assert((std::is_same<typename CItT::difference_type, typename C::difference_type>::value), "");
+}
+
int main()
{
{
@@ -36,27 +55,43 @@ int main()
typedef std::array<T, 10> C;
static_assert((std::is_same<C::reference, T&>::value), "");
static_assert((std::is_same<C::const_reference, const T&>::value), "");
- static_assert((std::is_same<C::iterator, T*>::value), "");
- static_assert((std::is_same<C::const_iterator, const T*>::value), "");
+ LIBCPP_STATIC_ASSERT((std::is_same<C::iterator, T*>::value), "");
+ LIBCPP_STATIC_ASSERT((std::is_same<C::const_iterator, const T*>::value), "");
+ test_iterators<C>();
static_assert((std::is_same<C::pointer, T*>::value), "");
static_assert((std::is_same<C::const_pointer, const T*>::value), "");
static_assert((std::is_same<C::size_type, std::size_t>::value), "");
static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
static_assert((std::is_same<C::reverse_iterator, std::reverse_iterator<C::iterator> >::value), "");
static_assert((std::is_same<C::const_reverse_iterator, std::reverse_iterator<C::const_iterator> >::value), "");
+
+ static_assert((std::is_signed<typename C::difference_type>::value), "");
+ static_assert((std::is_unsigned<typename C::size_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::iterator>::difference_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::const_iterator>::difference_type>::value), "");
}
{
typedef int* T;
typedef std::array<T, 0> C;
static_assert((std::is_same<C::reference, T&>::value), "");
static_assert((std::is_same<C::const_reference, const T&>::value), "");
- static_assert((std::is_same<C::iterator, T*>::value), "");
- static_assert((std::is_same<C::const_iterator, const T*>::value), "");
+ LIBCPP_STATIC_ASSERT((std::is_same<C::iterator, T*>::value), "");
+ LIBCPP_STATIC_ASSERT((std::is_same<C::const_iterator, const T*>::value), "");
+ test_iterators<C>();
static_assert((std::is_same<C::pointer, T*>::value), "");
static_assert((std::is_same<C::const_pointer, const T*>::value), "");
static_assert((std::is_same<C::size_type, std::size_t>::value), "");
static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
static_assert((std::is_same<C::reverse_iterator, std::reverse_iterator<C::iterator> >::value), "");
static_assert((std::is_same<C::const_reverse_iterator, std::reverse_iterator<C::const_iterator> >::value), "");
+
+ static_assert((std::is_signed<typename C::difference_type>::value), "");
+ static_assert((std::is_unsigned<typename C::size_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::iterator>::difference_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::const_iterator>::difference_type>::value), "");
}
}
diff --git a/test/std/containers/sequences/array/version.pass.cpp b/test/std/containers/sequences/array/version.pass.cpp
deleted file mode 100644
index b89a8dd8cca3..000000000000
--- a/test/std/containers/sequences/array/version.pass.cpp
+++ /dev/null
@@ -1,20 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <array>
-
-#include <array>
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main()
-{
-}
diff --git a/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp b/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp
index 996fc9a18fe7..a6a8e7424b25 100644
--- a/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp
@@ -68,7 +68,7 @@ int main()
assert(c.front() == 0);
assert(c.back() == 9);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::deque<int, min_allocator<int>> c = make<std::deque<int, min_allocator<int>> >(10);
for (unsigned i = 0; i < 10; ++i)
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 84f04f9d52da..53c6bd3380a2 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
@@ -12,6 +12,8 @@
// void resize(size_type n);
#include <deque>
+#include <algorithm>
+#include <iterator>
#include <cassert>
#include "test_macros.h"
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 2bf2423fb9af..12af64386bd8 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
@@ -12,6 +12,8 @@
// void resize(size_type n, const value_type& v);
#include <deque>
+#include <algorithm>
+#include <iterator>
#include <cassert>
#include "test_macros.h"
diff --git a/test/std/containers/sequences/deque/deque.cons/alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/alloc.pass.cpp
index 841bfd9f8a7f..787c2394b38e 100644
--- a/test/std/containers/sequences/deque/deque.cons/alloc.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/alloc.pass.cpp
@@ -31,7 +31,7 @@ int main()
{
test<int>(std::allocator<int>());
test<NotConstructible>(test_allocator<NotConstructible>(3));
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test<int>(min_allocator<int>());
test<NotConstructible>(min_allocator<NotConstructible>{});
#endif
diff --git a/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp b/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp
index c760b4372444..dea6492a515d 100644
--- a/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp
@@ -28,7 +28,7 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::deque<int, min_allocator<int>> d;
d.assign({3, 4, 5, 6});
diff --git a/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp b/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp
index fa0c1203ede9..ec73555b9c4f 100644
--- a/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp
@@ -45,7 +45,7 @@ int main()
assert(v2.get_allocator() == other_allocator<int>(-2));
}
#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
diff --git a/test/std/containers/sequences/deque/deque.cons/copy_alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/copy_alloc.pass.cpp
index efea4948eba1..3a49a8bc0c66 100644
--- a/test/std/containers/sequences/deque/deque.cons/copy_alloc.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/copy_alloc.pass.cpp
@@ -40,7 +40,7 @@ int main()
test(std::deque<int, other_allocator<int> >(ab, an, other_allocator<int>(3)),
other_allocator<int>(4));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
diff --git a/test/std/containers/sequences/deque/deque.cons/default.pass.cpp b/test/std/containers/sequences/deque/deque.cons/default.pass.cpp
index b725dade70b2..7c42d9e7786e 100644
--- a/test/std/containers/sequences/deque/deque.cons/default.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/default.pass.cpp
@@ -24,7 +24,7 @@ test()
{
std::deque<T, Allocator> d;
assert(d.size() == 0);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
std::deque<T, Allocator> d1 = {};
assert(d1.size() == 0);
#endif
@@ -34,7 +34,7 @@ int main()
{
test<int, std::allocator<int> >();
test<NotConstructible, stack_allocator<NotConstructible, 1> >();
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test<int, min_allocator<int> >();
test<NotConstructible, min_allocator<NotConstructible> >();
#endif
diff --git a/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
index c612dbc5e838..30cca929da11 100644
--- a/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
@@ -14,9 +14,12 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -29,14 +32,13 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::deque<MoveOnly> C;
- static_assert(std::is_nothrow_default_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::deque<MoveOnly, test_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_default_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::deque<MoveOnly, other_allocator<MoveOnly>> C;
@@ -46,5 +48,4 @@ int main()
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
index ecdc2404c855..503e1237e9eb 100644
--- a/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
@@ -11,14 +11,14 @@
// ~deque() // implied noexcept;
+// UNSUPPORTED: c++98, c++03
+
#include <deque>
#include <cassert>
#include "MoveOnly.h"
#include "test_allocator.h"
-#if __has_feature(cxx_noexcept)
-
template <class T>
struct some_alloc
{
@@ -27,11 +27,8 @@ struct some_alloc
~some_alloc() noexcept(false);
};
-#endif
-
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::deque<MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
@@ -48,5 +45,4 @@ int main()
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_destructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp b/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp
index a9e0218e2e0b..dbf27053a9f9 100644
--- a/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp
@@ -27,7 +27,7 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::deque<int, min_allocator<int>> d = {3, 4, 5, 6};
assert(d.size() == 4);
diff --git a/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp
index 36c5af60ee34..9be3c63a6b31 100644
--- a/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp
@@ -29,7 +29,7 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::deque<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
assert(d.get_allocator() == min_allocator<int>());
diff --git a/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp b/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp
index faadf2b1a1db..12a7faf686db 100644
--- a/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp
@@ -56,7 +56,7 @@ int main()
test(bidirectional_iterator<const int*>(ab), bidirectional_iterator<const int*>(an));
test(random_access_iterator<const int*>(ab), random_access_iterator<const int*>(an));
test<stack_allocator<int, 4096> >(ab, an);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test<min_allocator<int> >(ab, an);
#endif
}
diff --git a/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp
index b8c3e889929d..c8f7759a19d6 100644
--- a/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp
@@ -42,7 +42,7 @@ int main()
test(forward_iterator<const int*>(ab), forward_iterator<const int*>(an), test_allocator<int>(4));
test(bidirectional_iterator<const int*>(ab), bidirectional_iterator<const int*>(an), test_allocator<int>(5));
test(random_access_iterator<const int*>(ab), random_access_iterator<const int*>(an), test_allocator<int>(6));
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test(input_iterator<const int*>(ab), input_iterator<const int*>(an), min_allocator<int>());
test(forward_iterator<const int*>(ab), forward_iterator<const int*>(an), min_allocator<int>());
test(bidirectional_iterator<const int*>(ab), bidirectional_iterator<const int*>(an), min_allocator<int>());
diff --git a/test/std/containers/sequences/deque/deque.cons/move.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
index 4a7aa8a058eb..68875139da1a 100644
--- a/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
@@ -51,7 +51,7 @@ int main()
assert(c1.size() == 0);
assert(c3.get_allocator() == c1.get_allocator());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
diff --git a/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp
index 1a5db6db6500..4aa0fa6827e7 100644
--- a/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp
@@ -66,7 +66,7 @@ int main()
assert(c3.get_allocator() == A(3));
assert(c1.size() != 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
diff --git a/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp
index e50cd8ed508d..ed8f1544bc8f 100644
--- a/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp
@@ -69,7 +69,7 @@ int main()
assert(c1.size() == 0);
assert(c3.get_allocator() == A(5));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
diff --git a/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
index 24180b5b5bdd..cebf76a15a4a 100644
--- a/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
@@ -16,6 +16,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <deque>
#include <cassert>
@@ -31,7 +33,6 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::deque<MoveOnly> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
@@ -48,5 +49,4 @@ int main()
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
index 0ea0431be8e2..f53e1ba6c807 100644
--- a/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
@@ -14,6 +14,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <deque>
#include <cassert>
@@ -29,7 +31,6 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::deque<MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
@@ -46,5 +47,4 @@ int main()
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/deque/deque.cons/op_equal.pass.cpp b/test/std/containers/sequences/deque/deque.cons/op_equal.pass.cpp
index 3a6ec8370b84..6aac6b20c49e 100644
--- a/test/std/containers/sequences/deque/deque.cons/op_equal.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/op_equal.pass.cpp
@@ -46,7 +46,7 @@ int main()
assert(l2 == l);
assert(l2.get_allocator() == other_allocator<int>(5));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
diff --git a/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp
index 6468e4329bda..597f642db3ce 100644
--- a/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp
@@ -28,7 +28,7 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::deque<int, min_allocator<int>> d;
d = {3, 4, 5, 6};
diff --git a/test/std/containers/sequences/deque/deque.cons/size.pass.cpp b/test/std/containers/sequences/deque/deque.cons/size.pass.cpp
index d2e324b0e3f5..b3fccf6671c9 100644
--- a/test/std/containers/sequences/deque/deque.cons/size.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/size.pass.cpp
@@ -100,7 +100,7 @@ int main()
test1<DefaultOnly, stack_allocator<DefaultOnly, 4096> >(4095);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test<DefaultOnly, min_allocator<DefaultOnly> >(4095);
#endif
diff --git a/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp b/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp
index 859deba1e1ae..aeda168d19d4 100644
--- a/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp
@@ -45,7 +45,7 @@ int main()
test<int, std::allocator<int> >(4096, 1165);
test<int, std::allocator<int> >(4097, 157);
test<int, stack_allocator<int, 4096> >(4095, 90);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test<int, min_allocator<int> >(4095, 90);
#endif
}
diff --git a/test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp
index 5693be702de7..ed8a7e13baa5 100644
--- a/test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp
@@ -47,7 +47,7 @@ int main()
test(4096, 1165, a);
test(4097, 157, a);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
min_allocator<int> a;
test(0, 5, a);
diff --git a/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp
index cf717c2e2f27..784b3a38553a 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp
@@ -16,6 +16,7 @@
#include "../../../Emplaceable.h"
#include "min_allocator.h"
+#include "test_allocator.h"
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -74,7 +75,7 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<Emplaceable> >(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]);
@@ -82,6 +83,17 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<Emplaceable, min_allocator<Emplaceable>> >(rng[i], rng[j]);
}
+ {
+ std::deque<Tag_X, TaggingAllocator<Tag_X>> c;
+ c.emplace_back();
+ assert(c.size() == 1);
+ c.emplace_back(1, 2, 3);
+ assert(c.size() == 2);
+ c.emplace_front();
+ assert(c.size() == 3);
+ c.emplace_front(1, 2, 3);
+ assert(c.size() == 4);
+ }
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp
index becf94ffb4ef..afc0e4972e38 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp
@@ -74,7 +74,7 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<Emplaceable> >(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.modifiers/erase_iter.invalidation.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/erase_iter.invalidation.pass.cpp
index 49465cddaef7..a7a93571f509 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/erase_iter.invalidation.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/erase_iter.invalidation.pass.cpp
@@ -23,9 +23,9 @@ void del_at_start(C c)
typename C::iterator first = c.begin();
typename C::iterator it1 = first + 1;
typename C::iterator it2 = c.end() - 1;
-
+
c.erase (first);
-
+
typename C::iterator it3 = c.begin();
typename C::iterator it4 = c.end() - 1;
assert( it1 == it3);
@@ -42,7 +42,7 @@ void del_at_end(C c)
typename C::iterator first = c.end() - 1;
typename C::iterator it1 = c.begin();
typename C::iterator it2 = first - 1;
-
+
c.erase (first);
typename C::iterator it3 = c.begin();
@@ -60,7 +60,7 @@ int main()
std::deque<int> queue;
for (int i = 0; i < 20; ++i)
queue.push_back(i);
-
+
while (queue.size() > 1)
{
del_at_start(queue);
diff --git a/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp
index a45b75d25c9c..116ed9aa4b5a 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp
@@ -12,6 +12,8 @@
// iterator erase(const_iterator p)
#include <deque>
+#include <algorithm>
+#include <iterator>
#include <cassert>
#include "min_allocator.h"
@@ -78,7 +80,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.modifiers/erase_iter_iter.invalidation.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp
index c785e264db06..a0ccd200bfb7 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp
@@ -26,9 +26,9 @@ void del_at_start(C c, size_t num)
typename C::iterator last = first + num;
typename C::iterator it1 = last;
typename C::iterator it2 = c.end() - 1;
-
+
c.erase (first, last);
-
+
typename C::iterator it3 = c.begin();
typename C::iterator it4 = c.end() - 1;
assert( it1 == it3);
@@ -38,7 +38,7 @@ void del_at_start(C c, size_t num)
assert( *it2 == *it4);
assert(&*it2 == &*it4);
}
-
+
template <typename C>
void del_at_end(C c, size_t num)
{
@@ -46,7 +46,7 @@ void del_at_end(C c, size_t num)
typename C::iterator first = last - num;
typename C::iterator it1 = c.begin();
typename C::iterator it2 = first - 1;
-
+
c.erase (first, last);
typename C::iterator it3 = c.begin();
diff --git a/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp
index 0576aca5c1a8..a53abaf85d33 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp
@@ -14,6 +14,8 @@
// iterator erase(const_iterator f, const_iterator l)
#include <deque>
+#include <algorithm>
+#include <iterator>
#include <cassert>
#include "min_allocator.h"
@@ -84,7 +86,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.modifiers/pop_back.invalidation.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/pop_back.invalidation.pass.cpp
index 1d84f73ccb56..0f5f8e67a24b 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/pop_back.invalidation.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/pop_back.invalidation.pass.cpp
@@ -22,9 +22,9 @@ void test(C c)
{
typename C::iterator it1 = c.begin();
typename C::iterator it2 = c.end() - 2;
-
+
c.pop_back();
-
+
typename C::iterator it3 = c.begin();
typename C::iterator it4 = c.end() - 1;
assert( it1 == it3);
@@ -40,7 +40,7 @@ int main()
std::deque<int> queue;
for (int i = 0; i < 20; ++i)
queue.push_back(i);
-
+
while (queue.size() > 1)
{
test(queue);
diff --git a/test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp
index b345faaf89e9..aeb62c9d996a 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp
@@ -72,7 +72,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.modifiers/pop_front.invalidation.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/pop_front.invalidation.pass.cpp
index 78317f3a3f9c..d7fd910cca5f 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/pop_front.invalidation.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/pop_front.invalidation.pass.cpp
@@ -22,9 +22,9 @@ void test(C c)
{
typename C::iterator it1 = c.begin() + 1;
typename C::iterator it2 = c.end() - 1;
-
+
c.pop_front();
-
+
typename C::iterator it3 = c.begin();
typename C::iterator it4 = c.end() - 1;
assert( it1 == it3);
@@ -40,7 +40,7 @@ int main()
std::deque<int> queue;
for (int i = 0; i < 20; ++i)
queue.push_back(i);
-
+
while (queue.size() > 1)
{
test(queue);
diff --git a/test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp
index d570ec333715..c7a3a625eab6 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp
@@ -72,7 +72,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.modifiers/push_back.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_back.pass.cpp
index 96df6097d994..198cbcf67cc7 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/push_back.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/push_back.pass.cpp
@@ -62,7 +62,7 @@ int main()
for (int j = 0; j < N; ++j)
test<std::deque<int> >(rng[j]);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096};
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 b37e961e442f..1fe1da102f37 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
@@ -26,11 +26,11 @@ class CMyClass {
bool equal(const CMyClass &rhs) const
{ return fTag == rhs.fTag && fMagicValue == rhs.fMagicValue; }
-
+
private:
int fMagicValue;
int fTag;
-
+
private: static int kStartedConstructionMagicValue;
private: static int kFinishedConstructionMagicValue;
};
@@ -84,7 +84,7 @@ int main()
assert(vec==vec2);
}
}
-
+
{
typedef std::deque<CMyClass, test_allocator<CMyClass> > C;
C vec;
diff --git a/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp
index d4ab0d3e2f26..b5c881064a95 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp
@@ -68,7 +68,7 @@ int main()
for (int j = 0; j < N; ++j)
test<std::deque<MoveOnly> >(rng[j]);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096};
const int N = sizeof(rng)/sizeof(rng[0]);
diff --git a/test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp
index 4d6443b1f967..ee4f3d7f9ed7 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp
@@ -71,7 +71,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.modifiers/push_front_exception_safety.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp
index b4caa947aed8..7464870f07e1 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
@@ -30,7 +30,7 @@ class CMyClass {
private:
int fMagicValue;
int fTag;
-
+
private: static int kStartedConstructionMagicValue;
private: static int kFinishedConstructionMagicValue;
};
@@ -84,7 +84,7 @@ int main()
assert(vec==vec2);
}
}
-
+
{
typedef std::deque<CMyClass, test_allocator<CMyClass> > C;
C vec;
diff --git a/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
index ea91ec1b0a44..ab15ca3326bf 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
@@ -77,7 +77,7 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<MoveOnly> >(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.special/copy.pass.cpp b/test/std/containers/sequences/deque/deque.special/copy.pass.cpp
index 3a9962b330a4..846d87c6b664 100644
--- a/test/std/containers/sequences/deque/deque.special/copy.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.special/copy.pass.cpp
@@ -76,7 +76,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.special/copy_backward.pass.cpp b/test/std/containers/sequences/deque/deque.special/copy_backward.pass.cpp
index ccb30a9997d8..e7f37f98d270 100644
--- a/test/std/containers/sequences/deque/deque.special/copy_backward.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.special/copy_backward.pass.cpp
@@ -75,7 +75,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.special/move.pass.cpp b/test/std/containers/sequences/deque/deque.special/move.pass.cpp
index abd8e079975a..1bdbeaf9d5c6 100644
--- a/test/std/containers/sequences/deque/deque.special/move.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.special/move.pass.cpp
@@ -75,7 +75,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.special/move_backward.pass.cpp b/test/std/containers/sequences/deque/deque.special/move_backward.pass.cpp
index ea04f6a15acf..8e909c63c912 100644
--- a/test/std/containers/sequences/deque/deque.special/move_backward.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.special/move_backward.pass.cpp
@@ -75,7 +75,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.special/swap.pass.cpp b/test/std/containers/sequences/deque/deque.special/swap.pass.cpp
index 26757c351f1a..ab21f434937e 100644
--- a/test/std/containers/sequences/deque/deque.special/swap.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.special/swap.pass.cpp
@@ -85,7 +85,7 @@ int main()
assert((c2 == std::deque<int, A>(a1, a1+sizeof(a1)/sizeof(a1[0]))));
assert(c2.get_allocator() == A(1));
}
-#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.special/swap_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
index 83bcac8997ed..2f999e9a7a5d 100644
--- a/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
// void swap(deque& c)
@@ -21,6 +23,7 @@
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -28,7 +31,7 @@ template <class T>
struct some_alloc
{
typedef T value_type;
-
+
some_alloc() {}
some_alloc(const some_alloc&);
void deallocate(void*, unsigned) {}
@@ -40,7 +43,7 @@ template <class T>
struct some_alloc2
{
typedef T value_type;
-
+
some_alloc2() {}
some_alloc2(const some_alloc2&);
void deallocate(void*, unsigned) {}
@@ -51,7 +54,6 @@ struct some_alloc2
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::deque<MoveOnly> C;
C c1, c2;
@@ -86,5 +88,4 @@ int main()
}
#endif
-#endif
}
diff --git a/test/std/containers/sequences/deque/iterators.pass.cpp b/test/std/containers/sequences/deque/iterators.pass.cpp
index 8ec491fae4da..19d7996f824f 100644
--- a/test/std/containers/sequences/deque/iterators.pass.cpp
+++ b/test/std/containers/sequences/deque/iterators.pass.cpp
@@ -33,7 +33,7 @@ int main()
j = c.cbegin();
assert(i == j);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef std::deque<int, min_allocator<int>> C;
C c;
@@ -68,7 +68,7 @@ int main()
assert ( (cii >= ii1 ));
assert (cii - ii1 == 0);
assert (ii1 - cii == 0);
-
+
// std::deque<int> c;
// assert ( ii1 != c.cbegin());
// assert ( cii != c.begin());
diff --git a/test/std/containers/sequences/deque/types.pass.cpp b/test/std/containers/sequences/deque/types.pass.cpp
index da9470d8a6c6..53b33d9e6be9 100644
--- a/test/std/containers/sequences/deque/types.pass.cpp
+++ b/test/std/containers/sequences/deque/types.pass.cpp
@@ -64,6 +64,12 @@ test()
static_assert((std::is_same<
typename C::const_reverse_iterator,
std::reverse_iterator<typename C::const_iterator> >::value), "");
+ static_assert((std::is_signed<typename C::difference_type>::value), "");
+ static_assert((std::is_unsigned<typename C::size_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::iterator>::difference_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::const_iterator>::difference_type>::value), "");
}
int main()
@@ -73,7 +79,8 @@ int main()
test<Copyable, test_allocator<Copyable> >();
static_assert((std::is_same<std::deque<char>::allocator_type,
std::allocator<char> >::value), "");
-#if __cplusplus >= 201103L
+
+#if TEST_STD_VER >= 11
{
typedef std::deque<short, min_allocator<short>> C;
static_assert((std::is_same<C::value_type, short>::value), "");
@@ -85,6 +92,13 @@ int main()
// min_allocator doesn't have a size_type, so one gets synthesized
static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
+
+ static_assert((std::is_signed<typename C::difference_type>::value), "");
+ static_assert((std::is_unsigned<typename C::size_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::iterator>::difference_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::const_iterator>::difference_type>::value), "");
}
#endif
}
diff --git a/test/std/containers/sequences/deque/version.pass.cpp b/test/std/containers/sequences/deque/version.pass.cpp
deleted file mode 100644
index 22e663d9bc22..000000000000
--- a/test/std/containers/sequences/deque/version.pass.cpp
+++ /dev/null
@@ -1,20 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <deque>
-
-#include <deque>
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main()
-{
-}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.access/front.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.access/front.pass.cpp
index 2ec9b8713326..ae14eda50173 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.access/front.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.access/front.pass.cpp
@@ -38,7 +38,7 @@ int main()
assert(c.front() == 0);
assert(*c.begin() == 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/alloc.pass.cpp
index 7aba906ec20d..352945c852d8 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/alloc.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/alloc.pass.cpp
@@ -28,7 +28,7 @@ int main()
assert(c.get_allocator() == A(12));
assert(c.empty());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef min_allocator<NotConstructible> A;
typedef A::value_type T;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_copy.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_copy.pass.cpp
index 0b9263db9899..244054477d56 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_copy.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_copy.pass.cpp
@@ -117,7 +117,7 @@ int main()
assert(c1 == c0);
assert(c1.get_allocator() == A(10));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef min_allocator<int> A;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp
index e0382a10db49..d4dda02b8413 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp
@@ -42,7 +42,7 @@ int main()
assert(*i == 10+n);
assert(n == 4);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp
index 1532b53e7a83..935284831d07 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp
@@ -159,7 +159,7 @@ int main()
assert(c1.get_allocator() == A(10));
assert(c0.empty());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef MoveOnly T;
typedef min_allocator<T> A;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp
index 551908fea166..3d35916ccacb 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp
@@ -42,7 +42,7 @@ int main()
assert(*i == 10+n);
assert(n == 4);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_range.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_range.pass.cpp
index 0b348e6920ca..ccefa2df7ce0 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_range.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_range.pass.cpp
@@ -47,7 +47,7 @@ int main()
assert(*i == 10+n);
assert(n == 4);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_size_value.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_size_value.pass.cpp
index ea53e1c37320..1a1610d37c2f 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_size_value.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_size_value.pass.cpp
@@ -41,7 +41,7 @@ int main()
assert(*i == 10);
assert(n == 4);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/copy.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/copy.pass.cpp
index 2fc53bc3a514..5240afa82b80 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/copy.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/copy.pass.cpp
@@ -50,7 +50,7 @@ int main()
assert(c.get_allocator() == A(-2));
}
#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef min_allocator<int> A;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/copy_alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/copy_alloc.pass.cpp
index bcc24e1cc68e..e4b73bb54e9b 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/copy_alloc.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/copy_alloc.pass.cpp
@@ -48,7 +48,7 @@ int main()
assert(c == c0);
assert(c.get_allocator() == A(9));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef min_allocator<int> A;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/default.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/default.pass.cpp
index 38e95fad8396..04c4524cf980 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/default.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/default.pass.cpp
@@ -24,7 +24,7 @@ int main()
C c;
assert(c.empty());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
index 5167a065a9ad..0ec1f80562a8 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
@@ -14,9 +14,12 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <forward_list>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -29,14 +32,13 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::forward_list<MoveOnly> C;
- static_assert(std::is_nothrow_default_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::forward_list<MoveOnly, test_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_default_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::forward_list<MoveOnly, other_allocator<MoveOnly>> C;
@@ -46,5 +48,4 @@ int main()
typedef std::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
index da41bf4eb1fc..85d929b4e32e 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
@@ -11,14 +11,14 @@
// ~forward_list() // implied noexcept;
+// UNSUPPORTED: c++98, c++03
+
#include <forward_list>
#include <cassert>
#include "MoveOnly.h"
#include "test_allocator.h"
-#if __has_feature(cxx_noexcept)
-
template <class T>
struct some_alloc
{
@@ -27,11 +27,8 @@ struct some_alloc
~some_alloc() noexcept(false);
};
-#endif
-
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::forward_list<MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
@@ -48,5 +45,4 @@ int main()
typedef std::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_destructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp
index 5b31c4dad0a0..c783f60ff4c9 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp
@@ -28,7 +28,7 @@ int main()
assert(*i == n);
assert(n == 10);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp
index 750486b829f2..ba9984f969b5 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp
@@ -31,7 +31,7 @@ int main()
assert(n == 10);
assert(c.get_allocator() == A(14));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef min_allocator<T> A;
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 88ecb7540951..a3e204ec28da 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
@@ -52,7 +52,7 @@ int main()
assert(c0.empty());
assert(c.get_allocator() == A(10));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef MoveOnly T;
typedef min_allocator<T> A;
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 3f0e45af1f0b..6a1afe1334b0 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
@@ -52,7 +52,7 @@ int main()
assert(!c0.empty());
assert(c.get_allocator() == A(9));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef MoveOnly T;
typedef min_allocator<T> A;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
index 28ce2c12b619..b9a6ef7ab8a8 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
@@ -16,6 +16,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <forward_list>
#include <cassert>
@@ -31,7 +33,6 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::forward_list<MoveOnly> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
@@ -48,5 +49,4 @@ int main()
typedef std::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
index 7b001ea67b19..0359133afc9b 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
@@ -14,6 +14,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <forward_list>
#include <cassert>
@@ -29,7 +31,6 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::forward_list<MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
@@ -46,5 +47,4 @@ int main()
typedef std::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/range.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/range.pass.cpp
index 763952439f00..3c0f2b8403ca 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/range.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/range.pass.cpp
@@ -32,7 +32,7 @@ int main()
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/range_alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/range_alloc.pass.cpp
index d72c3581022d..96a29d24e89c 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/range_alloc.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/range_alloc.pass.cpp
@@ -36,7 +36,7 @@ int main()
assert(n == std::end(t) - std::begin(t));
assert(c.get_allocator() == A(13));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef min_allocator<T> A;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
index e02dcb4bf691..736d59936aa3 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
@@ -45,7 +45,7 @@ int main()
#endif
assert(n == N);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef DefaultOnly T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/size_value.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/size_value.pass.cpp
index 05ab98bb205d..56ce632e0a48 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/size_value.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/size_value.pass.cpp
@@ -29,7 +29,7 @@ int main()
assert(*i == v);
assert(n == N);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/size_value_alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/size_value_alloc.pass.cpp
index 1d631ab12ba1..86338a275a55 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/size_value_alloc.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/size_value_alloc.pass.cpp
@@ -32,7 +32,7 @@ int main()
assert(n == N);
assert(c.get_allocator() == A(12));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef min_allocator<int> A;
typedef A::value_type T;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.iter/before_begin.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.iter/before_begin.pass.cpp
index 083cec2886da..c6104e73350b 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.iter/before_begin.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.iter/before_begin.pass.cpp
@@ -60,7 +60,7 @@ int main()
C::const_iterator i = c.before_begin();
assert(std::distance(i, c.end()) == 11);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.iter/iterators.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.iter/iterators.pass.cpp
index 6f3ac548db8b..925cca4d5e8d 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.iter/iterators.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.iter/iterators.pass.cpp
@@ -71,7 +71,7 @@ int main()
C::iterator i;
C::const_iterator j;
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
@@ -127,7 +127,7 @@ int main()
std::forward_list<int>::const_iterator cii{};
assert ( ii1 == ii2 );
assert ( ii1 == ii4 );
-
+
assert (!(ii1 != ii2 ));
assert ( (ii1 == cii ));
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/clear.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/clear.pass.cpp
index 2739b49d8eb2..0e625ac76a02 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/clear.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/clear.pass.cpp
@@ -38,7 +38,7 @@ int main()
c.clear();
assert(distance(c.begin(), c.end()) == 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef NotConstructible T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp
index e305c5b6ab52..dd8ea88c2c1a 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp
@@ -52,7 +52,7 @@ int main()
assert(*next(c.begin(), 3) == Emplaceable(2, 3.5));
assert(distance(c.begin(), c.end()) == 4);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef Emplaceable T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp
index c02337e0562d..18ed69d33f0b 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp
@@ -32,7 +32,7 @@ int main()
assert(*next(c.begin()) == Emplaceable());
assert(distance(c.begin(), c.end()) == 2);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef Emplaceable T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_many.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_many.pass.cpp
index bd9b15300efa..df859c69a117 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_many.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_many.pass.cpp
@@ -84,7 +84,7 @@ int main()
assert(i == c.end());
assert(distance(c.begin(), c.end()) == 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp
index 4f51498bc651..bf6a88a65406 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp
@@ -55,7 +55,7 @@ int main()
assert(i == c.end());
assert(distance(c.begin(), c.end()) == 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_const.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_const.pass.cpp
index ec650b695727..82dca739410f 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_const.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_const.pass.cpp
@@ -50,7 +50,7 @@ int main()
assert(*next(c.begin(), 3) == 2);
assert(distance(c.begin(), c.end()) == 4);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp
index 4d3018199809..15e1a08b08bf 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp
@@ -44,7 +44,7 @@ int main()
assert(*next(c.begin(), 3) == 1);
assert(*next(c.begin(), 4) == 2);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_range.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_range.pass.cpp
index 103475f1edab..a41f8dbbfb2b 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_range.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_range.pass.cpp
@@ -48,7 +48,7 @@ int main()
assert(*next(c.begin(), 3) == 1);
assert(*next(c.begin(), 4) == 2);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp
index f7f376caa090..2e21cc79d269 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp
@@ -52,7 +52,7 @@ int main()
assert(*next(c.begin(), 3) == 2);
assert(distance(c.begin(), c.end()) == 4);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef MoveOnly T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_size_value.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_size_value.pass.cpp
index b2da2ecd3bbd..f4b7e344112a 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_size_value.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_size_value.pass.cpp
@@ -43,7 +43,7 @@ int main()
assert(*next(c.begin(), 3) == 3);
assert(*next(c.begin(), 4) == 3);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp
index 7f14e54a2e6f..d831ceb28918 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp
@@ -46,7 +46,7 @@ int main()
assert(distance(c.begin(), c.end()) == 0);
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_const.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_const.pass.cpp
index 85958afc1ce3..4b55a0b1d808 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_const.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_const.pass.cpp
@@ -30,7 +30,7 @@ int main()
assert(*next(c.begin()) == 1);
assert(distance(c.begin(), c.end()) == 2);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp
index d7c9d758aa03..dfcd2cf90ebc 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp
@@ -32,7 +32,7 @@ int main()
assert(*next(c.begin()) == 1);
assert(distance(c.begin(), c.end()) == 2);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef MoveOnly T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size.pass.cpp
index ef7ef82626dc..6337cd779722 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size.pass.cpp
@@ -64,7 +64,7 @@ int main()
assert(*next(c.begin(), 4) == 0);
assert(*next(c.begin(), 5) == 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef DefaultOnly T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size_value.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size_value.pass.cpp
index d4bd6b4e0111..356e0d657c35 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size_value.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/resize_size_value.pass.cpp
@@ -14,9 +14,14 @@
#include <forward_list>
#include <cassert>
+#include "test_macros.h"
#include "DefaultOnly.h"
#include "min_allocator.h"
+#if TEST_STD_VER >= 11
+#include "container_test_types.h"
+#endif
+
int main()
{
{
@@ -49,7 +54,7 @@ int main()
assert(*next(c.begin(), 4) == 10);
assert(*next(c.begin(), 5) == 10);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
@@ -80,5 +85,19 @@ int main()
assert(*next(c.begin(), 4) == 10);
assert(*next(c.begin(), 5) == 10);
}
+ {
+ // Test that the allocator's construct method is being used to
+ // construct the new elements and that it's called exactly N times.
+ typedef int T;
+ typedef std::forward_list<int, ContainerTestAllocator<int, int>> Container;
+ ConstructController* cc = getConstructController();
+ cc->reset();
+ {
+ Container c;
+ cc->expect<int const&>(6);
+ c.resize(6, 42);
+ assert(!cc->unchecked());
+ }
+ }
#endif
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/merge.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/merge.pass.cpp
index 3b6f853c84cd..a67dd1a4b120 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/merge.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/merge.pass.cpp
@@ -31,7 +31,7 @@ int main()
C c3(std::begin(t3), std::end(t3));
assert(c1 == c3);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_pred.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_pred.pass.cpp
index 7e873bdddd09..6b4e323bd02d 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_pred.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_pred.pass.cpp
@@ -32,7 +32,7 @@ int main()
C c3(std::begin(t3), std::end(t3));
assert(c1 == c3);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/remove.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/remove.pass.cpp
index 18d4cae8cc61..b7607e190bbf 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/remove.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/remove.pass.cpp
@@ -103,7 +103,7 @@ int main()
}
assert ( it == c.end ());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
index ed408fbd685c..ef6f6a0f1887 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
@@ -88,7 +88,7 @@ int main()
assert(c1 == c2);
assert(cp.count() == std::distance(std::begin(t1), std::end(t1)));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef unary_counting_predicate<bool(*)(T), T> Predicate;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/reverse.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/reverse.pass.cpp
index 9bf0d03a8855..2876f65d0630 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/reverse.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/reverse.pass.cpp
@@ -35,7 +35,7 @@ int main()
{
for (int i = 0; i < 10; ++i)
test<std::forward_list<int> >(i);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
for (int i = 0; i < 10; ++i)
test<std::forward_list<int, min_allocator<int>> >(i);
#endif
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp
index 06e40c595ecb..65512e317cea 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp
@@ -40,7 +40,7 @@ int main()
{
for (int i = 0; i < 40; ++i)
test<std::forward_list<int> >(i);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
for (int i = 0; i < 40; ++i)
test<std::forward_list<int, min_allocator<int>> >(i);
#endif
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/sort_pred.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/sort_pred.pass.cpp
index 8b6ca39b2aab..6e5cce39e67d 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/sort_pred.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/sort_pred.pass.cpp
@@ -41,7 +41,7 @@ int main()
{
for (int i = 0; i < 40; ++i)
test<std::forward_list<int> >(i);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
for (int i = 0; i < 40; ++i)
test<std::forward_list<int, min_allocator<int>> >(i);
#endif
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_flist.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_flist.pass.cpp
index 51da651970cd..c8d4e2d34f1e 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_flist.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_flist.pass.cpp
@@ -55,7 +55,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.ops/splice_after_range.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_range.pass.cpp
index 90a159959632..006869d6db69 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_range.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_range.pass.cpp
@@ -121,7 +121,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.ops/unique.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/unique.pass.cpp
index 25db6e64b8a9..e79abb6b6519 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/unique.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/unique.pass.cpp
@@ -67,7 +67,7 @@ int main()
c1.unique();
assert(c1 == c2);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp
index b7dce20b7092..11228afe83e6 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/unique_pred.pass.cpp
@@ -72,7 +72,7 @@ int main()
c1.unique(g);
assert(c1 == c2);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp
index 2b2be7b6c222..e7a8d048f6f6 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp
@@ -176,7 +176,7 @@ int main()
assert(distance(c2.begin(), c2.end()) == 0);
assert(c2.get_allocator() == A(1));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef min_allocator<T> A;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp
index d6ba5a47cbe6..983d8140571b 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp
@@ -177,7 +177,7 @@ int main()
assert(distance(c2.begin(), c2.end()) == 0);
assert(c2.get_allocator() == A(1));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef min_allocator<T> A;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
index cbe8142eeb4b..5f8cf95aa737 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// void swap(forward_list& c)
@@ -21,6 +23,7 @@
#include <forward_list>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -28,7 +31,7 @@ template <class T>
struct some_alloc
{
typedef T value_type;
-
+
some_alloc() {}
some_alloc(const some_alloc&);
void deallocate(void*, unsigned) {}
@@ -40,7 +43,7 @@ template <class T>
struct some_alloc2
{
typedef T value_type;
-
+
some_alloc2() {}
some_alloc2(const some_alloc2&);
void deallocate(void*, unsigned) {}
@@ -51,7 +54,6 @@ struct some_alloc2
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::forward_list<MoveOnly> C;
C c1, c2;
@@ -85,6 +87,4 @@ int main()
static_assert( noexcept(swap(c1, c2)), "");
}
#endif
-
-#endif
}
diff --git a/test/std/containers/sequences/forwardlist/incomplete.pass.cpp b/test/std/containers/sequences/forwardlist/incomplete.pass.cpp
new file mode 100644
index 000000000000..df273449eac1
--- /dev/null
+++ b/test/std/containers/sequences/forwardlist/incomplete.pass.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <forward_list>
+
+// forward_list()
+// forward_list::iterator()
+// forward_list::const_iterator()
+
+#include <forward_list>
+#include <cassert>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+struct A {
+ std::forward_list<A> d;
+ std::forward_list<A>::iterator it;
+ std::forward_list<A>::const_iterator it2;
+};
+
+#if TEST_STD_VER >= 11
+struct B {
+ typedef std::forward_list<B, min_allocator<B>> FList;
+ FList d;
+ FList::iterator it;
+ FList::const_iterator it2;
+};
+#endif
+
+int main()
+{
+ {
+ A a;
+ assert(a.d.empty());
+ a.it = a.d.begin();
+ a.it2 = a.d.cbefore_begin();
+ }
+#if TEST_STD_VER >= 11
+ {
+ B b;
+ assert(b.d.empty());
+ b.it = b.d.begin();
+ b.it2 = b.d.cbefore_begin();
+ }
+#endif
+}
diff --git a/test/std/containers/sequences/forwardlist/max_size.pass.cpp b/test/std/containers/sequences/forwardlist/max_size.pass.cpp
index be7ebaf44b03..a7f39bf90fb8 100644
--- a/test/std/containers/sequences/forwardlist/max_size.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/max_size.pass.cpp
@@ -24,7 +24,7 @@ int main()
C c;
assert(c.max_size() > 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/forwardlist/types.pass.cpp b/test/std/containers/sequences/forwardlist/types.pass.cpp
index a1f8862debbe..5ed7e34b9202 100644
--- a/test/std/containers/sequences/forwardlist/types.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/types.pass.cpp
@@ -44,8 +44,15 @@ int main()
static_assert((std::is_same<C::const_pointer, const char*>::value), "");
static_assert((std::is_same<C::size_type, std::size_t>::value), "");
static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
+
+ static_assert((std::is_signed<typename C::difference_type>::value), "");
+ static_assert((std::is_unsigned<typename C::size_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::iterator>::difference_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::const_iterator>::difference_type>::value), "");
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef std::forward_list<char, min_allocator<char>> C;
static_assert((std::is_same<C::value_type, char>::value), "");
@@ -57,6 +64,13 @@ int main()
// min_allocator doesn't have a size_type, so one gets synthesized
static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
+
+ static_assert((std::is_signed<typename C::difference_type>::value), "");
+ static_assert((std::is_unsigned<typename C::size_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::iterator>::difference_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::const_iterator>::difference_type>::value), "");
}
#endif
}
diff --git a/test/std/containers/sequences/forwardlist/version.pass.cpp b/test/std/containers/sequences/forwardlist/version.pass.cpp
deleted file mode 100644
index 918c8dd5d73c..000000000000
--- a/test/std/containers/sequences/forwardlist/version.pass.cpp
+++ /dev/null
@@ -1,20 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <forward_list>
-
-#include <forward_list>
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main()
-{
-}
diff --git a/test/std/containers/sequences/list/db_back.pass.cpp b/test/std/containers/sequences/list/db_back.pass.cpp
deleted file mode 100644
index b16c0e90701e..000000000000
--- a/test/std/containers/sequences/list/db_back.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.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call back() on empty container.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::list<T> C;
- C c(1);
- assert(c.back() == 0);
- c.clear();
- assert(c.back() == 0);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::list<T, min_allocator<T>> C;
- C c(1);
- assert(c.back() == 0);
- c.clear();
- assert(c.back() == 0);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/db_cback.pass.cpp b/test/std/containers/sequences/list/db_cback.pass.cpp
deleted file mode 100644
index ba3977e16f48..000000000000
--- a/test/std/containers/sequences/list/db_cback.pass.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call back() on empty const container.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::list<T> C;
- const C c;
- assert(c.back() == 0);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::list<T, min_allocator<T>> C;
- const C c;
- assert(c.back() == 0);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/db_cfront.pass.cpp b/test/std/containers/sequences/list/db_cfront.pass.cpp
deleted file mode 100644
index d42290c43c08..000000000000
--- a/test/std/containers/sequences/list/db_cfront.pass.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call front() on empty const container.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::list<T> C;
- const C c;
- assert(c.front() == 0);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::list<T, min_allocator<T>> C;
- const C c;
- assert(c.front() == 0);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/db_front.pass.cpp b/test/std/containers/sequences/list/db_front.pass.cpp
deleted file mode 100644
index 037b16035c66..000000000000
--- a/test/std/containers/sequences/list/db_front.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.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call front() on empty container.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::list<T> C;
- C c(1);
- assert(c.front() == 0);
- c.clear();
- assert(c.front() == 0);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::list<T, min_allocator<T>> C;
- C c(1);
- assert(c.front() == 0);
- c.clear();
- assert(c.front() == 0);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/db_iterators_6.pass.cpp b/test/std/containers/sequences/list/db_iterators_6.pass.cpp
deleted file mode 100644
index a5b8020b3733..000000000000
--- a/test/std/containers/sequences/list/db_iterators_6.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.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Decrement iterator prior to begin.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::list<T> C;
- C c(1);
- C::iterator i = c.end();
- --i;
- assert(i == c.begin());
- --i;
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::list<T, min_allocator<T>> C;
- C c(1);
- C::iterator i = c.end();
- --i;
- assert(i == c.begin());
- --i;
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/db_iterators_7.pass.cpp b/test/std/containers/sequences/list/db_iterators_7.pass.cpp
deleted file mode 100644
index 76a491b1184d..000000000000
--- a/test/std/containers/sequences/list/db_iterators_7.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.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Increment iterator past end.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::list<T> C;
- C c(1);
- C::iterator i = c.begin();
- ++i;
- assert(i == c.end());
- ++i;
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::list<T, min_allocator<T>> C;
- C c(1);
- C::iterator i = c.begin();
- ++i;
- assert(i == c.end());
- ++i;
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/db_iterators_8.pass.cpp b/test/std/containers/sequences/list/db_iterators_8.pass.cpp
deleted file mode 100644
index 1d1ee23a393a..000000000000
--- a/test/std/containers/sequences/list/db_iterators_8.pass.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Dereference non-dereferenceable iterator.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::list<T> C;
- C c(1);
- C::iterator i = c.end();
- T j = *i;
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::list<T, min_allocator<T>> C;
- C c(1);
- C::iterator i = c.end();
- T j = *i;
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/db_iterators_9.pass.cpp b/test/std/containers/sequences/list/db_iterators_9.pass.cpp
deleted file mode 100644
index d02fcd6e4497..000000000000
--- a/test/std/containers/sequences/list/db_iterators_9.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.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Operations on "NULL" iterators
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) do { if (!x) throw 1; } while(0)
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-struct S { int val; };
-
-int main()
-{
-#if _LIBCPP_STD_VER > 11
- {
- unsigned lib_asserts;
-
- typedef S T;
- typedef std::list<T> C;
- C::iterator i{};
- C::const_iterator ci{};
-
- lib_asserts = 0;
- try { ++i; } catch (int) { ++lib_asserts; }
- try { i++; } catch (int) { ++lib_asserts; }
- try { ++ci; } catch (int) { ++lib_asserts; }
- try { ci++; } catch (int) { ++lib_asserts; }
- assert(lib_asserts == 4);
-
- lib_asserts = 0;
- try { --i; } catch (int) { ++lib_asserts; }
- try { i--; } catch (int) { ++lib_asserts; }
- try { --ci; } catch (int) { ++lib_asserts; }
- try { ci--; } catch (int) { ++lib_asserts; }
- assert(lib_asserts == 4);
-
- lib_asserts = 0;
- try { *i; } catch (int) { ++lib_asserts; }
- try { *ci; } catch (int) { ++lib_asserts; }
- try { (void) i->val; } catch (int) { ++lib_asserts; }
- try { (void) ci->val; } catch (int) { ++lib_asserts; }
- assert(lib_asserts == 4);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/iterators.pass.cpp b/test/std/containers/sequences/list/iterators.pass.cpp
index a33ee3ecd2db..fe0ac0799687 100644
--- a/test/std/containers/sequences/list/iterators.pass.cpp
+++ b/test/std/containers/sequences/list/iterators.pass.cpp
@@ -77,7 +77,7 @@ int main()
C::iterator i;
C::const_iterator j;
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::list<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/list/list.capacity/resize_size.pass.cpp b/test/std/containers/sequences/list/list.capacity/resize_size.pass.cpp
index 14629b173a6c..df934699d5ad 100644
--- a/test/std/containers/sequences/list/list.capacity/resize_size.pass.cpp
+++ b/test/std/containers/sequences/list/list.capacity/resize_size.pass.cpp
@@ -47,7 +47,7 @@ int main()
assert(std::distance(l.begin(), l.end()) == 20);
}
#endif // __LIBCPP_MOVE
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l(5, 2);
l.resize(2);
diff --git a/test/std/containers/sequences/list/list.capacity/resize_size_value.pass.cpp b/test/std/containers/sequences/list/list.capacity/resize_size_value.pass.cpp
index 2738ffbbefdd..4609ef986835 100644
--- a/test/std/containers/sequences/list/list.capacity/resize_size_value.pass.cpp
+++ b/test/std/containers/sequences/list/list.capacity/resize_size_value.pass.cpp
@@ -33,7 +33,7 @@ int main()
assert(l.front() == 2);
assert(l.back() == 3.5);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<double, min_allocator<double>> l(5, 2);
l.resize(2, 3.5);
diff --git a/test/std/containers/sequences/list/list.cons/assign_copy.pass.cpp b/test/std/containers/sequences/list/list.cons/assign_copy.pass.cpp
index b851eb9dc5a0..7c8cee2a5581 100644
--- a/test/std/containers/sequences/list/list.cons/assign_copy.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/assign_copy.pass.cpp
@@ -32,7 +32,7 @@ int main()
assert(l2 == l);
assert(l2.get_allocator() == other_allocator<int>(5));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int> > l(3, 2, min_allocator<int>());
std::list<int, min_allocator<int> > l2(l, min_allocator<int>());
diff --git a/test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp b/test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp
index 24bd140c4e4f..9b2c6d68cbe5 100644
--- a/test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp
@@ -29,7 +29,7 @@ int main()
assert(*i++ == 5);
assert(*i++ == 6);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> d;
d.assign({3, 4, 5, 6});
diff --git a/test/std/containers/sequences/list/list.cons/assign_move.pass.cpp b/test/std/containers/sequences/list/list.cons/assign_move.pass.cpp
index 0fd586f84af7..2f863c6169fc 100644
--- a/test/std/containers/sequences/list/list.cons/assign_move.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/assign_move.pass.cpp
@@ -62,7 +62,7 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
diff --git a/test/std/containers/sequences/list/list.cons/copy.pass.cpp b/test/std/containers/sequences/list/list.cons/copy.pass.cpp
index 530690a925d4..a6abd1f3c30b 100644
--- a/test/std/containers/sequences/list/list.cons/copy.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/copy.pass.cpp
@@ -38,7 +38,7 @@ int main()
assert(l2.get_allocator() == other_allocator<int>(-2));
}
#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l(3, 2);
std::list<int, min_allocator<int>> l2 = l;
diff --git a/test/std/containers/sequences/list/list.cons/copy_alloc.pass.cpp b/test/std/containers/sequences/list/list.cons/copy_alloc.pass.cpp
index 99fe9f115f94..a164298f4fae 100644
--- a/test/std/containers/sequences/list/list.cons/copy_alloc.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/copy_alloc.pass.cpp
@@ -31,7 +31,7 @@ int main()
assert(l2 == l);
assert(l2.get_allocator() == other_allocator<int>(3));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int> > l(3, 2, min_allocator<int>());
std::list<int, min_allocator<int> > l2(l, min_allocator<int>());
diff --git a/test/std/containers/sequences/list/list.cons/default.pass.cpp b/test/std/containers/sequences/list/list.cons/default.pass.cpp
index c05bd74ca79e..3c1c2ef166d4 100644
--- a/test/std/containers/sequences/list/list.cons/default.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/default.pass.cpp
@@ -33,7 +33,7 @@ int main()
assert(l.size() == 0);
assert(std::distance(l.begin(), l.end()) == 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l;
assert(l.size() == 0);
diff --git a/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
index 2455fb39a79a..6f76d8c56882 100644
--- a/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
@@ -14,9 +14,12 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <list>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -29,14 +32,13 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::list<MoveOnly> C;
- static_assert(std::is_nothrow_default_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::list<MoveOnly, test_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_default_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::list<MoveOnly, other_allocator<MoveOnly>> C;
@@ -46,5 +48,4 @@ int main()
typedef std::list<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/list/list.cons/default_stack_alloc.pass.cpp b/test/std/containers/sequences/list/list.cons/default_stack_alloc.pass.cpp
index 9d9946b68966..4b88580e12ca 100644
--- a/test/std/containers/sequences/list/list.cons/default_stack_alloc.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/default_stack_alloc.pass.cpp
@@ -33,7 +33,7 @@ int main()
assert(l.size() == 0);
assert(std::distance(l.begin(), l.end()) == 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l;
assert(l.size() == 0);
diff --git a/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
index ca7ade6d19cb..3d11f13358b5 100644
--- a/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
@@ -11,14 +11,14 @@
// ~list() // implied noexcept;
+// UNSUPPORTED: c++98, c++03
+
#include <list>
#include <cassert>
#include "MoveOnly.h"
#include "test_allocator.h"
-#if __has_feature(cxx_noexcept)
-
template <class T>
struct some_alloc
{
@@ -27,11 +27,8 @@ struct some_alloc
~some_alloc() noexcept(false);
};
-#endif
-
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::list<MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
@@ -48,5 +45,4 @@ int main()
typedef std::list<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_destructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp b/test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp
index 3307017989eb..40413203bdfc 100644
--- a/test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp
@@ -28,7 +28,7 @@ int main()
assert(*i++ == 5);
assert(*i++ == 6);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> d = {3, 4, 5, 6};
assert(d.size() == 4);
diff --git a/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
index 4a85e378c1ce..72add79f6670 100644
--- a/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
@@ -30,7 +30,7 @@ int main()
assert(*i++ == 5);
assert(*i++ == 6);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
assert(d.get_allocator() == min_allocator<int>());
diff --git a/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp b/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp
index 09eae8ab43c1..0dd71d70f85b 100644
--- a/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp
@@ -51,7 +51,7 @@ int main()
for (std::list<int>::const_iterator i = l.begin(), e = l.end(); i != e; ++i, ++j)
assert(*i == j);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a[] = {0, 1, 2, 3};
std::list<int, min_allocator<int>> l(input_iterator<const int*>(a),
diff --git a/test/std/containers/sequences/list/list.cons/move.pass.cpp b/test/std/containers/sequences/list/list.cons/move.pass.cpp
index 54209a55f7e2..1049b1b03982 100644
--- a/test/std/containers/sequences/list/list.cons/move.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// list(list&& c);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
@@ -46,7 +47,6 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
}
-#if __cplusplus >= 201103L
{
std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
@@ -60,15 +60,4 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
}
-#endif
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int> l1 = {1, 2, 3};
- std::list<int>::iterator i = l1.begin();
- std::list<int> l2 = std::move(l1);
- assert(*l2.erase(i) == 2);
- assert(l2.size() == 2);
- }
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp b/test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp
index 8f82702b296f..9f8a536b33c5 100644
--- a/test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp
@@ -59,7 +59,7 @@ int main()
assert(!l.empty());
assert(l2.get_allocator() == other_allocator<MoveOnly>(4));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
diff --git a/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
index 280d93d486e6..d4f8fde2c8ff 100644
--- a/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
@@ -16,6 +16,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <list>
#include <cassert>
@@ -31,7 +33,6 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::list<MoveOnly> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
@@ -48,5 +49,4 @@ int main()
typedef std::list<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
index e436a29f5d47..da2b6a36cef5 100644
--- a/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
@@ -14,6 +14,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <list>
#include <cassert>
@@ -29,7 +31,6 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::list<MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
@@ -46,5 +47,4 @@ int main()
typedef std::list<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp
index 7b7b8a327b88..1097bdab2198 100644
--- a/test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp
@@ -28,7 +28,7 @@ int main()
assert(*i++ == 5);
assert(*i++ == 6);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> d;
d = {3, 4, 5, 6};
diff --git a/test/std/containers/sequences/list/list.cons/size_type.pass.cpp b/test/std/containers/sequences/list/list.cons/size_type.pass.cpp
index 75b93a3dfb6b..07b4f14dc3a2 100644
--- a/test/std/containers/sequences/list/list.cons/size_type.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/size_type.pass.cpp
@@ -80,7 +80,7 @@ int main()
assert(std::distance(l.begin(), l.end()) == 3);
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l(3);
assert(l.size() == 3);
diff --git a/test/std/containers/sequences/list/list.cons/size_value_alloc.pass.cpp b/test/std/containers/sequences/list/list.cons/size_value_alloc.pass.cpp
index 12da86da0a41..ac7b18ea4990 100644
--- a/test/std/containers/sequences/list/list.cons/size_value_alloc.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/size_value_alloc.pass.cpp
@@ -52,7 +52,7 @@ int main()
++i;
assert(*i == 2);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l(3, 2);
assert(l.size() == 3);
diff --git a/test/std/containers/sequences/list/list.modifiers/clear.pass.cpp b/test/std/containers/sequences/list/list.modifiers/clear.pass.cpp
index 38696b6eb503..5d8c41fa1976 100644
--- a/test/std/containers/sequences/list/list.modifiers/clear.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/clear.pass.cpp
@@ -24,7 +24,7 @@ int main()
c.clear();
assert(c.empty());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a[] = {1, 2, 3};
std::list<int, min_allocator<int>> c(a, a+3);
diff --git a/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp b/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp
index 6476d1d6c6ae..e8d46941252e 100644
--- a/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/emplace.pass.cpp
@@ -7,17 +7,17 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// template <class... Args> void emplace(const_iterator p, Args&&... args);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
#include <list>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
class A
@@ -37,7 +37,6 @@ public:
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::list<A> c;
c.emplace(c.cbegin(), 2, 3.5);
@@ -51,17 +50,6 @@ int main()
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<A> c1;
- std::list<A> c2;
- std::list<A>::iterator i = c1.emplace(c2.cbegin(), 2, 3.5);
- assert(false);
- }
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if __cplusplus >= 201103L
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::list<A, min_allocator<A>> c;
c.emplace(c.cbegin(), 2, 3.5);
@@ -75,14 +63,5 @@ int main()
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<A, min_allocator<A>> c1;
- std::list<A, min_allocator<A>> c2;
- std::list<A, min_allocator<A>>::iterator i = c1.emplace(c2.cbegin(), 2, 3.5);
- assert(false);
- }
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#endif
+
}
diff --git a/test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp b/test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp
index 5983efc59ad1..2ff01f1676f2 100644
--- a/test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp
@@ -47,7 +47,7 @@ int main()
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<A, min_allocator<A>> c;
c.emplace_back(2, 3.5);
diff --git a/test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp b/test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp
index e2e68e331381..8a3df46a31e2 100644
--- a/test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp
@@ -47,7 +47,7 @@ int main()
assert(c.back().geti() == 2);
assert(c.back().getd() == 3.5);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<A, min_allocator<A>> c;
c.emplace_front(2, 3.5);
diff --git a/test/std/containers/sequences/list/list.modifiers/erase_iter.pass.cpp b/test/std/containers/sequences/list/list.modifiers/erase_iter.pass.cpp
index c1cc90043670..0924fdb84879 100644
--- a/test/std/containers/sequences/list/list.modifiers/erase_iter.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/erase_iter.pass.cpp
@@ -39,7 +39,7 @@ int main()
assert(l1.size() == 0);
assert(distance(l1.begin(), l1.end()) == 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 2, 3};
std::list<int, min_allocator<int>> l1(a1, a1+3);
diff --git a/test/std/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp b/test/std/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp
deleted file mode 100644
index 18c15eb02c85..000000000000
--- a/test/std/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call erase(const_iterator position) with end()
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <cstdlib>
-#include <exception>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::list<int> l1(a1, a1+3);
- std::list<int>::const_iterator i = l1.end();
- l1.erase(i);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- int a1[] = {1, 2, 3};
- std::list<int, min_allocator<int>> l1(a1, a1+3);
- std::list<int, min_allocator<int>>::const_iterator i = l1.end();
- l1.erase(i);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp b/test/std/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp
deleted file mode 100644
index 61ff8409c964..000000000000
--- a/test/std/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call erase(const_iterator position) with iterator from another container
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <cstdlib>
-#include <exception>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::list<int> l1(a1, a1+3);
- std::list<int> l2(a1, a1+3);
- std::list<int>::const_iterator i = l2.begin();
- l1.erase(i);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- int a1[] = {1, 2, 3};
- std::list<int, min_allocator<int>> l1(a1, a1+3);
- std::list<int, min_allocator<int>> l2(a1, a1+3);
- std::list<int, min_allocator<int>>::const_iterator i = l2.begin();
- l1.erase(i);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/list.modifiers/erase_iter_iter.pass.cpp b/test/std/containers/sequences/list/list.modifiers/erase_iter_iter.pass.cpp
index bd3f66b4116a..06b4f0cc654f 100644
--- a/test/std/containers/sequences/list/list.modifiers/erase_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/erase_iter_iter.pass.cpp
@@ -49,7 +49,7 @@ int main()
assert(distance(l1.cbegin(), l1.cend()) == 0);
assert(i == l1.begin());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
std::list<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), l1.cbegin());
diff --git a/test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp b/test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
deleted file mode 100644
index 71ad497e7d97..000000000000
--- a/test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call erase(const_iterator first, const_iterator last); with first iterator from another container
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::list<int> l1(a1, a1+3);
- std::list<int> l2(a1, a1+3);
- std::list<int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- int a1[] = {1, 2, 3};
- std::list<int, min_allocator<int>> l1(a1, a1+3);
- std::list<int, min_allocator<int>> l2(a1, a1+3);
- std::list<int, min_allocator<int>>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp b/test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp
deleted file mode 100644
index db76b4de4865..000000000000
--- a/test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call erase(const_iterator first, const_iterator last); with second iterator from another container
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::list<int> l1(a1, a1+3);
- std::list<int> l2(a1, a1+3);
- std::list<int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- int a1[] = {1, 2, 3};
- std::list<int, min_allocator<int>> l1(a1, a1+3);
- std::list<int, min_allocator<int>> l2(a1, a1+3);
- std::list<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp b/test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp
deleted file mode 100644
index 25c5c6147a01..000000000000
--- a/test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call erase(const_iterator first, const_iterator last); with both iterators from another container
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::list<int> l1(a1, a1+3);
- std::list<int> l2(a1, a1+3);
- std::list<int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- int a1[] = {1, 2, 3};
- std::list<int, min_allocator<int>> l1(a1, a1+3);
- std::list<int, min_allocator<int>> l2(a1, a1+3);
- std::list<int, min_allocator<int>>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp b/test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp
deleted file mode 100644
index 35a4ceb4848a..000000000000
--- a/test/std/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call erase(const_iterator first, const_iterator last); with a bad range
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::list<int> l1(a1, a1+3);
- std::list<int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- int a1[] = {1, 2, 3};
- std::list<int, min_allocator<int>> l1(a1, a1+3);
- std::list<int, min_allocator<int>>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp
index a82a2696e82a..91845e564b02 100644
--- a/test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp
@@ -40,7 +40,7 @@ int main()
assert(*i++ == 1);
assert(*i++ == 1);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> d(10, 1);
std::list<int, min_allocator<int>>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
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 736b9baae746..18460a65743c 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,117 +7,25 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <list>
// template <InputIterator Iter>
// iterator insert(const_iterator position, Iter first, Iter last);
-// UNSUPPORTED: sanitizer-new-delete
-
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <list>
#include <cstdlib>
#include <cassert>
+
+#include "test_macros.h"
#include "test_iterators.h"
#include "min_allocator.h"
+#include "count_new.hpp"
-int throw_next = 0xFFFF;
-int count = 0;
-
-void* operator new(std::size_t s) throw(std::bad_alloc)
-{
- if (throw_next == 0)
- throw std::bad_alloc();
- --throw_next;
- ++count;
- return std::malloc(s);
-}
-
-void operator delete(void* p) throw()
-{
- --count;
- std::free(p);
-}
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::list<int> l1;
- std::list<int>::iterator i = l1.insert(l1.begin(), a1, a1+3);
- assert(i == l1.begin());
- assert(l1.size() == 3);
- assert(distance(l1.begin(), l1.end()) == 3);
- i = l1.begin();
- assert(*i == 1);
- ++i;
- assert(*i == 2);
- ++i;
- assert(*i == 3);
- int a2[] = {4, 5, 6};
- i = l1.insert(i, a2, a2+3);
- assert(*i == 4);
- assert(l1.size() == 6);
- assert(distance(l1.begin(), l1.end()) == 6);
- i = l1.begin();
- assert(*i == 1);
- ++i;
- assert(*i == 2);
- ++i;
- assert(*i == 4);
- ++i;
- assert(*i == 5);
- ++i;
- assert(*i == 6);
- ++i;
- assert(*i == 3);
- throw_next = 2;
- int save_count = count;
- try
- {
- i = l1.insert(i, a2, a2+3);
- assert(false);
- }
- catch (...)
- {
- }
- assert(save_count == count);
- assert(l1.size() == 6);
- assert(distance(l1.begin(), l1.end()) == 6);
- i = l1.begin();
- assert(*i == 1);
- ++i;
- assert(*i == 2);
- ++i;
- assert(*i == 4);
- ++i;
- assert(*i == 5);
- ++i;
- assert(*i == 6);
- ++i;
- assert(*i == 3);
- }
- throw_next = 0xFFFF;
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int> v(100);
- std::list<int> v2(100);
- int a[] = {1, 2, 3, 4, 5};
- const int N = sizeof(a)/sizeof(a[0]);
- std::list<int>::iterator i = v.insert(next(v2.cbegin(), 10), input_iterator<const int*>(a),
- input_iterator<const int*>(a+N));
- assert(false);
- }
-#endif
-#if __cplusplus >= 201103L
- {
+template <class List>
+void test() {
int a1[] = {1, 2, 3};
- std::list<int, min_allocator<int>> l1;
- std::list<int, min_allocator<int>>::iterator i = l1.insert(l1.begin(), a1, a1+3);
+ List l1;
+ typename List::iterator i = l1.insert(l1.begin(), a1, a1+3);
assert(i == l1.begin());
assert(l1.size() == 3);
assert(distance(l1.begin(), l1.end()) == 3);
@@ -144,8 +52,10 @@ int main()
assert(*i == 6);
++i;
assert(*i == 3);
- throw_next = 2;
- int save_count = count;
+
+#if !defined(TEST_HAS_NO_EXCEPTIONS) && !defined(DISABLE_NEW_COUNT)
+ globalMemCounter.throw_after = 2;
+ int save_count = globalMemCounter.outstanding_new;
try
{
i = l1.insert(i, a2, a2+3);
@@ -154,7 +64,7 @@ int main()
catch (...)
{
}
- assert(save_count == count);
+ assert(globalMemCounter.checkOutstandingNewEq(save_count));
assert(l1.size() == 6);
assert(distance(l1.begin(), l1.end()) == 6);
i = l1.begin();
@@ -169,18 +79,13 @@ int main()
assert(*i == 6);
++i;
assert(*i == 3);
- }
-#if _LIBCPP_DEBUG >= 1
- {
- throw_next = 0xFFFF;
- std::list<int, min_allocator<int>> v(100);
- std::list<int, min_allocator<int>> v2(100);
- int a[] = {1, 2, 3, 4, 5};
- const int N = sizeof(a)/sizeof(a[0]);
- std::list<int, min_allocator<int>>::iterator i = v.insert(next(v2.cbegin(), 10), input_iterator<const int*>(a),
- input_iterator<const int*>(a+N));
- assert(false);
- }
#endif
+}
+
+int main()
+{
+ test<std::list<int> >();
+#if TEST_STD_VER >= 11
+ test<std::list<int, min_allocator<int>>>();
#endif
}
diff --git a/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp b/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp
index 3d5dec299b95..5d579fcd202e 100644
--- a/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/insert_iter_rvalue.pass.cpp
@@ -7,14 +7,12 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// iterator insert(const_iterator position, value_type&& x);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <list>
#include <cassert>
@@ -23,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::list<MoveOnly> l1;
l1.insert(l1.cend(), MoveOnly(1));
@@ -34,17 +31,6 @@ int main()
assert(l1.front() == MoveOnly(2));
assert(l1.back() == MoveOnly(1));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int> v1(3);
- std::list<int> v2(3);
- v1.insert(v2.begin(), 4);
- assert(false);
- }
-#endif
-#if __cplusplus >= 201103L
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
l1.insert(l1.cend(), MoveOnly(1));
@@ -55,14 +41,4 @@ int main()
assert(l1.front() == MoveOnly(2));
assert(l1.back() == MoveOnly(1));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int, min_allocator<int>> v1(3);
- std::list<int, min_allocator<int>> v2(3);
- v1.insert(v2.begin(), 4);
- assert(false);
- }
-#endif
-#endif
}
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 c0f6ed198751..d85c1f4b9987 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
@@ -14,75 +14,23 @@
// UNSUPPORTED: sanitizer-new-delete
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <list>
#include <cstdlib>
#include <cassert>
#include "min_allocator.h"
+#include "count_new.hpp"
-int throw_next = 0xFFFF;
-int count = 0;
-
-void* operator new(std::size_t s) throw(std::bad_alloc)
-{
- if (throw_next == 0)
- throw std::bad_alloc();
- --throw_next;
- ++count;
- return std::malloc(s);
-}
-
-void operator delete(void* p) throw()
-{
- --count;
- std::free(p);
-}
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- int a2[] = {1, 4, 4, 4, 4, 4, 2, 3};
- std::list<int> l1(a1, a1+3);
- std::list<int>::iterator i = l1.insert(next(l1.cbegin()), 5, 4);
- assert(i == next(l1.begin()));
- assert(l1 == std::list<int>(a2, a2+8));
- throw_next = 4;
- int save_count = count;
- try
- {
- i = l1.insert(i, 5, 5);
- assert(false);
- }
- catch (...)
- {
- }
- throw_next = 0xFFFF;
- assert(save_count == count);
- assert(l1 == std::list<int>(a2, a2+8));
- }
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int> c1(100);
- std::list<int> c2;
- std::list<int>::iterator i = c1.insert(next(c2.cbegin(), 10), 5, 1);
- assert(false);
- }
-#endif
-#if __cplusplus >= 201103L
- {
+template <class List>
+void test() {
int a1[] = {1, 2, 3};
int a2[] = {1, 4, 4, 4, 4, 4, 2, 3};
- std::list<int, min_allocator<int>> l1(a1, a1+3);
- std::list<int, min_allocator<int>>::iterator i = l1.insert(next(l1.cbegin()), 5, 4);
+ List l1(a1, a1+3);
+ typename List::iterator i = l1.insert(next(l1.cbegin()), 5, 4);
assert(i == next(l1.begin()));
- assert((l1 == std::list<int, min_allocator<int>>(a2, a2+8)));
- throw_next = 4;
- int save_count = count;
+ assert(l1 == List(a2, a2+8));
+ globalMemCounter.throw_after = 4;
+ int save_count = globalMemCounter.outstanding_new;
try
{
i = l1.insert(i, 5, 5);
@@ -91,17 +39,14 @@ int main()
catch (...)
{
}
- throw_next = 0xFFFF;
- assert(save_count == count);
- assert((l1 == std::list<int, min_allocator<int>>(a2, a2+8)));
- }
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int, min_allocator<int>> c1(100);
- std::list<int, min_allocator<int>> c2;
- std::list<int, min_allocator<int>>::iterator i = c1.insert(next(c2.cbegin(), 10), 5, 1);
- assert(false);
- }
-#endif
+ assert(globalMemCounter.checkOutstandingNewEq(save_count));
+ assert(l1 == List(a2, a2+8));
+}
+
+int main()
+{
+ test<std::list<int> >();
+#if TEST_STD_VER >= 11
+ test<std::list<int, min_allocator<int>>>();
#endif
}
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 1aacb63e4a70..87a033be64e9 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,87 +7,33 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <list>
// iterator insert(const_iterator position, const value_type& x);
-// UNSUPPORTED: sanitizer-new-delete
-
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <list>
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
+#include "count_new.hpp"
-int throw_next = 0xFFFF;
-int count = 0;
-
-void* operator new(std::size_t s) throw(std::bad_alloc)
-{
- if (throw_next == 0)
- throw std::bad_alloc();
- --throw_next;
- ++count;
- return std::malloc(s);
-}
-
-void operator delete(void* p) throw()
-{
- --count;
- std::free(p);
-}
-
-int main()
+template <class List>
+void test()
{
- {
- int a1[] = {1, 2, 3};
- int a2[] = {1, 4, 2, 3};
- std::list<int> l1(a1, a1+3);
- std::list<int>::iterator i = l1.insert(next(l1.cbegin()), 4);
- assert(i == next(l1.begin()));
- assert(l1.size() == 4);
- assert(distance(l1.begin(), l1.end()) == 4);
- assert(l1 == std::list<int>(a2, a2+4));
- throw_next = 0;
- int save_count = count;
- try
- {
- i = l1.insert(i, 5);
- assert(false);
- }
- catch (...)
- {
- }
- throw_next = 0xFFFF;
- assert(save_count == count);
- assert(l1 == std::list<int>(a2, a2+4));
- }
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int> v1(3);
- std::list<int> v2(3);
- int i = 4;
- v1.insert(v2.begin(), i);
- assert(false);
- }
-#endif
-#if __cplusplus >= 201103L
- {
int a1[] = {1, 2, 3};
int a2[] = {1, 4, 2, 3};
- std::list<int, min_allocator<int>> l1(a1, a1+3);
- std::list<int, min_allocator<int>>::iterator i = l1.insert(next(l1.cbegin()), 4);
+ List l1(a1, a1+3);
+ typename List::iterator i = l1.insert(next(l1.cbegin()), 4);
assert(i == next(l1.begin()));
assert(l1.size() == 4);
assert(distance(l1.begin(), l1.end()) == 4);
- assert((l1 == std::list<int, min_allocator<int>>(a2, a2+4)));
- throw_next = 0;
- int save_count = count;
+ assert(l1 == List(a2, a2+4));
+
+#if !defined(TEST_HAS_NO_EXCEPTIONS) && !defined(DISABLE_NEW_COUNT)
+ globalMemCounter.throw_after = 0;
+ int save_count = globalMemCounter.outstanding_new;
try
{
i = l1.insert(i, 5);
@@ -96,18 +42,15 @@ int main()
catch (...)
{
}
- throw_next = 0xFFFF;
- assert(save_count == count);
- assert((l1 == std::list<int, min_allocator<int>>(a2, a2+4)));
- }
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int, min_allocator<int>> v1(3);
- std::list<int, min_allocator<int>> v2(3);
- int i = 4;
- v1.insert(v2.begin(), i);
- assert(false);
- }
+ assert(globalMemCounter.checkOutstandingNewEq(save_count));
+ assert(l1 == List(a2, a2+4));
#endif
+}
+
+int main()
+{
+ test<std::list<int> >();
+#if TEST_STD_VER >= 11
+ test<std::list<int, min_allocator<int>>>();
#endif
}
diff --git a/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp b/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp
index 3add8518809c..c5b0277c6eff 100644
--- a/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/pop_back.pass.cpp
@@ -11,13 +11,10 @@
// void pop_back();
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <list>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -31,12 +28,8 @@ int main()
assert(c == std::list<int>(a, a+1));
c.pop_back();
assert(c.empty());
-#if _LIBCPP_DEBUG >= 1
- c.pop_back();
- assert(false);
-#endif
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a[] = {1, 2, 3};
std::list<int, min_allocator<int>> c(a, a+3);
@@ -46,10 +39,6 @@ int main()
assert((c == std::list<int, min_allocator<int>>(a, a+1)));
c.pop_back();
assert(c.empty());
-#if _LIBCPP_DEBUG >= 1
- c.pop_back();
- assert(false);
-#endif
}
#endif
}
diff --git a/test/std/containers/sequences/list/list.modifiers/pop_front.pass.cpp b/test/std/containers/sequences/list/list.modifiers/pop_front.pass.cpp
index aec17cc08f43..bb3ad546984d 100644
--- a/test/std/containers/sequences/list/list.modifiers/pop_front.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/pop_front.pass.cpp
@@ -28,7 +28,7 @@ int main()
c.pop_front();
assert(c.empty());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a[] = {1, 2, 3};
std::list<int, min_allocator<int>> c(a, a+3);
diff --git a/test/std/containers/sequences/list/list.modifiers/push_back.pass.cpp b/test/std/containers/sequences/list/list.modifiers/push_back.pass.cpp
index 2638c541fa1c..3b05cd72968e 100644
--- a/test/std/containers/sequences/list/list.modifiers/push_back.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/push_back.pass.cpp
@@ -25,7 +25,7 @@ int main()
int a[] = {0, 1, 2, 3, 4};
assert(c == std::list<int>(a, a+5));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> c;
for (int i = 0; i < 5; ++i)
diff --git a/test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp b/test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp
index a2837f813bea..10acede511f4 100644
--- a/test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp
@@ -30,7 +30,7 @@ int main()
assert(l1.front() == MoveOnly(1));
assert(l1.back() == MoveOnly(2));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
l1.push_back(MoveOnly(1));
diff --git a/test/std/containers/sequences/list/list.modifiers/push_front.pass.cpp b/test/std/containers/sequences/list/list.modifiers/push_front.pass.cpp
index b7f4febcd385..ed0ef662031a 100644
--- a/test/std/containers/sequences/list/list.modifiers/push_front.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/push_front.pass.cpp
@@ -25,7 +25,7 @@ int main()
int a[] = {4, 3, 2, 1, 0};
assert(c == std::list<int>(a, a+5));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> c;
for (int i = 0; i < 5; ++i)
diff --git a/test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp b/test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp
index 4f41c3dd390b..5321ee0faed3 100644
--- a/test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp
@@ -30,7 +30,7 @@ int main()
assert(l1.front() == MoveOnly(2));
assert(l1.back() == MoveOnly(1));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
l1.push_front(MoveOnly(1));
diff --git a/test/std/containers/sequences/list/list.ops/merge.pass.cpp b/test/std/containers/sequences/list/list.ops/merge.pass.cpp
index d226ed5dc642..7c1287706f35 100644
--- a/test/std/containers/sequences/list/list.ops/merge.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/merge.pass.cpp
@@ -27,7 +27,7 @@ int main()
c1.merge(c2);
assert(c1 == std::list<int>(a3, a3+sizeof(a3)/sizeof(a3[0])));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
diff --git a/test/std/containers/sequences/list/list.ops/merge_comp.pass.cpp b/test/std/containers/sequences/list/list.ops/merge_comp.pass.cpp
index ce861a5dcb88..838ff22b3a53 100644
--- a/test/std/containers/sequences/list/list.ops/merge_comp.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/merge_comp.pass.cpp
@@ -28,7 +28,7 @@ int main()
c1.merge(c2, std::greater<int>());
assert(c1 == std::list<int>(a3, a3+sizeof(a3)/sizeof(a3[0])));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {10, 9, 7, 3, 1};
int a2[] = {11, 8, 6, 5, 4, 2, 0};
diff --git a/test/std/containers/sequences/list/list.ops/remove.pass.cpp b/test/std/containers/sequences/list/list.ops/remove.pass.cpp
index f580c94ef486..fed28e442e12 100644
--- a/test/std/containers/sequences/list/list.ops/remove.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/remove.pass.cpp
@@ -57,7 +57,7 @@ int main()
}
assert ( it == c.end ());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 2, 3, 4};
int a2[] = {1, 2, 4};
diff --git a/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp b/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp
index 162919ed85de..1b457823d6ab 100644
--- a/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/remove_if.pass.cpp
@@ -50,7 +50,7 @@ int main()
assert(c == std::list<int>(a2, a2+2));
assert(cp.count() == 4);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 2, 3, 4};
int a2[] = {3, 4};
diff --git a/test/std/containers/sequences/list/list.ops/reverse.pass.cpp b/test/std/containers/sequences/list/list.ops/reverse.pass.cpp
index 046453ae5386..120caba38ac9 100644
--- a/test/std/containers/sequences/list/list.ops/reverse.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/reverse.pass.cpp
@@ -25,7 +25,7 @@ int main()
c1.reverse();
assert(c1 == std::list<int>(a2, a2+sizeof(a2)/sizeof(a2[0])));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
int a2[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
diff --git a/test/std/containers/sequences/list/list.ops/sort.pass.cpp b/test/std/containers/sequences/list/list.ops/sort.pass.cpp
index 1c11227237a7..d51aa92dd782 100644
--- a/test/std/containers/sequences/list/list.ops/sort.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/sort.pass.cpp
@@ -25,7 +25,7 @@ int main()
c1.sort();
assert(c1 == std::list<int>(a2, a2+sizeof(a2)/sizeof(a2[0])));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {4, 8, 1, 0, 5, 7, 2, 3, 6, 11, 10, 9};
int a2[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
diff --git a/test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp b/test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp
index 28125ab83c00..517eb62ccae2 100644
--- a/test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp
@@ -26,7 +26,7 @@ int main()
c1.sort(std::greater<int>());
assert(c1 == std::list<int>(a2, a2+sizeof(a2)/sizeof(a2[0])));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {4, 8, 1, 0, 5, 7, 2, 3, 6, 11, 10, 9};
int a2[] = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
diff --git a/test/std/containers/sequences/list/list.ops/splice_pos_list.pass.cpp b/test/std/containers/sequences/list/list.ops/splice_pos_list.pass.cpp
index 354871c20afa..41d861da0d55 100644
--- a/test/std/containers/sequences/list/list.ops/splice_pos_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/splice_pos_list.pass.cpp
@@ -11,13 +11,10 @@
// void splice(const_iterator position, list& x);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <list>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -403,15 +400,7 @@ int main()
++i;
assert(*i == 6);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int> v1(3);
- std::list<int> v2(3);
- v1.splice(v2.begin(), v2);
- assert(false);
- }
-#endif
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l1;
std::list<int, min_allocator<int>> l2;
@@ -791,13 +780,5 @@ int main()
++i;
assert(*i == 6);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int, min_allocator<int>> v1(3);
- std::list<int, min_allocator<int>> v2(3);
- v1.splice(v2.begin(), v2);
- assert(false);
- }
-#endif
#endif
}
diff --git a/test/std/containers/sequences/list/list.ops/splice_pos_list_iter.pass.cpp b/test/std/containers/sequences/list/list.ops/splice_pos_list_iter.pass.cpp
index 5082c3f85175..427624a1cc3e 100644
--- a/test/std/containers/sequences/list/list.ops/splice_pos_list_iter.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/splice_pos_list_iter.pass.cpp
@@ -11,13 +11,10 @@
// void splice(const_iterator position, list<T,Allocator>& x, iterator i);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <list>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -180,15 +177,7 @@ int main()
++i;
assert(*i == 2);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int> v1(3);
- std::list<int> v2(3);
- v1.splice(v1.begin(), v2, v1.begin());
- assert(false);
- }
-#endif
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l1;
std::list<int, min_allocator<int>> l2(a2, a2+1);
@@ -345,13 +334,5 @@ int main()
++i;
assert(*i == 2);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int, min_allocator<int>> v1(3);
- std::list<int, min_allocator<int>> v2(3);
- v1.splice(v1.begin(), v2, v1.begin());
- assert(false);
- }
-#endif
#endif
}
diff --git a/test/std/containers/sequences/list/list.ops/splice_pos_list_iter_iter.pass.cpp b/test/std/containers/sequences/list/list.ops/splice_pos_list_iter_iter.pass.cpp
index fcc4acceec57..b7010636d20e 100644
--- a/test/std/containers/sequences/list/list.ops/splice_pos_list_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/splice_pos_list_iter_iter.pass.cpp
@@ -11,13 +11,10 @@
// void splice(const_iterator position, list& x, iterator first, iterator last);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <list>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -120,15 +117,7 @@ int main()
i = l2.begin();
assert(*i == 4);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int> v1(3);
- std::list<int> v2(3);
- v1.splice(v1.begin(), v2, v2.begin(), v1.end());
- assert(false);
- }
-#endif
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
l1.splice(l1.begin(), l1, next(l1.begin()), next(l1.begin()));
@@ -225,13 +214,5 @@ int main()
i = l2.begin();
assert(*i == 4);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::list<int, min_allocator<int>> v1(3);
- std::list<int, min_allocator<int>> v2(3);
- v1.splice(v1.begin(), v2, v2.begin(), v1.end());
- assert(false);
- }
-#endif
#endif
}
diff --git a/test/std/containers/sequences/list/list.ops/unique.pass.cpp b/test/std/containers/sequences/list/list.ops/unique.pass.cpp
index 48cad1ddd156..fa85b0eae77c 100644
--- a/test/std/containers/sequences/list/list.ops/unique.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/unique.pass.cpp
@@ -25,7 +25,7 @@ int main()
c.unique();
assert(c == std::list<int>(a2, a2+4));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {2, 1, 1, 4, 4, 4, 4, 3, 3};
int a2[] = {2, 1, 4, 3};
diff --git a/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp b/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp
index f8935b81f6a7..de6347d46f39 100644
--- a/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/unique_pred.pass.cpp
@@ -30,7 +30,7 @@ int main()
c.unique(g);
assert(c == std::list<int>(a2, a2+4));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {2, 1, 1, 4, 4, 4, 4, 3, 3};
int a2[] = {2, 1, 4, 3};
diff --git a/test/std/containers/sequences/list/list.special/db_swap_1.pass.cpp b/test/std/containers/sequences/list/list.special/db_swap_1.pass.cpp
deleted file mode 100644
index f7171795cd5f..000000000000
--- a/test/std/containers/sequences/list/list.special/db_swap_1.pass.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// template <class T, class Alloc>
-// void swap(list<T,Alloc>& x, list<T,Alloc>& y);
-
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
-#include <list>
-#include <cassert>
-
-#include <__debug>
-#include "min_allocator.h"
-
-int main()
-{
-#if _LIBCPP_DEBUG >= 1
- {
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- std::list<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- std::list<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- std::list<int>::iterator i1 = c1.begin();
- std::list<int>::iterator i2 = c2.begin();
- swap(c1, c2);
- c1.erase(i2);
- c2.erase(i1);
- std::list<int>::iterator j = i1;
- c1.erase(i1);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- std::list<int, min_allocator<int>> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- std::list<int, min_allocator<int>> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- std::list<int, min_allocator<int>>::iterator i1 = c1.begin();
- std::list<int, min_allocator<int>>::iterator i2 = c2.begin();
- swap(c1, c2);
- c1.erase(i2);
- c2.erase(i1);
- std::list<int, min_allocator<int>>::iterator j = i1;
- c1.erase(i1);
- assert(false);
- }
-#endif
-#endif
-}
diff --git a/test/std/containers/sequences/list/list.special/swap.pass.cpp b/test/std/containers/sequences/list/list.special/swap.pass.cpp
index bc5f4857edc7..54b262572ded 100644
--- a/test/std/containers/sequences/list/list.special/swap.pass.cpp
+++ b/test/std/containers/sequences/list/list.special/swap.pass.cpp
@@ -59,21 +59,18 @@ int main()
assert(c2.empty());
assert(distance(c2.begin(), c2.end()) == 0);
}
-#ifndef _LIBCPP_DEBUG_LEVEL
-// This test known to result in undefined behavior detected by _LIBCPP_DEBUG_LEVEL >= 1
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
typedef test_allocator<int> A;
std::list<int, A> c1(a1, a1+sizeof(a1)/sizeof(a1[0]), A(1));
- std::list<int, A> c2(a2, a2+sizeof(a2)/sizeof(a2[0]), A(2));
+ std::list<int, A> c2(a2, a2+sizeof(a2)/sizeof(a2[0]), A(1));
swap(c1, c2);
assert((c1 == std::list<int, A>(a2, a2+sizeof(a2)/sizeof(a2[0]))));
assert(c1.get_allocator() == A(1));
assert((c2 == std::list<int, A>(a1, a1+sizeof(a1)/sizeof(a1[0]))));
- assert(c2.get_allocator() == A(2));
+ assert(c2.get_allocator() == A(1));
}
-#endif
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
@@ -86,7 +83,7 @@ int main()
assert((c2 == std::list<int, A>(a1, a1+sizeof(a1)/sizeof(a1[0]))));
assert(c2.get_allocator() == A(1));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
@@ -127,8 +124,6 @@ int main()
assert(c2.empty());
assert(distance(c2.begin(), c2.end()) == 0);
}
-#ifndef _LIBCPP_DEBUG_LEVEL
-// This test known to result in undefined behavior detected by _LIBCPP_DEBUG_LEVEL >= 1
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
@@ -142,5 +137,4 @@ int main()
assert(c2.get_allocator() == A());
}
#endif
-#endif
}
diff --git a/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp b/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
index 9c83ad58fed4..820da4c78f81 100644
--- a/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// void swap(list& c)
@@ -21,6 +23,7 @@
#include <list>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -28,7 +31,7 @@ template <class T>
struct some_alloc
{
typedef T value_type;
-
+
some_alloc() {}
some_alloc(const some_alloc&);
void deallocate(void*, unsigned) {}
@@ -40,7 +43,7 @@ template <class T>
struct some_alloc2
{
typedef T value_type;
-
+
some_alloc2() {}
some_alloc2(const some_alloc2&);
void deallocate(void*, unsigned) {}
@@ -51,7 +54,6 @@ struct some_alloc2
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::list<MoveOnly> C;
C c1, c2;
@@ -86,5 +88,4 @@ int main()
}
#endif
-#endif
}
diff --git a/test/std/containers/sequences/list/types.pass.cpp b/test/std/containers/sequences/list/types.pass.cpp
index 77303601ae97..7d5f5b6fa2f0 100644
--- a/test/std/containers/sequences/list/types.pass.cpp
+++ b/test/std/containers/sequences/list/types.pass.cpp
@@ -31,18 +31,39 @@ struct A { std::list<A> v; }; // incomplete type support
int main()
{
- static_assert((std::is_same<std::list<int>::value_type, int>::value), "");
- static_assert((std::is_same<std::list<int>::allocator_type, std::allocator<int> >::value), "");
- static_assert((std::is_same<std::list<int>::reference, std::allocator<int>::reference>::value), "");
- static_assert((std::is_same<std::list<int>::const_reference, std::allocator<int>::const_reference>::value), "");
- static_assert((std::is_same<std::list<int>::pointer, std::allocator<int>::pointer>::value), "");
- static_assert((std::is_same<std::list<int>::const_pointer, std::allocator<int>::const_pointer>::value), "");
-#if __cplusplus >= 201103L
- static_assert((std::is_same<std::list<int, min_allocator<int>>::value_type, int>::value), "");
- static_assert((std::is_same<std::list<int, min_allocator<int>>::allocator_type, min_allocator<int> >::value), "");
- static_assert((std::is_same<std::list<int, min_allocator<int>>::reference, int&>::value), "");
- static_assert((std::is_same<std::list<int, min_allocator<int>>::const_reference, const int&>::value), "");
- static_assert((std::is_same<std::list<int, min_allocator<int>>::pointer, min_pointer<int>>::value), "");
- static_assert((std::is_same<std::list<int, min_allocator<int>>::const_pointer, min_pointer<const int>>::value), "");
+ {
+ typedef std::list<int> C;
+ static_assert((std::is_same<C::value_type, int>::value), "");
+ static_assert((std::is_same<C::allocator_type, std::allocator<int> >::value), "");
+ static_assert((std::is_same<C::reference, std::allocator<int>::reference>::value), "");
+ static_assert((std::is_same<C::const_reference, std::allocator<int>::const_reference>::value), "");
+ static_assert((std::is_same<C::pointer, std::allocator<int>::pointer>::value), "");
+ static_assert((std::is_same<C::const_pointer, std::allocator<int>::const_pointer>::value), "");
+
+ static_assert((std::is_signed<typename C::difference_type>::value), "");
+ static_assert((std::is_unsigned<typename C::size_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::iterator>::difference_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::const_iterator>::difference_type>::value), "");
+ }
+
+#if TEST_STD_VER >= 11
+ {
+ typedef std::list<int, min_allocator<int>> C;
+ static_assert((std::is_same<C::value_type, int>::value), "");
+ static_assert((std::is_same<C::allocator_type, min_allocator<int> >::value), "");
+ static_assert((std::is_same<C::reference, int&>::value), "");
+ static_assert((std::is_same<C::const_reference, const int&>::value), "");
+ static_assert((std::is_same<C::pointer, min_pointer<int>>::value), "");
+ static_assert((std::is_same<C::const_pointer, min_pointer<const int>>::value), "");
+
+ static_assert((std::is_signed<typename C::difference_type>::value), "");
+ static_assert((std::is_unsigned<typename C::size_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::iterator>::difference_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::const_iterator>::difference_type>::value), "");
+ }
#endif
}
diff --git a/test/std/containers/sequences/list/version.pass.cpp b/test/std/containers/sequences/list/version.pass.cpp
deleted file mode 100644
index 097c013f52cb..000000000000
--- a/test/std/containers/sequences/list/version.pass.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-#include <list>
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main()
-{
-}
diff --git a/test/std/containers/sequences/vector.bool/assign_copy.pass.cpp b/test/std/containers/sequences/vector.bool/assign_copy.pass.cpp
index 9501799ae3d0..54b7e84bb092 100644
--- a/test/std/containers/sequences/vector.bool/assign_copy.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/assign_copy.pass.cpp
@@ -19,22 +19,22 @@
int main()
{
{
- std::vector<bool, test_allocator<bool> > l(3, 2, test_allocator<bool>(5));
+ std::vector<bool, test_allocator<bool> > l(3, true, test_allocator<bool>(5));
std::vector<bool, test_allocator<bool> > l2(l, test_allocator<bool>(3));
l2 = l;
assert(l2 == l);
assert(l2.get_allocator() == test_allocator<bool>(3));
}
{
- std::vector<bool, other_allocator<bool> > l(3, 2, other_allocator<bool>(5));
+ std::vector<bool, other_allocator<bool> > l(3, true, other_allocator<bool>(5));
std::vector<bool, other_allocator<bool> > l2(l, other_allocator<bool>(3));
l2 = l;
assert(l2 == l);
assert(l2.get_allocator() == other_allocator<bool>(5));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
- std::vector<bool, min_allocator<bool> > l(3, 2, min_allocator<bool>());
+ std::vector<bool, min_allocator<bool> > l(3, true, min_allocator<bool>());
std::vector<bool, min_allocator<bool> > l2(l, min_allocator<bool>());
l2 = l;
assert(l2 == l);
diff --git a/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp
index 2925fbc66745..ac7a2ce38adf 100644
--- a/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp
@@ -28,7 +28,7 @@ int main()
assert(d[2] == false);
assert(d[3] == true);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> d;
d.assign({true, false, false, true});
diff --git a/test/std/containers/sequences/vector.bool/assign_move.pass.cpp b/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
index df98c817fd59..f07c1d90059d 100644
--- a/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
@@ -61,7 +61,7 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});
std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{});
diff --git a/test/std/containers/sequences/vector.bool/capacity.pass.cpp b/test/std/containers/sequences/vector.bool/capacity.pass.cpp
index 63bff25f9f9a..3cbb09fe4ef0 100644
--- a/test/std/containers/sequences/vector.bool/capacity.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/capacity.pass.cpp
@@ -29,7 +29,7 @@ int main()
v.push_back(0);
assert(v.capacity() >= 101);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> v;
assert(v.capacity() == 0);
diff --git a/test/std/containers/sequences/vector.bool/construct_default.pass.cpp b/test/std/containers/sequences/vector.bool/construct_default.pass.cpp
index 07824098fc6f..983d363d1940 100644
--- a/test/std/containers/sequences/vector.bool/construct_default.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/construct_default.pass.cpp
@@ -29,12 +29,12 @@ test0()
static_assert((noexcept(C()) == noexcept(typename C::allocator_type())), "" );
#endif
C c;
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.empty());
assert(c.get_allocator() == typename C::allocator_type());
#if TEST_STD_VER >= 11
C c1 = {};
- assert(c1.__invariants());
+ LIBCPP_ASSERT(c1.__invariants());
assert(c1.empty());
assert(c1.get_allocator() == typename C::allocator_type());
#endif
@@ -50,7 +50,7 @@ test1(const typename C::allocator_type& a)
static_assert((noexcept(C(typename C::allocator_type())) == std::is_nothrow_copy_constructible<typename C::allocator_type>::value), "" );
#endif
C c(a);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.empty());
assert(c.get_allocator() == a);
}
diff --git a/test/std/containers/sequences/vector.bool/construct_iter_iter.pass.cpp b/test/std/containers/sequences/vector.bool/construct_iter_iter.pass.cpp
index 94e6801825d8..3d11239702c9 100644
--- a/test/std/containers/sequences/vector.bool/construct_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/construct_iter_iter.pass.cpp
@@ -15,6 +15,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "min_allocator.h"
@@ -23,7 +24,7 @@ void
test(Iterator first, Iterator last)
{
C c(first, last);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == std::distance(first, last));
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i, ++first)
assert(*i == *first);
@@ -38,7 +39,7 @@ int main()
test<std::vector<bool> >(bidirectional_iterator<const bool*>(a), bidirectional_iterator<const bool*>(an));
test<std::vector<bool> >(random_access_iterator<const bool*>(a), random_access_iterator<const bool*>(an));
test<std::vector<bool> >(a, an);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test<std::vector<bool, min_allocator<bool>> >(input_iterator<const bool*>(a), input_iterator<const bool*>(an));
test<std::vector<bool, min_allocator<bool>> >(forward_iterator<const bool*>(a), forward_iterator<const bool*>(an));
test<std::vector<bool, min_allocator<bool>> >(bidirectional_iterator<const bool*>(a), bidirectional_iterator<const bool*>(an));
diff --git a/test/std/containers/sequences/vector.bool/construct_iter_iter_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/construct_iter_iter_alloc.pass.cpp
index ea9d41d342f8..196694d73998 100644
--- a/test/std/containers/sequences/vector.bool/construct_iter_iter_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/construct_iter_iter_alloc.pass.cpp
@@ -16,6 +16,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "min_allocator.h"
@@ -24,7 +25,7 @@ void
test(Iterator first, Iterator last, const typename C::allocator_type& a)
{
C c(first, last, a);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == std::distance(first, last));
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i, ++first)
assert(*i == *first);
@@ -42,7 +43,7 @@ int main()
test<std::vector<bool> >(random_access_iterator<const bool*>(a), random_access_iterator<const bool*>(an), alloc);
test<std::vector<bool> >(a, an, alloc);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
min_allocator<bool> alloc;
test<std::vector<bool, min_allocator<bool>> >(input_iterator<const bool*>(a), input_iterator<const bool*>(an), alloc);
diff --git a/test/std/containers/sequences/vector.bool/construct_size.pass.cpp b/test/std/containers/sequences/vector.bool/construct_size.pass.cpp
index 93ecbe87c380..271e4ee33aa4 100644
--- a/test/std/containers/sequences/vector.bool/construct_size.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/construct_size.pass.cpp
@@ -15,22 +15,22 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "test_allocator.h"
template <class C>
void
-test2(typename C::size_type n, typename C::allocator_type const& a = typename C::allocator_type ())
+test2(typename C::size_type n,
+ typename C::allocator_type const& a = typename C::allocator_type ())
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
C c(n, a);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == n);
assert(c.get_allocator() == a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
assert(*i == typename C::value_type());
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#endif
}
@@ -39,7 +39,7 @@ void
test1(typename C::size_type n)
{
C c(n);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == n);
assert(c.get_allocator() == typename C::allocator_type());
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
@@ -57,7 +57,7 @@ test(typename C::size_type n)
int main()
{
test<std::vector<bool> >(50);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test<std::vector<bool, min_allocator<bool>> >(50);
test2<std::vector<bool, test_allocator<bool>> >( 100, test_allocator<bool>(23));
#endif
diff --git a/test/std/containers/sequences/vector.bool/construct_size_value.pass.cpp b/test/std/containers/sequences/vector.bool/construct_size_value.pass.cpp
index fc772f10dfc4..c66fd4972899 100644
--- a/test/std/containers/sequences/vector.bool/construct_size_value.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/construct_size_value.pass.cpp
@@ -15,6 +15,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -22,7 +23,7 @@ void
test(typename C::size_type n, const typename C::value_type& x)
{
C c(n, x);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == n);
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
assert(*i == x);
@@ -30,8 +31,8 @@ test(typename C::size_type n, const typename C::value_type& x)
int main()
{
- test<std::vector<bool> >(50, 3);
-#if __cplusplus >= 201103L
- test<std::vector<bool, min_allocator<bool>> >(50, 3);
+ test<std::vector<bool> >(50, true);
+#if TEST_STD_VER >= 11
+ test<std::vector<bool, min_allocator<bool>> >(50, true);
#endif
}
diff --git a/test/std/containers/sequences/vector.bool/construct_size_value_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/construct_size_value_alloc.pass.cpp
index 6cca948ed834..2ef501271f52 100644
--- a/test/std/containers/sequences/vector.bool/construct_size_value_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/construct_size_value_alloc.pass.cpp
@@ -15,6 +15,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -23,7 +24,7 @@ test(typename C::size_type n, const typename C::value_type& x,
const typename C::allocator_type& a)
{
C c(n, x, a);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(a == c.get_allocator());
assert(c.size() == n);
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
@@ -32,8 +33,8 @@ test(typename C::size_type n, const typename C::value_type& x,
int main()
{
- test<std::vector<bool> >(50, 3, std::allocator<bool>());
-#if __cplusplus >= 201103L
- test<std::vector<bool, min_allocator<bool>> >(50, 3, min_allocator<bool>());
+ test<std::vector<bool> >(50, true, std::allocator<bool>());
+#if TEST_STD_VER >= 11
+ test<std::vector<bool, min_allocator<bool>> >(50, true, min_allocator<bool>());
#endif
}
diff --git a/test/std/containers/sequences/vector.bool/copy.pass.cpp b/test/std/containers/sequences/vector.bool/copy.pass.cpp
index 58822782ff8b..b3cf9b551f96 100644
--- a/test/std/containers/sequences/vector.bool/copy.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/copy.pass.cpp
@@ -14,6 +14,8 @@
#include <vector>
#include <cassert>
+
+#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
@@ -23,7 +25,7 @@ test(const C& x)
{
unsigned s = x.size();
C c(x);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == s);
assert(c == x);
}
@@ -36,27 +38,25 @@ int main()
test(std::vector<bool>(a, an));
}
{
- std::vector<bool, test_allocator<bool> > v(3, 2, test_allocator<bool>(5));
+ std::vector<bool, test_allocator<bool> > v(3, true, test_allocator<bool>(5));
std::vector<bool, test_allocator<bool> > v2 = v;
assert(v2 == v);
assert(v2.get_allocator() == v.get_allocator());
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
- std::vector<bool, other_allocator<bool> > v(3, 2, other_allocator<bool>(5));
+ std::vector<bool, other_allocator<bool> > v(3, true, other_allocator<bool>(5));
std::vector<bool, other_allocator<bool> > v2 = v;
assert(v2 == v);
assert(v2.get_allocator() == other_allocator<bool>(-2));
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if __cplusplus >= 201103L
{
bool a[] = {0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0};
bool* an = a + sizeof(a)/sizeof(a[0]);
test(std::vector<bool, min_allocator<bool>>(a, an));
}
{
- std::vector<bool, min_allocator<bool> > v(3, 2, min_allocator<bool>());
+ std::vector<bool, min_allocator<bool> > v(3, true, min_allocator<bool>());
std::vector<bool, min_allocator<bool> > v2 = v;
assert(v2 == v);
assert(v2.get_allocator() == v.get_allocator());
diff --git a/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp
index 2f0192b995ad..aa8646a9b819 100644
--- a/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp
@@ -13,6 +13,8 @@
#include <vector>
#include <cassert>
+
+#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
@@ -22,7 +24,7 @@ test(const C& x, const typename C::allocator_type& a)
{
unsigned s = x.size();
C c(x, a);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == s);
assert(c == x);
}
@@ -30,30 +32,30 @@ test(const C& x, const typename C::allocator_type& a)
int main()
{
{
- int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
- int* an = a + sizeof(a)/sizeof(a[0]);
+ bool a[] = {0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0};
+ bool* an = a + sizeof(a)/sizeof(a[0]);
test(std::vector<bool>(a, an), std::allocator<bool>());
}
{
- std::vector<bool, test_allocator<bool> > l(3, 2, test_allocator<bool>(5));
+ std::vector<bool, test_allocator<bool> > l(3, true, test_allocator<bool>(5));
std::vector<bool, test_allocator<bool> > l2(l, test_allocator<bool>(3));
assert(l2 == l);
assert(l2.get_allocator() == test_allocator<bool>(3));
}
{
- std::vector<bool, other_allocator<bool> > l(3, 2, other_allocator<bool>(5));
+ std::vector<bool, other_allocator<bool> > l(3, true, other_allocator<bool>(5));
std::vector<bool, other_allocator<bool> > l2(l, other_allocator<bool>(3));
assert(l2 == l);
assert(l2.get_allocator() == other_allocator<bool>(3));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
- int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
- int* an = a + sizeof(a)/sizeof(a[0]);
+ bool a[] = {0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0};
+ bool* an = a + sizeof(a)/sizeof(a[0]);
test(std::vector<bool, min_allocator<bool>>(a, an), min_allocator<bool>());
}
{
- std::vector<bool, min_allocator<bool> > l(3, 2, min_allocator<bool>());
+ std::vector<bool, min_allocator<bool> > l(3, true, min_allocator<bool>());
std::vector<bool, min_allocator<bool> > l2(l, min_allocator<bool>());
assert(l2 == l);
assert(l2.get_allocator() == min_allocator<bool>());
diff --git a/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
index b94588ead93b..4f860dabac95 100644
--- a/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
@@ -14,9 +14,12 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
template <class T>
@@ -28,14 +31,13 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::vector<bool> C;
- static_assert(std::is_nothrow_default_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::vector<bool, test_allocator<bool>> C;
- static_assert(std::is_nothrow_default_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::vector<bool, other_allocator<bool>> C;
@@ -45,5 +47,4 @@ int main()
typedef std::vector<bool, some_alloc<bool>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
index 682e74ef03c2..bd2534ad3de7 100644
--- a/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
@@ -11,13 +11,13 @@
// ~vector<bool>() // implied noexcept;
+// UNSUPPORTED: c++98, c++03
+
#include <vector>
#include <cassert>
#include "test_allocator.h"
-#if __has_feature(cxx_noexcept)
-
template <class T>
struct some_alloc
{
@@ -26,11 +26,8 @@ struct some_alloc
~some_alloc() noexcept(false);
};
-#endif
-
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::vector<bool> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
@@ -47,5 +44,4 @@ int main()
typedef std::vector<bool, some_alloc<bool>> C;
static_assert(!std::is_nothrow_destructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/vector.bool/emplace.pass.cpp b/test/std/containers/sequences/vector.bool/emplace.pass.cpp
index f3fd1e9926f0..ccdce913c73c 100644
--- a/test/std/containers/sequences/vector.bool/emplace.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/emplace.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11
// <vector>
// vector<bool>
@@ -18,11 +19,10 @@
int main()
{
-#if _LIBCPP_STD_VER > 11
{
typedef std::vector<bool> C;
C c;
-
+
C::iterator i = c.emplace(c.cbegin());
assert(i == c.begin());
assert(c.size() == 1);
@@ -64,5 +64,4 @@ int main()
assert(c[1] == true);
assert(c.back() == true);
}
-#endif
}
diff --git a/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp b/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
index 57aa47822f8a..2950ee3882f1 100644
--- a/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11
// <vector>
// vector.bool
@@ -19,7 +20,6 @@
int main()
{
-#if _LIBCPP_STD_VER > 11
{
typedef std::vector<bool> C;
C c;
@@ -39,7 +39,7 @@ int main()
{
typedef std::vector<bool, min_allocator<bool>> C;
C c;
-
+
c.emplace_back();
assert(c.size() == 1);
assert(c.front() == false);
@@ -53,5 +53,4 @@ int main()
assert(c[1] == true);
assert(c.back() == true);
}
-#endif
}
diff --git a/test/std/containers/sequences/vector.bool/erase_iter.pass.cpp b/test/std/containers/sequences/vector.bool/erase_iter.pass.cpp
index cbf26dd570a5..04e3dd7c25f1 100644
--- a/test/std/containers/sequences/vector.bool/erase_iter.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/erase_iter.pass.cpp
@@ -40,7 +40,7 @@ int main()
assert(l1.size() == 0);
assert(distance(l1.begin(), l1.end()) == 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> l1(a1, a1+3);
std::vector<bool, min_allocator<bool>>::const_iterator i = l1.begin();
diff --git a/test/std/containers/sequences/vector.bool/erase_iter_iter.pass.cpp b/test/std/containers/sequences/vector.bool/erase_iter_iter.pass.cpp
index 2c2c4cc48616..2b9f0e31c2fa 100644
--- a/test/std/containers/sequences/vector.bool/erase_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/erase_iter_iter.pass.cpp
@@ -50,7 +50,7 @@ int main()
assert(distance(l1.cbegin(), l1.cend()) == 0);
assert(i == l1.begin());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> l1(a1, a1+3);
std::vector<bool, min_allocator<bool>>::iterator i = l1.erase(l1.cbegin(), l1.cbegin());
diff --git a/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp
index b9b468654497..07bae0eb7089 100644
--- a/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp
@@ -27,7 +27,7 @@ int main()
assert(d[2] == false);
assert(d[3] == true);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> d = {true, false, false, true};
assert(d.size() == 4);
diff --git a/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp
index aea3ad763cde..5f7f5144f841 100644
--- a/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp
@@ -29,7 +29,7 @@ int main()
assert(d[2] == false);
assert(d[3] == true);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> d({true, false, false, true}, min_allocator<bool>());
assert(d.get_allocator() == min_allocator<bool>());
diff --git a/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp
index c081cc81c592..3a176d94e860 100644
--- a/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp
@@ -39,7 +39,7 @@ int main()
assert(d[12] == true);
assert(d[13] == true);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> d(10, true);
std::vector<bool, min_allocator<bool>>::iterator i = d.insert(d.cbegin() + 2, {false, true, true, false});
diff --git a/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp b/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
index e51f8b589c7f..89fe7a76d409 100644
--- a/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
@@ -89,7 +89,7 @@ int main()
for (; j < v.size(); ++j)
assert(v[j] == 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> v(100);
bool a[] = {1, 0, 0, 1, 1};
diff --git a/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp b/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
index 710ad4885f09..35c57cbd8e42 100644
--- a/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
@@ -63,7 +63,7 @@ int main()
for (++j; j < v.size(); ++j)
assert(v[j] == 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> v(100);
std::vector<bool, min_allocator<bool>>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
diff --git a/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp b/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
index 51c4626de0d0..78ffe7ba73cd 100644
--- a/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
@@ -60,7 +60,7 @@ int main()
for (++j; j < v.size(); ++j)
assert(v[j] == 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> v(100);
std::vector<bool, min_allocator<bool>>::iterator i = v.insert(v.cbegin() + 10, 1);
diff --git a/test/std/containers/sequences/vector.bool/iterators.pass.cpp b/test/std/containers/sequences/vector.bool/iterators.pass.cpp
index c54fa4a80a95..882ac9be4a5d 100644
--- a/test/std/containers/sequences/vector.bool/iterators.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/iterators.pass.cpp
@@ -58,7 +58,7 @@ int main()
C::iterator i;
C::const_iterator j;
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef bool T;
typedef std::vector<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/vector.bool/move.pass.cpp b/test/std/containers/sequences/vector.bool/move.pass.cpp
index e877292ced77..f3a11ec562c0 100644
--- a/test/std/containers/sequences/vector.bool/move.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/move.pass.cpp
@@ -45,7 +45,7 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});
std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{});
diff --git a/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp
index deee93261971..7aaa7c55550b 100644
--- a/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp
@@ -58,7 +58,7 @@ int main()
assert(!l.empty());
assert(l2.get_allocator() == other_allocator<bool>(4));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});
std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{});
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 4dd871c9447e..fe53fbfc17e0 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
@@ -16,6 +16,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <vector>
#include <cassert>
@@ -32,7 +34,7 @@ template <class T>
struct some_alloc2
{
typedef T value_type;
-
+
some_alloc2() {}
some_alloc2(const some_alloc2&);
void deallocate(void*, unsigned) {}
@@ -45,7 +47,7 @@ template <class T>
struct some_alloc3
{
typedef T value_type;
-
+
some_alloc3() {}
some_alloc3(const some_alloc3&);
void deallocate(void*, unsigned) {}
@@ -56,7 +58,6 @@ struct some_alloc3
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::vector<bool> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
@@ -87,6 +88,4 @@ int main()
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
#endif
-
-#endif
}
diff --git a/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
index 132186b555f2..2153c7956bfc 100644
--- a/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
@@ -14,6 +14,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <vector>
#include <cassert>
@@ -28,7 +30,6 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::vector<bool> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
@@ -50,5 +51,4 @@ int main()
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
#endif
}
-#endif
}
diff --git a/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp
index ef3dc5d10796..4b959cf00ad3 100644
--- a/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp
@@ -28,7 +28,7 @@ int main()
assert(d[2] == false);
assert(d[3] == true);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> d;
d = {true, false, false, true};
diff --git a/test/std/containers/sequences/vector.bool/push_back.pass.cpp b/test/std/containers/sequences/vector.bool/push_back.pass.cpp
index c6b0fbf41853..3897a438b445 100644
--- a/test/std/containers/sequences/vector.bool/push_back.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/push_back.pass.cpp
@@ -31,7 +31,7 @@ int main()
assert(c[j] == a[j]);
}
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
bool a[] = {0, 1, 1, 0, 1, 0, 0};
const unsigned N = sizeof(a)/sizeof(a[0]);
diff --git a/test/std/containers/sequences/vector.bool/reference.swap.pass.cpp b/test/std/containers/sequences/vector.bool/reference.swap.pass.cpp
new file mode 100644
index 000000000000..06351e418ac4
--- /dev/null
+++ b/test/std/containers/sequences/vector.bool/reference.swap.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.
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+// vector<bool>
+
+// static void swap(reference x, reference y) noexcept;
+
+#include <vector>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main()
+{
+
+ bool a[] = {false, true, false, true};
+ bool* an = a + sizeof(a)/sizeof(a[0]);
+
+ std::vector<bool> v(a, an);
+ std::vector<bool>::reference r1 = v[0];
+ std::vector<bool>::reference r2 = v[3];
+
+#if TEST_STD_VER >= 11
+ static_assert((noexcept(v.swap(r1,r2))), "");
+#endif
+
+ assert(!r1);
+ assert( r2);
+ v.swap(r1, r2);
+ assert( r1);
+ assert(!r2);
+}
diff --git a/test/std/containers/sequences/vector.bool/reserve.pass.cpp b/test/std/containers/sequences/vector.bool/reserve.pass.cpp
index be717a3be8a8..489ca95ee789 100644
--- a/test/std/containers/sequences/vector.bool/reserve.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/reserve.pass.cpp
@@ -34,7 +34,7 @@ int main()
assert(v.size() == 100);
assert(v.capacity() >= 150);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> v;
v.reserve(10);
diff --git a/test/std/containers/sequences/vector.bool/resize_size.pass.cpp b/test/std/containers/sequences/vector.bool/resize_size.pass.cpp
index f75720c94ea3..bc51e0bbba27 100644
--- a/test/std/containers/sequences/vector.bool/resize_size.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/resize_size.pass.cpp
@@ -32,7 +32,7 @@ int main()
assert(v.size() == 300);
assert(v.capacity() >= 400);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> v(100);
v.resize(50);
diff --git a/test/std/containers/sequences/vector.bool/resize_size_value.pass.cpp b/test/std/containers/sequences/vector.bool/resize_size_value.pass.cpp
index 8cecf44d2fb0..919000732698 100644
--- a/test/std/containers/sequences/vector.bool/resize_size_value.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/resize_size_value.pass.cpp
@@ -33,7 +33,7 @@ int main()
for (unsigned i = 50; i < 200; ++i)
assert(v[i] == 1);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> v(100);
v.resize(50, 1);
diff --git a/test/std/containers/sequences/vector.bool/shrink_to_fit.pass.cpp b/test/std/containers/sequences/vector.bool/shrink_to_fit.pass.cpp
index 1f9fcac3d9bf..03997cbec71e 100644
--- a/test/std/containers/sequences/vector.bool/shrink_to_fit.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/shrink_to_fit.pass.cpp
@@ -26,7 +26,7 @@ int main()
assert(v.capacity() >= 101);
assert(v.size() >= 101);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> v(100);
v.push_back(1);
diff --git a/test/std/containers/sequences/vector.bool/swap.pass.cpp b/test/std/containers/sequences/vector.bool/swap.pass.cpp
index a92c6a6c165f..81af528f2a9a 100644
--- a/test/std/containers/sequences/vector.bool/swap.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/swap.pass.cpp
@@ -62,7 +62,7 @@ int main()
assert(v[0] == false);
assert(v[1] == true);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> v1(100);
std::vector<bool, min_allocator<bool>> v2(200);
diff --git a/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
index 6f36473fa989..7ba44453b371 100644
--- a/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// void swap(vector& c)
@@ -22,13 +24,14 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
template <class T>
struct some_alloc
{
typedef T value_type;
-
+
some_alloc() {}
some_alloc(const some_alloc&);
void deallocate(void*, unsigned) {}
@@ -40,7 +43,7 @@ template <class T>
struct some_alloc2
{
typedef T value_type;
-
+
some_alloc2() {}
some_alloc2(const some_alloc2&);
void deallocate(void*, unsigned) {}
@@ -51,7 +54,6 @@ struct some_alloc2
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::vector<bool> C;
C c1, c2;
@@ -85,6 +87,4 @@ int main()
static_assert( noexcept(swap(c1, c2)), "");
}
#endif
-
-#endif
}
diff --git a/test/std/containers/sequences/vector.bool/types.pass.cpp b/test/std/containers/sequences/vector.bool/types.pass.cpp
index b266b3bbb927..4e8edc8891bd 100644
--- a/test/std/containers/sequences/vector.bool/types.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/types.pass.cpp
@@ -46,7 +46,15 @@ test()
static_assert((std::is_same<typename C::allocator_type, Allocator>::value), "");
static_assert((std::is_same<typename C::size_type, typename std::allocator_traits<Allocator>::size_type>::value), "");
static_assert((std::is_same<typename C::difference_type, typename std::allocator_traits<Allocator>::difference_type>::value), "");
- static_assert((std::is_same<
+
+ static_assert((std::is_signed<typename C::difference_type>::value), "");
+ static_assert((std::is_unsigned<typename C::size_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::iterator>::difference_type>::value), "");
+ static_assert((std::is_same<typename C::difference_type,
+ typename std::iterator_traits<typename C::const_iterator>::difference_type>::value), "");
+
+ static_assert((std::is_same<
typename std::iterator_traits<typename C::iterator>::iterator_category,
std::random_access_iterator_tag>::value), "");
static_assert((std::is_same<
@@ -66,7 +74,7 @@ int main()
test<std::allocator<bool> >();
static_assert((std::is_same<std::vector<bool>::allocator_type,
std::allocator<bool> >::value), "");
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test<min_allocator<bool> >();
#endif
}
diff --git a/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp b/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
index a78f4fd590be..4f82792fa1fd 100644
--- a/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
@@ -31,18 +31,18 @@ int main()
typedef std::hash<T> H;
static_assert((std::is_same<H::argument_type, T>::value), "" );
static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
-
+
bool ba[] = {true, false, true, true, false};
T vb(std::begin(ba), std::end(ba));
H h;
assert(h(vb) != 0);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef std::vector<bool, min_allocator<bool>> T;
typedef std::hash<T> H;
- static_assert((std::is_base_of<std::unary_function<T, std::size_t>,
- H>::value), "");
+ static_assert((std::is_same<H::argument_type, T>::value), "" );
+ static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
bool ba[] = {true, false, true, true, false};
T vb(std::begin(ba), std::end(ba));
H h;
diff --git a/test/std/containers/sequences/vector/const_value_type.pass.cpp b/test/std/containers/sequences/vector/const_value_type.pass.cpp
deleted file mode 100644
index e16e439dec4d..000000000000
--- a/test/std/containers/sequences/vector/const_value_type.pass.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// vector<const int> v; // an extension
-
-#include <vector>
-#include <type_traits>
-
-int main()
-{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- std::vector<const int> v = {1, 2, 3};
-#endif
-}
diff --git a/test/std/containers/sequences/vector/contiguous.pass.cpp b/test/std/containers/sequences/vector/contiguous.pass.cpp
index 32f380778335..70084246eae9 100644
--- a/test/std/containers/sequences/vector/contiguous.pass.cpp
+++ b/test/std/containers/sequences/vector/contiguous.pass.cpp
@@ -40,7 +40,7 @@ int main()
test_contiguous(C(A(3)));
test_contiguous(C(7, 9.0, A(5)));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef double T;
typedef min_allocator<T> A;
diff --git a/test/std/containers/sequences/vector/db_back.pass.cpp b/test/std/containers/sequences/vector/db_back.pass.cpp
deleted file mode 100644
index 05f3d07712eb..000000000000
--- a/test/std/containers/sequences/vector/db_back.pass.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call back() on empty container.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- C c(1);
- assert(c.back() == 0);
- c.clear();
- assert(c.back() == 0);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- C c(1);
- assert(c.back() == 0);
- c.clear();
- assert(c.back() == 0);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/db_cback.pass.cpp b/test/std/containers/sequences/vector/db_cback.pass.cpp
deleted file mode 100644
index 5eb1a353e8b0..000000000000
--- a/test/std/containers/sequences/vector/db_cback.pass.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call back() on empty const container.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- const C c;
- assert(c.back() == 0);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- const C c;
- assert(c.back() == 0);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/db_cfront.pass.cpp b/test/std/containers/sequences/vector/db_cfront.pass.cpp
deleted file mode 100644
index 5e54da1d444e..000000000000
--- a/test/std/containers/sequences/vector/db_cfront.pass.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call front() on empty const container.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- const C c;
- assert(c.front() == 0);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- const C c;
- assert(c.front() == 0);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/db_cindex.pass.cpp b/test/std/containers/sequences/vector/db_cindex.pass.cpp
deleted file mode 100644
index 133aa5652824..000000000000
--- a/test/std/containers/sequences/vector/db_cindex.pass.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Index const vector out of bounds.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- const C c(1);
- assert(c[0] == 0);
- assert(c[1] == 0);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- const C c(1);
- assert(c[0] == 0);
- assert(c[1] == 0);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/db_front.pass.cpp b/test/std/containers/sequences/vector/db_front.pass.cpp
deleted file mode 100644
index 388058fb3159..000000000000
--- a/test/std/containers/sequences/vector/db_front.pass.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call front() on empty container.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- C c(1);
- assert(c.front() == 0);
- c.clear();
- assert(c.front() == 0);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- C c(1);
- assert(c.front() == 0);
- c.clear();
- assert(c.front() == 0);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/db_index.pass.cpp b/test/std/containers/sequences/vector/db_index.pass.cpp
deleted file mode 100644
index 1daf076da67c..000000000000
--- a/test/std/containers/sequences/vector/db_index.pass.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Index vector out of bounds.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- C c(1);
- assert(c[0] == 0);
- c.clear();
- assert(c[0] == 0);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- C c(1);
- assert(c[0] == 0);
- c.clear();
- assert(c[0] == 0);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/db_iterators_2.pass.cpp b/test/std/containers/sequences/vector/db_iterators_2.pass.cpp
deleted file mode 100644
index 2d43843067b7..000000000000
--- a/test/std/containers/sequences/vector/db_iterators_2.pass.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Compare iterators from different containers with <.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- C c1;
- C c2;
- bool b = c1.begin() < c2.begin();
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- C c1;
- C c2;
- bool b = c1.begin() < c2.begin();
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/db_iterators_3.pass.cpp b/test/std/containers/sequences/vector/db_iterators_3.pass.cpp
deleted file mode 100644
index 051d66c33394..000000000000
--- a/test/std/containers/sequences/vector/db_iterators_3.pass.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Subtract iterators from different containers.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- C c1;
- C c2;
- int i = c1.begin() - c2.begin();
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- C c1;
- C c2;
- int i = c1.begin() - c2.begin();
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/db_iterators_4.pass.cpp b/test/std/containers/sequences/vector/db_iterators_4.pass.cpp
deleted file mode 100644
index 4c2aa628de14..000000000000
--- a/test/std/containers/sequences/vector/db_iterators_4.pass.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Index iterator out of bounds.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- C c(1);
- C::iterator i = c.begin();
- assert(i[0] == 0);
- assert(i[1] == 0);
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- C c(1);
- C::iterator i = c.begin();
- assert(i[0] == 0);
- assert(i[1] == 0);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/db_iterators_5.pass.cpp b/test/std/containers/sequences/vector/db_iterators_5.pass.cpp
deleted file mode 100644
index 1b1090499c27..000000000000
--- a/test/std/containers/sequences/vector/db_iterators_5.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.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Add to iterator out of bounds.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- C c(1);
- C::iterator i = c.begin();
- i += 1;
- assert(i == c.end());
- i = c.begin();
- i += 2;
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- C c(1);
- C::iterator i = c.begin();
- i += 1;
- assert(i == c.end());
- i = c.begin();
- i += 2;
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/db_iterators_6.pass.cpp b/test/std/containers/sequences/vector/db_iterators_6.pass.cpp
deleted file mode 100644
index 424bc939b136..000000000000
--- a/test/std/containers/sequences/vector/db_iterators_6.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.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Decrement iterator prior to begin.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- C c(1);
- C::iterator i = c.end();
- --i;
- assert(i == c.begin());
- --i;
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- C c(1);
- C::iterator i = c.end();
- --i;
- assert(i == c.begin());
- --i;
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/db_iterators_7.pass.cpp b/test/std/containers/sequences/vector/db_iterators_7.pass.cpp
deleted file mode 100644
index 72cdb10cbc85..000000000000
--- a/test/std/containers/sequences/vector/db_iterators_7.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.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Increment iterator past end.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- C c(1);
- C::iterator i = c.begin();
- ++i;
- assert(i == c.end());
- ++i;
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- C c(1);
- C::iterator i = c.begin();
- ++i;
- assert(i == c.end());
- ++i;
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/db_iterators_8.pass.cpp b/test/std/containers/sequences/vector/db_iterators_8.pass.cpp
deleted file mode 100644
index 7b898533197c..000000000000
--- a/test/std/containers/sequences/vector/db_iterators_8.pass.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Dereference non-dereferenceable iterator.
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- typedef int T;
- typedef std::vector<T> C;
- C c(1);
- C::iterator i = c.end();
- T j = *i;
- assert(false);
- }
-#if __cplusplus >= 201103L
- {
- typedef int T;
- typedef std::vector<T, min_allocator<T>> C;
- C c(1);
- C::iterator i = c.end();
- T j = *i;
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/iterators.pass.cpp b/test/std/containers/sequences/vector/iterators.pass.cpp
index 75a08287a863..8dc14977f282 100644
--- a/test/std/containers/sequences/vector/iterators.pass.cpp
+++ b/test/std/containers/sequences/vector/iterators.pass.cpp
@@ -77,7 +77,7 @@ int main()
C::iterator i;
C::const_iterator j;
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::vector<T, min_allocator<T>> C;
diff --git a/test/std/containers/sequences/vector/types.pass.cpp b/test/std/containers/sequences/vector/types.pass.cpp
index 0fbc7e38b1a2..2080ac09fc5a 100644
--- a/test/std/containers/sequences/vector/types.pass.cpp
+++ b/test/std/containers/sequences/vector/types.pass.cpp
@@ -45,6 +45,9 @@ test()
{
typedef std::vector<T, Allocator> C;
+// TODO: These tests should use allocator_traits to get stuff, rather than
+// blindly pulling typedefs out of the allocator. This is why we can't call
+// test<int, min_allocator<int>>() below.
static_assert((std::is_same<typename C::value_type, T>::value), "");
static_assert((std::is_same<typename C::value_type, typename Allocator::value_type>::value), "");
static_assert((std::is_same<typename C::allocator_type, Allocator>::value), "");
@@ -54,6 +57,14 @@ test()
static_assert((std::is_same<typename C::const_reference, typename Allocator::const_reference>::value), "");
static_assert((std::is_same<typename C::pointer, typename Allocator::pointer>::value), "");
static_assert((std::is_same<typename C::const_pointer, typename Allocator::const_pointer>::value), "");
+
+ static_assert((std::is_signed<typename C::difference_type>::value), "");
+ static_assert((std::is_unsigned<typename C::size_type>::value), "");
+// static_assert((std::is_same<typename C::difference_type,
+// typename std::iterator_traits<typename C::iterator>::difference_type>::value), "");
+// static_assert((std::is_same<typename C::difference_type,
+// typename std::iterator_traits<typename C::const_iterator>::difference_type>::value), "");
+
static_assert((std::is_same<
typename std::iterator_traits<typename C::iterator>::iterator_category,
std::random_access_iterator_tag>::value), "");
@@ -75,12 +86,23 @@ int main()
test<Copyable, test_allocator<Copyable> >();
static_assert((std::is_same<std::vector<char>::allocator_type,
std::allocator<char> >::value), "");
-#if __cplusplus >= 201103L
- static_assert((std::is_same<std::vector<int, min_allocator<int>>::value_type, int>::value), "");
- static_assert((std::is_same<std::vector<int, min_allocator<int>>::allocator_type, min_allocator<int> >::value), "");
- static_assert((std::is_same<std::vector<int, min_allocator<int>>::reference, int&>::value), "");
- static_assert((std::is_same<std::vector<int, min_allocator<int>>::const_reference, const int&>::value), "");
- static_assert((std::is_same<std::vector<int, min_allocator<int>>::pointer, min_pointer<int>>::value), "");
- static_assert((std::is_same<std::vector<int, min_allocator<int>>::const_pointer, min_pointer<const int>>::value), "");
+#if TEST_STD_VER >= 11
+ {
+
+ typedef std::vector<int, min_allocator<int> > C;
+ static_assert((std::is_same<C::value_type, int>::value), "");
+ static_assert((std::is_same<C::allocator_type, min_allocator<int> >::value), "");
+ static_assert((std::is_same<C::reference, int&>::value), "");
+ static_assert((std::is_same<C::const_reference, const int&>::value), "");
+ static_assert((std::is_same<C::pointer, min_pointer<int>>::value), "");
+ static_assert((std::is_same<C::const_pointer, min_pointer<const int>>::value), "");
+
+ static_assert((std::is_signed<typename C::difference_type>::value), "");
+ static_assert((std::is_unsigned<typename C::size_type>::value), "");
+// static_assert((std::is_same<typename C::difference_type,
+// typename std::iterator_traits<typename C::iterator>::difference_type>::value), "");
+// static_assert((std::is_same<typename C::difference_type,
+// typename std::iterator_traits<typename C::const_iterator>::difference_type>::value), "");
+ }
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.capacity/capacity.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/capacity.pass.cpp
index 21082c839f56..a87b84061030 100644
--- a/test/std/containers/sequences/vector/vector.capacity/capacity.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.capacity/capacity.pass.cpp
@@ -22,27 +22,27 @@ int main()
{
std::vector<int> v;
assert(v.capacity() == 0);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
std::vector<int> v(100);
assert(v.capacity() == 100);
v.push_back(0);
assert(v.capacity() > 101);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v;
assert(v.capacity() == 0);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
std::vector<int, min_allocator<int>> v(100);
assert(v.capacity() == 100);
v.push_back(0);
assert(v.capacity() > 101);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
index 4df5702f2ad2..d04e43db508d 100644
--- a/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
@@ -23,7 +23,7 @@ int main()
std::vector<int> v;
v.reserve(10);
assert(v.capacity() >= 10);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
std::vector<int> v(100);
@@ -34,7 +34,7 @@ int main()
v.reserve(150);
assert(v.size() == 100);
assert(v.capacity() == 150);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
std::vector<int, stack_allocator<int, 250> > v(100);
@@ -45,14 +45,14 @@ int main()
v.reserve(150);
assert(v.size() == 100);
assert(v.capacity() == 150);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v;
v.reserve(10);
assert(v.capacity() >= 10);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
std::vector<int, min_allocator<int>> v(100);
@@ -63,7 +63,7 @@ int main()
v.reserve(150);
assert(v.size() == 100);
assert(v.capacity() == 150);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
index c7988d62060a..ce74cf9b7c23 100644
--- a/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
@@ -26,22 +26,22 @@ int main()
v.resize(50);
assert(v.size() == 50);
assert(v.capacity() == 100);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v.resize(200);
assert(v.size() == 200);
assert(v.capacity() >= 200);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
std::vector<MoveOnly, stack_allocator<MoveOnly, 300> > v(100);
v.resize(50);
assert(v.size() == 50);
assert(v.capacity() == 100);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v.resize(200);
assert(v.size() == 200);
assert(v.capacity() >= 200);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
@@ -49,35 +49,35 @@ int main()
v.resize(50);
assert(v.size() == 50);
assert(v.capacity() == 100);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v.resize(200);
assert(v.size() == 200);
assert(v.capacity() >= 200);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
std::vector<int, stack_allocator<int, 300> > v(100);
v.resize(50);
assert(v.size() == 50);
assert(v.capacity() == 100);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v.resize(200);
assert(v.size() == 200);
assert(v.capacity() >= 200);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<MoveOnly, min_allocator<MoveOnly>> v(100);
v.resize(50);
assert(v.size() == 50);
assert(v.capacity() == 100);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v.resize(200);
assert(v.size() == 200);
assert(v.capacity() >= 200);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp
index de5126b03d10..3e7df312731f 100644
--- a/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp
@@ -28,7 +28,7 @@ int main()
v.resize(200, 1);
assert(v.size() == 200);
assert(v.capacity() >= 200);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
for (unsigned i = 0; i < 50; ++i)
assert(v[i] == 0);
for (unsigned i = 50; i < 200; ++i)
@@ -42,20 +42,20 @@ int main()
v.resize(200, 1);
assert(v.size() == 200);
assert(v.capacity() >= 200);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v(100);
v.resize(50, 1);
assert(v.size() == 50);
assert(v.capacity() == 100);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert((v == std::vector<int, min_allocator<int>>(50)));
v.resize(200, 1);
assert(v.size() == 200);
assert(v.capacity() >= 200);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
for (unsigned i = 0; i < 50; ++i)
assert(v[i] == 0);
for (unsigned i = 50; i < 200; ++i)
@@ -66,11 +66,11 @@ int main()
v.resize(50, 1);
assert(v.size() == 50);
assert(v.capacity() == 100);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v.resize(200, 1);
assert(v.size() == 200);
assert(v.capacity() >= 200);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
index 49ab9cc71deb..10ce33f43bd2 100644
--- a/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
@@ -22,41 +22,41 @@ int main()
{
std::vector<int> v(100);
v.push_back(1);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v.shrink_to_fit();
assert(v.capacity() == 101);
assert(v.size() == 101);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
std::vector<int, stack_allocator<int, 401> > v(100);
v.push_back(1);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v.shrink_to_fit();
assert(v.capacity() == 101);
assert(v.size() == 101);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
#ifndef _LIBCPP_NO_EXCEPTIONS
{
std::vector<int, stack_allocator<int, 400> > v(100);
v.push_back(1);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v.shrink_to_fit();
- assert(v.capacity() == 200);
+ LIBCPP_ASSERT(v.capacity() == 200); // assumes libc++'s 2x growth factor
assert(v.size() == 101);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
#endif
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v(100);
v.push_back(1);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v.shrink_to_fit();
assert(v.capacity() == 101);
assert(v.size() == 101);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.capacity/swap.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/swap.pass.cpp
index f3d9289c36eb..59529a6dfd36 100644
--- a/test/std/containers/sequences/vector/vector.capacity/swap.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.capacity/swap.pass.cpp
@@ -22,29 +22,29 @@ int main()
{
std::vector<int> v1(100);
std::vector<int> v2(200);
- assert(is_contiguous_container_asan_correct(v1));
- assert(is_contiguous_container_asan_correct(v2));
+ assert(is_contiguous_container_asan_correct(v1));
+ assert(is_contiguous_container_asan_correct(v2));
v1.swap(v2);
assert(v1.size() == 200);
assert(v1.capacity() == 200);
- assert(is_contiguous_container_asan_correct(v1));
+ assert(is_contiguous_container_asan_correct(v1));
assert(v2.size() == 100);
assert(v2.capacity() == 100);
- assert(is_contiguous_container_asan_correct(v2));
+ assert(is_contiguous_container_asan_correct(v2));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v1(100);
std::vector<int, min_allocator<int>> v2(200);
- assert(is_contiguous_container_asan_correct(v1));
- assert(is_contiguous_container_asan_correct(v2));
+ assert(is_contiguous_container_asan_correct(v1));
+ assert(is_contiguous_container_asan_correct(v2));
v1.swap(v2);
assert(v1.size() == 200);
assert(v1.capacity() == 200);
- assert(is_contiguous_container_asan_correct(v1));
+ assert(is_contiguous_container_asan_correct(v1));
assert(v2.size() == 100);
assert(v2.capacity() == 100);
- assert(is_contiguous_container_asan_correct(v2));
+ assert(is_contiguous_container_asan_correct(v2));
}
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.cons/assign_copy.pass.cpp b/test/std/containers/sequences/vector/vector.cons/assign_copy.pass.cpp
index 6f02c3b7bc2b..d15d24dd969f 100644
--- a/test/std/containers/sequences/vector/vector.cons/assign_copy.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/assign_copy.pass.cpp
@@ -32,7 +32,7 @@ int main()
assert(l2 == l);
assert(l2.get_allocator() == other_allocator<int>(5));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int> > l(3, 2, min_allocator<int>());
std::vector<int, min_allocator<int> > l2(l, min_allocator<int>());
diff --git a/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp
index 3cb0b3b095f0..222fa9c78f92 100644
--- a/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp
@@ -23,7 +23,7 @@ void test ( Vec &v )
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
v.assign({3, 4, 5, 6});
assert(v.size() == 4);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(v[0] == 3);
assert(v[1] == 4);
assert(v[2] == 5);
@@ -42,7 +42,7 @@ int main()
test(d2);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef std::vector<int, min_allocator<int>> V;
V d1;
diff --git a/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp b/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
index 8c8b0a04715b..acbee97bcd1c 100644
--- a/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
@@ -29,72 +29,72 @@ int main()
l.push_back(i);
lo.push_back(i);
}
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
std::vector<MoveOnly, test_allocator<MoveOnly> > l2(test_allocator<MoveOnly>(5));
l2 = std::move(l);
assert(l2 == lo);
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
- assert(is_contiguous_container_asan_correct(l2));
+ assert(is_contiguous_container_asan_correct(l2));
}
{
std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
for (int i = 1; i <= 3; ++i)
{
l.push_back(i);
lo.push_back(i);
}
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
std::vector<MoveOnly, test_allocator<MoveOnly> > l2(test_allocator<MoveOnly>(6));
l2 = std::move(l);
assert(l2 == lo);
assert(!l.empty());
assert(l2.get_allocator() == test_allocator<MoveOnly>(6));
- assert(is_contiguous_container_asan_correct(l2));
+ assert(is_contiguous_container_asan_correct(l2));
}
{
std::vector<MoveOnly, other_allocator<MoveOnly> > l(other_allocator<MoveOnly>(5));
std::vector<MoveOnly, other_allocator<MoveOnly> > lo(other_allocator<MoveOnly>(5));
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
for (int i = 1; i <= 3; ++i)
{
l.push_back(i);
lo.push_back(i);
}
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
std::vector<MoveOnly, other_allocator<MoveOnly> > l2(other_allocator<MoveOnly>(6));
l2 = std::move(l);
assert(l2 == lo);
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
- assert(is_contiguous_container_asan_correct(l2));
+ assert(is_contiguous_container_asan_correct(l2));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
for (int i = 1; i <= 3; ++i)
{
l.push_back(i);
lo.push_back(i);
}
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
std::vector<MoveOnly, min_allocator<MoveOnly> > l2(min_allocator<MoveOnly>{});
l2 = std::move(l);
assert(l2 == lo);
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
- assert(is_contiguous_container_asan_correct(l2));
+ assert(is_contiguous_container_asan_correct(l2));
}
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/test/std/containers/sequences/vector/vector.cons/assign_size_value.pass.cpp b/test/std/containers/sequences/vector/vector.cons/assign_size_value.pass.cpp
index e1b30bf11304..8e5d2766c775 100644
--- a/test/std/containers/sequences/vector/vector.cons/assign_size_value.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/assign_size_value.pass.cpp
@@ -26,7 +26,7 @@ void test ( Vec &v )
{
v.assign(5, 6);
assert(v.size() == 5);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(std::all_of(v.begin(), v.end(), is6));
}
@@ -41,7 +41,7 @@ int main()
test(d2);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
typedef std::vector<int, min_allocator<int>> V;
V d1;
diff --git a/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp
index 5e87c07ef70a..e0542e751f44 100644
--- a/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp
@@ -32,16 +32,16 @@ test0()
static_assert((noexcept(C()) == noexcept(typename C::allocator_type())), "" );
#endif
C c;
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.empty());
assert(c.get_allocator() == typename C::allocator_type());
- assert(is_contiguous_container_asan_correct(c));
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
#if TEST_STD_VER >= 11
C c1 = {};
- assert(c1.__invariants());
+ LIBCPP_ASSERT(c1.__invariants());
assert(c1.empty());
assert(c1.get_allocator() == typename C::allocator_type());
- assert(is_contiguous_container_asan_correct(c1));
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c1));
#endif
}
@@ -55,10 +55,10 @@ test1(const typename C::allocator_type& a)
static_assert((noexcept(C(typename C::allocator_type())) == std::is_nothrow_copy_constructible<typename C::allocator_type>::value), "" );
#endif
C c(a);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.empty());
assert(c.get_allocator() == a);
- assert(is_contiguous_container_asan_correct(c));
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
}
int main()
diff --git a/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
index 36e231acce12..5542e91059d6 100644
--- a/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
@@ -14,6 +14,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../stack_allocator.h"
#include "min_allocator.h"
@@ -24,9 +25,9 @@ void
test(Iterator first, Iterator last)
{
C c(first, last);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == std::distance(first, last));
- assert(is_contiguous_container_asan_correct(c));
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i, ++first)
assert(*i == *first);
}
@@ -46,7 +47,7 @@ int main()
test<std::vector<int, stack_allocator<int, 18> > >(bidirectional_iterator<const int*>(a), bidirectional_iterator<const int*>(an));
test<std::vector<int, stack_allocator<int, 18> > >(random_access_iterator<const int*>(a), random_access_iterator<const int*>(an));
test<std::vector<int, stack_allocator<int, 18> > >(a, an);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test<std::vector<int, min_allocator<int>> >(input_iterator<const int*>(a), input_iterator<const int*>(an));
test<std::vector<int, min_allocator<int>> >(forward_iterator<const int*>(a), forward_iterator<const int*>(an));
test<std::vector<int, min_allocator<int>> >(bidirectional_iterator<const int*>(a), bidirectional_iterator<const int*>(an));
diff --git a/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
index 7fa748a90d71..f40088ea3e86 100644
--- a/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
@@ -15,6 +15,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../stack_allocator.h"
#include "min_allocator.h"
@@ -25,19 +26,19 @@ void
test(Iterator first, Iterator last, const A& a)
{
C c(first, last, a);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == std::distance(first, last));
- assert(is_contiguous_container_asan_correct(c));
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i, ++first)
assert(*i == *first);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
template <class T>
struct implicit_conv_allocator : min_allocator<T>
{
- implicit_conv_allocator(void* p) {}
+ implicit_conv_allocator(void*) {}
implicit_conv_allocator(const implicit_conv_allocator&) = default;
};
@@ -55,7 +56,7 @@ int main()
test<std::vector<int> >(random_access_iterator<const int*>(a), random_access_iterator<const int*>(an), alloc);
test<std::vector<int> >(a, an, alloc);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
int* an = a + sizeof(a)/sizeof(a[0]);
diff --git a/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
index e03389593f16..46e5ecdc9a56 100644
--- a/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
@@ -14,6 +14,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "DefaultOnly.h"
#include "min_allocator.h"
#include "test_allocator.h"
@@ -23,16 +24,14 @@ template <class C>
void
test2(typename C::size_type n, typename C::allocator_type const& a = typename C::allocator_type ())
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
C c(n, a);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == n);
assert(c.get_allocator() == a);
- assert(is_contiguous_container_asan_correct(c));
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
assert(*i == typename C::value_type());
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#endif
}
@@ -41,14 +40,14 @@ void
test1(typename C::size_type n)
{
C c(n);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == n);
assert(c.get_allocator() == typename C::allocator_type());
- assert(is_contiguous_container_asan_correct(c));
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
+#if TEST_STD_VER >= 11
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
assert(*i == typename C::value_type());
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
template <class C>
@@ -64,7 +63,7 @@ int main()
test<std::vector<int> >(50);
test<std::vector<DefaultOnly> >(500);
assert(DefaultOnly::count == 0);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test<std::vector<int, min_allocator<int>> >(50);
test<std::vector<DefaultOnly, min_allocator<DefaultOnly>> >(500);
test2<std::vector<DefaultOnly, test_allocator<DefaultOnly>> >( 100, test_allocator<DefaultOnly>(23));
diff --git a/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp
index 5b6c49857044..d3774d1a6595 100644
--- a/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp
@@ -14,6 +14,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "../../../stack_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -23,9 +24,9 @@ void
test(typename C::size_type n, const typename C::value_type& x)
{
C c(n, x);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == n);
- assert(is_contiguous_container_asan_correct(c));
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
assert(*i == x);
}
@@ -34,7 +35,7 @@ int main()
{
test<std::vector<int> >(50, 3);
test<std::vector<int, stack_allocator<int, 50> > >(50, 5);
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test<std::vector<int, min_allocator<int>> >(50, 3);
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.cons/construct_size_value_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_size_value_alloc.pass.cpp
index c62b84104aba..4713aa157062 100644
--- a/test/std/containers/sequences/vector/vector.cons/construct_size_value_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/construct_size_value_alloc.pass.cpp
@@ -13,6 +13,8 @@
#include <vector>
#include <cassert>
+
+#include "test_macros.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -22,10 +24,10 @@ test(typename C::size_type n, const typename C::value_type& x,
const typename C::allocator_type& a)
{
C c(n, x, a);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(a == c.get_allocator());
assert(c.size() == n);
- assert(is_contiguous_container_asan_correct(c));
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
assert(*i == x);
}
@@ -33,7 +35,7 @@ test(typename C::size_type n, const typename C::value_type& x,
int main()
{
test<std::vector<int> >(50, 3, std::allocator<int>());
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
test<std::vector<int, min_allocator<int>> >(50, 3, min_allocator<int>());
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp b/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
index 677963deeb84..105217bbf15c 100644
--- a/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
@@ -13,6 +13,8 @@
#include <vector>
#include <cassert>
+
+#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -23,10 +25,10 @@ test(const C& x)
{
unsigned s = x.size();
C c(x);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == s);
assert(c == x);
- assert(is_contiguous_container_asan_correct(c));
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
}
int main()
@@ -39,26 +41,24 @@ int main()
{
std::vector<int, test_allocator<int> > v(3, 2, test_allocator<int>(5));
std::vector<int, test_allocator<int> > v2 = v;
- assert(is_contiguous_container_asan_correct(v));
- assert(is_contiguous_container_asan_correct(v2));
+ assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v2));
assert(v2 == v);
assert(v2.get_allocator() == v.get_allocator());
- assert(is_contiguous_container_asan_correct(v));
- assert(is_contiguous_container_asan_correct(v2));
+ assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v2));
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
std::vector<int, other_allocator<int> > v(3, 2, other_allocator<int>(5));
std::vector<int, other_allocator<int> > v2 = v;
- assert(is_contiguous_container_asan_correct(v));
- assert(is_contiguous_container_asan_correct(v2));
+ assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v2));
assert(v2 == v);
assert(v2.get_allocator() == other_allocator<int>(-2));
- assert(is_contiguous_container_asan_correct(v));
- assert(is_contiguous_container_asan_correct(v2));
+ assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v2));
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if __cplusplus >= 201103L
{
int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
int* an = a + sizeof(a)/sizeof(a[0]);
@@ -67,12 +67,12 @@ int main()
{
std::vector<int, min_allocator<int> > v(3, 2, min_allocator<int>());
std::vector<int, min_allocator<int> > v2 = v;
- assert(is_contiguous_container_asan_correct(v));
- assert(is_contiguous_container_asan_correct(v2));
+ assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v2));
assert(v2 == v);
assert(v2.get_allocator() == v.get_allocator());
- assert(is_contiguous_container_asan_correct(v));
- assert(is_contiguous_container_asan_correct(v2));
+ assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v2));
}
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
index 128328c2a7d2..47259c747332 100644
--- a/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
@@ -13,6 +13,8 @@
#include <vector>
#include <cassert>
+
+#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -23,10 +25,10 @@ test(const C& x, const typename C::allocator_type& a)
{
unsigned s = x.size();
C c(x, a);
- assert(c.__invariants());
+ LIBCPP_ASSERT(c.__invariants());
assert(c.size() == s);
assert(c == x);
- assert(is_contiguous_container_asan_correct(c));
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
}
int main()
@@ -48,7 +50,7 @@ int main()
assert(l2 == l);
assert(l2.get_allocator() == other_allocator<int>(3));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
int* an = a + sizeof(a)/sizeof(a[0]);
diff --git a/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp b/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
index 60f7b72c9477..b244f75f21d4 100644
--- a/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/default_noexcept.pass.cpp
@@ -14,6 +14,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <vector>
#include <cassert>
@@ -30,7 +32,6 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::vector<MoveOnly> C;
static_assert(std::is_nothrow_default_constructible<C>::value, "");
@@ -47,5 +48,4 @@ int main()
typedef std::vector<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
index 0e2cae9ee935..bd538120442d 100644
--- a/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
@@ -11,14 +11,14 @@
// ~vector() // implied noexcept;
+// UNSUPPORTED: c++98, c++03
+
#include <vector>
#include <cassert>
#include "MoveOnly.h"
#include "test_allocator.h"
-#if __has_feature(cxx_noexcept)
-
template <class T>
struct some_alloc
{
@@ -27,11 +27,8 @@ struct some_alloc
~some_alloc() noexcept(false);
};
-#endif
-
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::vector<MoveOnly> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
@@ -48,5 +45,4 @@ int main()
typedef std::vector<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_destructible<C>::value, "");
}
-#endif
}
diff --git a/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
index 7eb834ff3877..408bcc3b1499 100644
--- a/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
@@ -22,17 +22,17 @@ int main()
{
std::vector<int> d = {3, 4, 5, 6};
assert(d.size() == 4);
- assert(is_contiguous_container_asan_correct(d));
+ assert(is_contiguous_container_asan_correct(d));
assert(d[0] == 3);
assert(d[1] == 4);
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> d = {3, 4, 5, 6};
assert(d.size() == 4);
- assert(is_contiguous_container_asan_correct(d));
+ assert(is_contiguous_container_asan_correct(d));
assert(d[0] == 3);
assert(d[1] == 4);
assert(d[2] == 5);
diff --git a/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
index 5d7ae884e382..f4c3b5c1e8e0 100644
--- a/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
@@ -25,18 +25,18 @@ int main()
std::vector<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
assert(d.get_allocator() == test_allocator<int>(3));
assert(d.size() == 4);
- assert(is_contiguous_container_asan_correct(d));
+ assert(is_contiguous_container_asan_correct(d));
assert(d[0] == 3);
assert(d[1] == 4);
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
assert(d.get_allocator() == min_allocator<int>());
assert(d.size() == 4);
- assert(is_contiguous_container_asan_correct(d));
+ assert(is_contiguous_container_asan_correct(d));
assert(d[0] == 3);
assert(d[1] == 4);
assert(d[2] == 5);
diff --git a/test/std/containers/sequences/vector/vector.cons/move.pass.cpp b/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
index fb419d825d2b..d51b364f3ba0 100644
--- a/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
@@ -24,79 +24,79 @@ int main()
{
std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
for (int i = 1; i <= 3; ++i)
{
l.push_back(i);
lo.push_back(i);
}
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
std::vector<MoveOnly, test_allocator<MoveOnly> > l2 = std::move(l);
assert(l2 == lo);
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
- assert(is_contiguous_container_asan_correct(l2));
+ assert(is_contiguous_container_asan_correct(l2));
}
{
std::vector<MoveOnly, other_allocator<MoveOnly> > l(other_allocator<MoveOnly>(5));
std::vector<MoveOnly, other_allocator<MoveOnly> > lo(other_allocator<MoveOnly>(5));
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
for (int i = 1; i <= 3; ++i)
{
l.push_back(i);
lo.push_back(i);
}
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
std::vector<MoveOnly, other_allocator<MoveOnly> > l2 = std::move(l);
assert(l2 == lo);
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
- assert(is_contiguous_container_asan_correct(l2));
+ assert(is_contiguous_container_asan_correct(l2));
}
{
int a1[] = {1, 3, 7, 9, 10};
std::vector<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c1));
std::vector<int>::const_iterator i = c1.begin();
std::vector<int> c2 = std::move(c1);
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c2));
std::vector<int>::iterator j = c2.erase(i);
assert(*j == 3);
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c2));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
for (int i = 1; i <= 3; ++i)
{
l.push_back(i);
lo.push_back(i);
}
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
std::vector<MoveOnly, min_allocator<MoveOnly> > l2 = std::move(l);
assert(l2 == lo);
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
- assert(is_contiguous_container_asan_correct(l2));
+ assert(is_contiguous_container_asan_correct(l2));
}
{
int a1[] = {1, 3, 7, 9, 10};
std::vector<int, min_allocator<int>> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c1));
std::vector<int, min_allocator<int>>::const_iterator i = c1.begin();
std::vector<int, min_allocator<int>> c2 = std::move(c1);
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c2));
std::vector<int, min_allocator<int>>::iterator j = c2.erase(i);
assert(*j == 3);
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c2));
}
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
index aef96917cb32..fcdd35ae1157 100644
--- a/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
@@ -24,75 +24,75 @@ int main()
{
std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
for (int i = 1; i <= 3; ++i)
{
l.push_back(i);
lo.push_back(i);
}
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
std::vector<MoveOnly, test_allocator<MoveOnly> > l2(std::move(l), test_allocator<MoveOnly>(6));
assert(l2 == lo);
assert(!l.empty());
assert(l2.get_allocator() == test_allocator<MoveOnly>(6));
- assert(is_contiguous_container_asan_correct(l2));
+ assert(is_contiguous_container_asan_correct(l2));
}
{
std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
for (int i = 1; i <= 3; ++i)
{
l.push_back(i);
lo.push_back(i);
}
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
std::vector<MoveOnly, test_allocator<MoveOnly> > l2(std::move(l), test_allocator<MoveOnly>(5));
assert(l2 == lo);
assert(l.empty());
assert(l2.get_allocator() == test_allocator<MoveOnly>(5));
- assert(is_contiguous_container_asan_correct(l2));
+ assert(is_contiguous_container_asan_correct(l2));
}
{
std::vector<MoveOnly, other_allocator<MoveOnly> > l(other_allocator<MoveOnly>(5));
std::vector<MoveOnly, other_allocator<MoveOnly> > lo(other_allocator<MoveOnly>(5));
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
for (int i = 1; i <= 3; ++i)
{
l.push_back(i);
lo.push_back(i);
}
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
std::vector<MoveOnly, other_allocator<MoveOnly> > l2(std::move(l), other_allocator<MoveOnly>(4));
assert(l2 == lo);
assert(!l.empty());
assert(l2.get_allocator() == other_allocator<MoveOnly>(4));
- assert(is_contiguous_container_asan_correct(l2));
+ assert(is_contiguous_container_asan_correct(l2));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
for (int i = 1; i <= 3; ++i)
{
l.push_back(i);
lo.push_back(i);
}
- assert(is_contiguous_container_asan_correct(l));
- assert(is_contiguous_container_asan_correct(lo));
+ assert(is_contiguous_container_asan_correct(l));
+ assert(is_contiguous_container_asan_correct(lo));
std::vector<MoveOnly, min_allocator<MoveOnly> > l2(std::move(l), min_allocator<MoveOnly>());
assert(l2 == lo);
assert(l.empty());
assert(l2.get_allocator() == min_allocator<MoveOnly>());
- assert(is_contiguous_container_asan_correct(l2));
+ assert(is_contiguous_container_asan_correct(l2));
}
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
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 c09224497966..14ca7155b5a1 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
@@ -16,6 +16,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <vector>
#include <cassert>
@@ -33,7 +35,7 @@ template <class T>
struct some_alloc2
{
typedef T value_type;
-
+
some_alloc2() {}
some_alloc2(const some_alloc2&);
void deallocate(void*, unsigned) {}
@@ -46,7 +48,7 @@ template <class T>
struct some_alloc3
{
typedef T value_type;
-
+
some_alloc3() {}
some_alloc3(const some_alloc3&);
void deallocate(void*, unsigned) {}
@@ -58,7 +60,6 @@ struct some_alloc3
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::vector<MoveOnly> C;
static_assert(std::is_nothrow_move_assignable<C>::value, "");
@@ -91,6 +92,4 @@ int main()
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
#endif
-
-#endif
}
diff --git a/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp b/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp
index b7bbfaa421c4..a1e3a632f1f2 100644
--- a/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/move_noexcept.pass.cpp
@@ -14,6 +14,8 @@
// This tests a conforming extension
+// UNSUPPORTED: c++98, c++03
+
#include <vector>
#include <cassert>
@@ -29,7 +31,6 @@ struct some_alloc
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::vector<MoveOnly> C;
static_assert(std::is_nothrow_move_constructible<C>::value, "");
@@ -51,5 +52,4 @@ int main()
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
#endif
}
-#endif
}
diff --git a/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp
index 592b71462767..4e5a20413683 100644
--- a/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp
@@ -24,18 +24,18 @@ int main()
std::vector<int> d;
d = {3, 4, 5, 6};
assert(d.size() == 4);
- assert(is_contiguous_container_asan_correct(d));
+ assert(is_contiguous_container_asan_correct(d));
assert(d[0] == 3);
assert(d[1] == 4);
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> d;
d = {3, 4, 5, 6};
assert(d.size() == 4);
- assert(is_contiguous_container_asan_correct(d));
+ assert(is_contiguous_container_asan_correct(d));
assert(d[0] == 3);
assert(d[1] == 4);
assert(d[2] == 5);
diff --git a/test/std/containers/sequences/vector/vector.data/data.pass.cpp b/test/std/containers/sequences/vector/vector.data/data.pass.cpp
index aed56bc09310..f6c0575d958c 100644
--- a/test/std/containers/sequences/vector/vector.data/data.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.data/data.pass.cpp
@@ -17,28 +17,47 @@
#include "min_allocator.h"
#include "asan_testing.h"
+struct Nasty {
+ Nasty() : i_(0) {}
+ Nasty(int i) : i_(i) {}
+ ~Nasty() {}
+
+ Nasty * operator&() const { assert(false); return nullptr; }
+ int i_;
+ };
+
int main()
{
{
std::vector<int> v;
assert(v.data() == 0);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
std::vector<int> v(100);
- assert(v.data() == &v.front());
- assert(is_contiguous_container_asan_correct(v));
+ assert(v.data() == std::addressof(v.front()));
+ assert(is_contiguous_container_asan_correct(v));
+ }
+ {
+ std::vector<Nasty> v(100);
+ assert(v.data() == std::addressof(v.front()));
+ assert(is_contiguous_container_asan_correct(v));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v;
assert(v.data() == 0);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
std::vector<int, min_allocator<int>> v(100);
- assert(v.data() == &v.front());
- assert(is_contiguous_container_asan_correct(v));
+ assert(v.data() == std::addressof(v.front()));
+ assert(is_contiguous_container_asan_correct(v));
+ }
+ {
+ std::vector<Nasty, min_allocator<Nasty>> v(100);
+ assert(v.data() == std::addressof(v.front()));
+ assert(is_contiguous_container_asan_correct(v));
}
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp b/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp
index cb6062694e40..c97ad29708b8 100644
--- a/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp
@@ -17,28 +17,47 @@
#include "min_allocator.h"
#include "asan_testing.h"
+struct Nasty {
+ Nasty() : i_(0) {}
+ Nasty(int i) : i_(i) {}
+ ~Nasty() {}
+
+ Nasty * operator&() const { assert(false); return nullptr; }
+ int i_;
+ };
+
int main()
{
{
const std::vector<int> v;
assert(v.data() == 0);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
const std::vector<int> v(100);
- assert(v.data() == &v.front());
- assert(is_contiguous_container_asan_correct(v));
+ assert(v.data() == std::addressof(v.front()));
+ assert(is_contiguous_container_asan_correct(v));
+ }
+ {
+ std::vector<Nasty> v(100);
+ assert(v.data() == std::addressof(v.front()));
+ assert(is_contiguous_container_asan_correct(v));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
const std::vector<int, min_allocator<int>> v;
assert(v.data() == 0);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
const std::vector<int, min_allocator<int>> v(100);
assert(v.data() == &v.front());
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
+ }
+ {
+ std::vector<Nasty, min_allocator<Nasty>> v(100);
+ assert(v.data() == std::addressof(v.front()));
+ assert(is_contiguous_container_asan_correct(v));
}
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp
index 8af6bdacd0a8..8bcc23979668 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp
@@ -67,7 +67,7 @@ int main()
assert(c.size() == 1);
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
i = c.emplace(c.cend(), 3, 4.5);
assert(i == c.end()-1);
assert(c.size() == 2);
@@ -75,7 +75,7 @@ int main()
assert(c.front().getd() == 3.5);
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
i = c.emplace(c.cbegin()+1, 4, 6.5);
assert(i == c.begin()+1);
assert(c.size() == 3);
@@ -85,7 +85,7 @@ int main()
assert(c[1].getd() == 6.5);
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
}
{
std::vector<A, stack_allocator<A, 7> > c;
@@ -94,7 +94,7 @@ int main()
assert(c.size() == 1);
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
i = c.emplace(c.cend(), 3, 4.5);
assert(i == c.end()-1);
assert(c.size() == 2);
@@ -102,7 +102,7 @@ int main()
assert(c.front().getd() == 3.5);
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
i = c.emplace(c.cbegin()+1, 4, 6.5);
assert(i == c.begin()+1);
assert(c.size() == 3);
@@ -112,7 +112,7 @@ int main()
assert(c[1].getd() == 6.5);
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
}
#if _LIBCPP_DEBUG >= 1
{
@@ -122,7 +122,7 @@ int main()
assert(false);
}
#endif
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<A, min_allocator<A>> c;
std::vector<A, min_allocator<A>>::iterator i = c.emplace(c.cbegin(), 2, 3.5);
diff --git a/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
index bbf91a4255d7..61ccade76b02 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
@@ -15,6 +15,7 @@
#include <cassert>
#include "../../../stack_allocator.h"
#include "min_allocator.h"
+#include "test_allocator.h"
#include "asan_testing.h"
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -62,14 +63,14 @@ int main()
assert(c.size() == 1);
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
c.emplace_back(3, 4.5);
assert(c.size() == 2);
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
}
{
std::vector<A, stack_allocator<A, 4> > c;
@@ -77,30 +78,38 @@ int main()
assert(c.size() == 1);
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
c.emplace_back(3, 4.5);
assert(c.size() == 2);
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<A, min_allocator<A>> c;
c.emplace_back(2, 3.5);
assert(c.size() == 1);
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
c.emplace_back(3, 4.5);
assert(c.size() == 2);
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
+ }
+ {
+ std::vector<Tag_X, TaggingAllocator<Tag_X>> c;
+ c.emplace_back();
+ assert(c.size() == 1);
+ c.emplace_back(1, 2, 3);
+ assert(c.size() == 2);
+ assert(is_contiguous_container_asan_correct(c));
}
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
index 85a47073bcb2..7e4aed8c1b5e 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
@@ -23,39 +23,39 @@ int main()
{
std::vector<int> v;
v.reserve(3);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v = { 1, 2, 3 };
v.emplace(v.begin(), v.back());
assert(v[0] == 3);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
std::vector<int> v;
v.reserve(4);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v = { 1, 2, 3 };
v.emplace(v.begin(), v.back());
assert(v[0] == 3);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v;
v.reserve(3);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v = { 1, 2, 3 };
v.emplace(v.begin(), v.back());
assert(v[0] == 3);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
{
std::vector<int, min_allocator<int>> v;
v.reserve(4);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
v = { 1, 2, 3 };
v.emplace(v.begin(), v.back());
assert(v[0] == 3);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
}
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
index 4fa07b729a75..dbdccf13b72e 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
@@ -24,7 +24,7 @@ int main()
int a1[] = {1, 2, 3};
std::vector<int> l1(a1, a1+3);
std::vector<int>::const_iterator i = l1.begin();
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
++i;
std::vector<int>::iterator j = l1.erase(i);
assert(l1.size() == 2);
@@ -32,25 +32,25 @@ int main()
assert(*j == 3);
assert(*l1.begin() == 1);
assert(*next(l1.begin()) == 3);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
j = l1.erase(j);
assert(j == l1.end());
assert(l1.size() == 1);
assert(distance(l1.begin(), l1.end()) == 1);
assert(*l1.begin() == 1);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
j = l1.erase(l1.begin());
assert(j == l1.end());
assert(l1.size() == 0);
assert(distance(l1.begin(), l1.end()) == 0);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 2, 3};
std::vector<int, min_allocator<int>> l1(a1, a1+3);
std::vector<int, min_allocator<int>>::const_iterator i = l1.begin();
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
++i;
std::vector<int, min_allocator<int>>::iterator j = l1.erase(i);
assert(l1.size() == 2);
@@ -58,18 +58,18 @@ int main()
assert(*j == 3);
assert(*l1.begin() == 1);
assert(*next(l1.begin()) == 3);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
j = l1.erase(j);
assert(j == l1.end());
assert(l1.size() == 1);
assert(distance(l1.begin(), l1.end()) == 1);
assert(*l1.begin() == 1);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
j = l1.erase(l1.begin());
assert(j == l1.end());
assert(l1.size() == 0);
assert(distance(l1.begin(), l1.end()) == 0);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
}
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db1.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db1.pass.cpp
index 0478d24c79f6..b2c22d6ae696 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db1.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db1.pass.cpp
@@ -31,7 +31,7 @@ int main()
l1.erase(i);
assert(false);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 2, 3};
std::vector<int, min_allocator<int>> l1(a1, a1+3);
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db2.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db2.pass.cpp
index c394f197402b..da0b6d4a059b 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db2.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db2.pass.cpp
@@ -32,7 +32,7 @@ int main()
l1.erase(i);
assert(false);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 2, 3};
std::vector<int, min_allocator<int>> l1(a1, a1+3);
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp
index 2e81d133cde0..f7fa0dba27e8 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp
@@ -23,106 +23,106 @@ int main()
int a1[] = {1, 2, 3};
{
std::vector<int> l1(a1, a1+3);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
std::vector<int>::iterator i = l1.erase(l1.cbegin(), l1.cbegin());
assert(l1.size() == 3);
assert(distance(l1.cbegin(), l1.cend()) == 3);
assert(i == l1.begin());
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
}
{
std::vector<int> l1(a1, a1+3);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
std::vector<int>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin()));
assert(l1.size() == 2);
assert(distance(l1.cbegin(), l1.cend()) == 2);
assert(i == l1.begin());
assert(l1 == std::vector<int>(a1+1, a1+3));
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
}
{
std::vector<int> l1(a1, a1+3);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
std::vector<int>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 2));
assert(l1.size() == 1);
assert(distance(l1.cbegin(), l1.cend()) == 1);
assert(i == l1.begin());
assert(l1 == std::vector<int>(a1+2, a1+3));
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
}
{
std::vector<int> l1(a1, a1+3);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
std::vector<int>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 3));
assert(l1.size() == 0);
assert(distance(l1.cbegin(), l1.cend()) == 0);
assert(i == l1.begin());
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
}
{
std::vector<std::vector<int> > outer(2, std::vector<int>(1));
- assert(is_contiguous_container_asan_correct(outer));
- assert(is_contiguous_container_asan_correct(outer[0]));
- assert(is_contiguous_container_asan_correct(outer[1]));
+ assert(is_contiguous_container_asan_correct(outer));
+ assert(is_contiguous_container_asan_correct(outer[0]));
+ assert(is_contiguous_container_asan_correct(outer[1]));
outer.erase(outer.begin(), outer.begin());
assert(outer.size() == 2);
assert(outer[0].size() == 1);
assert(outer[1].size() == 1);
- assert(is_contiguous_container_asan_correct(outer));
- assert(is_contiguous_container_asan_correct(outer[0]));
- assert(is_contiguous_container_asan_correct(outer[1]));
+ assert(is_contiguous_container_asan_correct(outer));
+ assert(is_contiguous_container_asan_correct(outer[0]));
+ assert(is_contiguous_container_asan_correct(outer[1]));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> l1(a1, a1+3);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
std::vector<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), l1.cbegin());
assert(l1.size() == 3);
assert(distance(l1.cbegin(), l1.cend()) == 3);
assert(i == l1.begin());
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
}
{
std::vector<int, min_allocator<int>> l1(a1, a1+3);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
std::vector<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin()));
assert(l1.size() == 2);
assert(distance(l1.cbegin(), l1.cend()) == 2);
assert(i == l1.begin());
assert((l1 == std::vector<int, min_allocator<int>>(a1+1, a1+3)));
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
}
{
std::vector<int, min_allocator<int>> l1(a1, a1+3);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
std::vector<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 2));
assert(l1.size() == 1);
assert(distance(l1.cbegin(), l1.cend()) == 1);
assert(i == l1.begin());
assert((l1 == std::vector<int, min_allocator<int>>(a1+2, a1+3)));
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
}
{
std::vector<int, min_allocator<int>> l1(a1, a1+3);
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
std::vector<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 3));
assert(l1.size() == 0);
assert(distance(l1.cbegin(), l1.cend()) == 0);
assert(i == l1.begin());
- assert(is_contiguous_container_asan_correct(l1));
+ assert(is_contiguous_container_asan_correct(l1));
}
{
std::vector<std::vector<int, min_allocator<int>>, min_allocator<std::vector<int, min_allocator<int>>>> outer(2, std::vector<int, min_allocator<int>>(1));
- assert(is_contiguous_container_asan_correct(outer));
- assert(is_contiguous_container_asan_correct(outer[0]));
- assert(is_contiguous_container_asan_correct(outer[1]));
+ assert(is_contiguous_container_asan_correct(outer));
+ assert(is_contiguous_container_asan_correct(outer[0]));
+ assert(is_contiguous_container_asan_correct(outer[1]));
outer.erase(outer.begin(), outer.begin());
assert(outer.size() == 2);
assert(outer[0].size() == 1);
assert(outer[1].size() == 1);
- assert(is_contiguous_container_asan_correct(outer));
- assert(is_contiguous_container_asan_correct(outer[0]));
- assert(is_contiguous_container_asan_correct(outer[1]));
+ assert(is_contiguous_container_asan_correct(outer));
+ assert(is_contiguous_container_asan_correct(outer[0]));
+ assert(is_contiguous_container_asan_correct(outer[1]));
}
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db1.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db1.pass.cpp
index af6d0f757892..14d3ca803ca3 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db1.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db1.pass.cpp
@@ -31,7 +31,7 @@ int main()
std::vector<int>::iterator i = l1.erase(l2.cbegin(), l1.cbegin()+1);
assert(false);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 2, 3};
std::vector<int, min_allocator<int>> l1(a1, a1+3);
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db2.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db2.pass.cpp
index eee2c66c5c8c..04c040a8f797 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db2.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db2.pass.cpp
@@ -31,7 +31,7 @@ int main()
std::vector<int>::iterator i = l1.erase(l1.cbegin(), l2.cbegin()+1);
assert(false);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 2, 3};
std::vector<int, min_allocator<int>> l1(a1, a1+3);
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db3.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db3.pass.cpp
index 505067d05a1a..ba183a83f0b1 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db3.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db3.pass.cpp
@@ -31,7 +31,7 @@ int main()
std::vector<int>::iterator i = l1.erase(l2.cbegin(), l2.cbegin()+1);
assert(false);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 2, 3};
std::vector<int, min_allocator<int>> l1(a1, a1+3);
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db4.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db4.pass.cpp
index c7e4131cb49c..0fb8071fc679 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db4.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db4.pass.cpp
@@ -30,7 +30,7 @@ int main()
std::vector<int>::iterator i = l1.erase(l1.cbegin()+1, l1.cbegin());
assert(false);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 2, 3};
std::vector<int, min_allocator<int>> l1(a1, a1+3);
diff --git a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp
index 30b801788013..b0fe123aac48 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp
@@ -24,7 +24,7 @@ int main()
std::vector<int> d(10, 1);
std::vector<int>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6});
assert(d.size() == 14);
- assert(is_contiguous_container_asan_correct(d));
+ assert(is_contiguous_container_asan_correct(d));
assert(i == d.begin() + 2);
assert(d[0] == 1);
assert(d[1] == 1);
@@ -41,12 +41,12 @@ int main()
assert(d[12] == 1);
assert(d[13] == 1);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> d(10, 1);
std::vector<int, min_allocator<int>>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6});
assert(d.size() == 14);
- assert(is_contiguous_container_asan_correct(d));
+ assert(is_contiguous_container_asan_correct(d));
assert(i == d.begin() + 2);
assert(d[0] == 1);
assert(d[1] == 1);
diff --git a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
index 782437be87f8..b8953021187f 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
@@ -32,7 +32,7 @@ int main()
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, input_iterator<const int*>(a),
input_iterator<const int*>(a+N));
assert(v.size() == 100 + N);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -49,7 +49,7 @@ int main()
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const int*>(a),
forward_iterator<const int*>(a+N));
assert(v.size() == 100 + N);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -102,7 +102,7 @@ int main()
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, input_iterator<const int*>(a),
input_iterator<const int*>(a+N));
assert(v.size() == 100 + N);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -119,7 +119,7 @@ int main()
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const int*>(a),
forward_iterator<const int*>(a+N));
assert(v.size() == 100 + N);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -140,7 +140,7 @@ int main()
assert(false);
}
#endif
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v(100);
int a[] = {1, 2, 3, 4, 5};
@@ -148,7 +148,7 @@ int main()
std::vector<int, min_allocator<int>>::iterator i = v.insert(v.cbegin() + 10, input_iterator<const int*>(a),
input_iterator<const int*>(a+N));
assert(v.size() == 100 + N);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -165,7 +165,7 @@ int main()
std::vector<int, min_allocator<int>>::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const int*>(a),
forward_iterator<const int*>(a+N));
assert(v.size() == 100 + N);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
diff --git a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp
index e12ec45febfc..e1ad6be054e5 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp
@@ -29,7 +29,7 @@ int main()
std::vector<MoveOnly> v(100);
std::vector<MoveOnly>::iterator i = v.insert(v.cbegin() + 10, MoveOnly(3));
assert(v.size() == 101);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -42,7 +42,7 @@ int main()
std::vector<MoveOnly, stack_allocator<MoveOnly, 300> > v(100);
std::vector<MoveOnly, stack_allocator<MoveOnly, 300> >::iterator i = v.insert(v.cbegin() + 10, MoveOnly(3));
assert(v.size() == 101);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -59,12 +59,12 @@ int main()
assert(false);
}
#endif
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<MoveOnly, min_allocator<MoveOnly>> v(100);
std::vector<MoveOnly, min_allocator<MoveOnly>>::iterator i = v.insert(v.cbegin() + 10, MoveOnly(3));
assert(v.size() == 101);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
diff --git a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
index 6997284f258c..ed4d6c976e9c 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
@@ -27,7 +27,7 @@ int main()
std::vector<int> v(100);
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == 105);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -43,7 +43,7 @@ int main()
size_t sz = v.size();
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == sz + 5);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -59,7 +59,7 @@ int main()
size_t sz = v.size();
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == sz + 5);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -73,7 +73,7 @@ int main()
std::vector<int, stack_allocator<int, 300> > v(100);
std::vector<int, stack_allocator<int, 300> >::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == 105);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -91,12 +91,12 @@ int main()
assert(false);
}
#endif
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v(100);
std::vector<int, min_allocator<int>>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == 105);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -110,7 +110,7 @@ int main()
std::vector<int, min_allocator<int>> v(100);
std::vector<int, min_allocator<int>>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == 105);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
diff --git a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp
index 782e752157a7..ba030e9e3fb7 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp
@@ -27,7 +27,7 @@ int main()
std::vector<int> v(100);
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == 101);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -42,7 +42,7 @@ int main()
size_t sz = v.size();
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == sz + 1);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -58,7 +58,7 @@ int main()
size_t sz = v.size();
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == sz + 1);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -71,7 +71,7 @@ int main()
std::vector<int, stack_allocator<int, 300> > v(100);
std::vector<int, stack_allocator<int, 300> >::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == 101);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
@@ -89,12 +89,12 @@ int main()
assert(false);
}
#endif
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v(100);
std::vector<int, min_allocator<int>>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == 101);
- assert(is_contiguous_container_asan_correct(v));
+ assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
int j;
for (j = 0; j < 10; ++j)
diff --git a/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp
index 62fa60103baa..c81e41904fc8 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp
@@ -37,9 +37,9 @@ int main()
#if _LIBCPP_DEBUG >= 1
c.pop_back();
assert(false);
-#endif
+#endif
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> c;
c.push_back(1);
@@ -49,7 +49,7 @@ int main()
#if _LIBCPP_DEBUG >= 1
c.pop_back();
assert(false);
-#endif
+#endif
}
-#endif
+#endif
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/push_back.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/push_back.pass.cpp
index eeeba6242d93..bef3b9c8d17d 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/push_back.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/push_back.pass.cpp
@@ -23,27 +23,27 @@ int main()
std::vector<int> c;
c.push_back(0);
assert(c.size() == 1);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
c.push_back(1);
assert(c.size() == 2);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
c.push_back(2);
assert(c.size() == 3);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
c.push_back(3);
assert(c.size() == 4);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
c.push_back(4);
assert(c.size() == 5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
}
@@ -51,56 +51,56 @@ int main()
std::vector<int, stack_allocator<int, 15> > c;
c.push_back(0);
assert(c.size() == 1);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
c.push_back(1);
assert(c.size() == 2);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
c.push_back(2);
assert(c.size() == 3);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
c.push_back(3);
assert(c.size() == 4);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
c.push_back(4);
assert(c.size() == 5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> c;
c.push_back(0);
assert(c.size() == 1);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
c.push_back(1);
assert(c.size() == 2);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
c.push_back(2);
assert(c.size() == 3);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
c.push_back(3);
assert(c.size() == 4);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
c.push_back(4);
assert(c.size() == 5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == j);
}
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 785225357d4b..5fa93aab89c7 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
@@ -31,7 +31,7 @@ class CMyClass {
private:
int fMagicValue;
int fTag;
-
+
private: static int kStartedConstructionMagicValue;
private: static int kFinishedConstructionMagicValue;
};
@@ -73,8 +73,8 @@ int main()
vec.push_back(instance);
std::vector<CMyClass> vec2(vec);
- assert(is_contiguous_container_asan_correct(vec));
- assert(is_contiguous_container_asan_correct(vec2));
+ assert(is_contiguous_container_asan_correct(vec));
+ assert(is_contiguous_container_asan_correct(vec2));
gCopyConstructorShouldThow = true;
try {
@@ -82,6 +82,6 @@ int main()
}
catch (...) {
assert(vec==vec2);
- assert(is_contiguous_container_asan_correct(vec));
+ assert(is_contiguous_container_asan_correct(vec));
}
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
index b143cd773b42..64762eb374e8 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
@@ -25,27 +25,27 @@ int main()
std::vector<MoveOnly> c;
c.push_back(MoveOnly(0));
assert(c.size() == 1);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(1));
assert(c.size() == 2);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(2));
assert(c.size() == 3);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(3));
assert(c.size() == 4);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(4));
assert(c.size() == 5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
}
@@ -53,56 +53,56 @@ int main()
std::vector<MoveOnly, stack_allocator<MoveOnly, 15> > c;
c.push_back(MoveOnly(0));
assert(c.size() == 1);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(1));
assert(c.size() == 2);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(2));
assert(c.size() == 3);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(3));
assert(c.size() == 4);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(4));
assert(c.size() == 5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
std::vector<MoveOnly, min_allocator<MoveOnly>> c;
c.push_back(MoveOnly(0));
assert(c.size() == 1);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(1));
assert(c.size() == 2);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(2));
assert(c.size() == 3);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(3));
assert(c.size() == 4);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(4));
assert(c.size() == 5);
- assert(is_contiguous_container_asan_correct(c));
+ assert(is_contiguous_container_asan_correct(c));
for (int j = 0; j < c.size(); ++j)
assert(c[j] == MoveOnly(j));
}
diff --git a/test/std/containers/sequences/vector/vector.special/db_swap_1.pass.cpp b/test/std/containers/sequences/vector/vector.special/db_swap_1.pass.cpp
index e7f6a0011e1a..1bb761181422 100644
--- a/test/std/containers/sequences/vector/vector.special/db_swap_1.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.special/db_swap_1.pass.cpp
@@ -37,7 +37,7 @@ int main()
c1.erase(i1);
assert(false);
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
diff --git a/test/std/containers/sequences/vector/vector.special/swap.pass.cpp b/test/std/containers/sequences/vector/vector.special/swap.pass.cpp
index 96aaf7131f53..3d01129fa008 100644
--- a/test/std/containers/sequences/vector/vector.special/swap.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.special/swap.pass.cpp
@@ -26,56 +26,56 @@ int main()
int a2[] = {0, 2, 4, 5, 6, 8, 11};
std::vector<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
std::vector<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
swap(c1, c2);
assert(c1 == std::vector<int>(a2, a2+sizeof(a2)/sizeof(a2[0])));
assert(c2 == std::vector<int>(a1, a1+sizeof(a1)/sizeof(a1[0])));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
}
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
std::vector<int> c1(a1, a1);
std::vector<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
swap(c1, c2);
assert(c1 == std::vector<int>(a2, a2+sizeof(a2)/sizeof(a2[0])));
assert(c2.empty());
assert(distance(c2.begin(), c2.end()) == 0);
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
}
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
std::vector<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
std::vector<int> c2(a2, a2);
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
swap(c1, c2);
assert(c1.empty());
assert(distance(c1.begin(), c1.end()) == 0);
assert(c2 == std::vector<int>(a1, a1+sizeof(a1)/sizeof(a1[0])));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
}
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
std::vector<int> c1(a1, a1);
std::vector<int> c2(a2, a2);
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
swap(c1, c2);
assert(c1.empty());
assert(distance(c1.begin(), c1.end()) == 0);
assert(c2.empty());
assert(distance(c2.begin(), c2.end()) == 0);
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
}
#ifndef _LIBCPP_DEBUG_LEVEL
// This test known to result in undefined behavior detected by _LIBCPP_DEBUG_LEVEL >= 1
@@ -98,72 +98,72 @@ int main()
typedef other_allocator<int> A;
std::vector<int, A> c1(a1, a1+sizeof(a1)/sizeof(a1[0]), A(1));
std::vector<int, A> c2(a2, a2+sizeof(a2)/sizeof(a2[0]), A(2));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
swap(c1, c2);
assert((c1 == std::vector<int, A>(a2, a2+sizeof(a2)/sizeof(a2[0]))));
assert(c1.get_allocator() == A(2));
assert((c2 == std::vector<int, A>(a1, a1+sizeof(a1)/sizeof(a1[0]))));
assert(c2.get_allocator() == A(1));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
}
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
std::vector<int, min_allocator<int>> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
std::vector<int, min_allocator<int>> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
swap(c1, c2);
assert((c1 == std::vector<int, min_allocator<int>>(a2, a2+sizeof(a2)/sizeof(a2[0]))));
assert((c2 == std::vector<int, min_allocator<int>>(a1, a1+sizeof(a1)/sizeof(a1[0]))));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
}
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
std::vector<int, min_allocator<int>> c1(a1, a1);
std::vector<int, min_allocator<int>> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
swap(c1, c2);
assert((c1 == std::vector<int, min_allocator<int>>(a2, a2+sizeof(a2)/sizeof(a2[0]))));
assert(c2.empty());
assert(distance(c2.begin(), c2.end()) == 0);
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
}
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
std::vector<int, min_allocator<int>> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
std::vector<int, min_allocator<int>> c2(a2, a2);
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
swap(c1, c2);
assert(c1.empty());
assert(distance(c1.begin(), c1.end()) == 0);
assert((c2 == std::vector<int, min_allocator<int>>(a1, a1+sizeof(a1)/sizeof(a1[0]))));
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
}
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
std::vector<int, min_allocator<int>> c1(a1, a1);
std::vector<int, min_allocator<int>> c2(a2, a2);
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
swap(c1, c2);
assert(c1.empty());
assert(distance(c1.begin(), c1.end()) == 0);
assert(c2.empty());
assert(distance(c2.begin(), c2.end()) == 0);
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
}
#ifndef _LIBCPP_DEBUG_LEVEL
// This test known to result in undefined behavior detected by _LIBCPP_DEBUG_LEVEL >= 1
@@ -173,15 +173,15 @@ int main()
typedef min_allocator<int> A;
std::vector<int, A> c1(a1, a1+sizeof(a1)/sizeof(a1[0]), A());
std::vector<int, A> c2(a2, a2+sizeof(a2)/sizeof(a2[0]), A());
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
swap(c1, c2);
assert((c1 == std::vector<int, A>(a2, a2+sizeof(a2)/sizeof(a2[0]))));
assert(c1.get_allocator() == A());
assert((c2 == std::vector<int, A>(a1, a1+sizeof(a1)/sizeof(a1[0]))));
assert(c2.get_allocator() == A());
- assert(is_contiguous_container_asan_correct(c1));
- assert(is_contiguous_container_asan_correct(c2));
+ assert(is_contiguous_container_asan_correct(c1));
+ assert(is_contiguous_container_asan_correct(c2));
}
#endif
#endif
diff --git a/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp b/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
index 1d00ff387480..89fa301ad9bd 100644
--- a/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// void swap(vector& c)
@@ -22,6 +24,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -29,7 +32,7 @@ template <class T>
struct some_alloc
{
typedef T value_type;
-
+
some_alloc() {}
some_alloc(const some_alloc&);
void deallocate(void*, unsigned) {}
@@ -41,7 +44,7 @@ template <class T>
struct some_alloc2
{
typedef T value_type;
-
+
some_alloc2() {}
some_alloc2(const some_alloc2&);
void deallocate(void*, unsigned) {}
@@ -52,7 +55,6 @@ struct some_alloc2
int main()
{
-#if __has_feature(cxx_noexcept)
{
typedef std::vector<MoveOnly> C;
C c1, c2;
@@ -86,6 +88,4 @@ int main()
static_assert( noexcept(swap(c1, c2)), "");
}
#endif
-
-#endif
}
diff --git a/test/std/containers/sequences/vector/version.pass.cpp b/test/std/containers/sequences/vector/version.pass.cpp
deleted file mode 100644
index 2c4fa1263de3..000000000000
--- a/test/std/containers/sequences/vector/version.pass.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-#include <vector>
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main()
-{
-}