From 762947adc7345452faf8df2be13258a7d8b86b30 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Sun, 3 Dec 2023 14:34:49 +0700 Subject: [PATCH 01/20] iter_value_t should always use direct-initialization --- stl/inc/algorithm | 28 +- stl/inc/numeric | 8 +- stl/inc/random | 2 +- tests/std/test.lst | 1 + .../env.lst | 4 + .../test.compile.pass.cpp | 414 ++++++++++++++++++ .../tests/P0896R4_common_iterator/test.cpp | 2 +- 7 files changed, 439 insertions(+), 20 deletions(-) create mode 100644 tests/std/tests/GH_004109_iter_value_t_direct_initialization/env.lst create mode 100644 tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp diff --git a/stl/inc/algorithm b/stl/inc/algorithm index 21905a2bba..f7227daf3e 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -4510,7 +4510,7 @@ _CONSTEXPR20 _OutIt unique_copy(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pr ++_UDest; } else { // can't reread source or dest, construct a temporary - _Iter_value_t<_InIt> _Val = *_UFirst; + _Iter_value_t<_InIt> _Val(*_UFirst); *_UDest = _Val; ++_UDest; @@ -4637,7 +4637,7 @@ namespace ranges { } } else { // Neither _First nor _Result can be reread, construct temporary - iter_value_t<_It> _Val = *_First; + iter_value_t<_It> _Val(*_First); while (++_First != _Last) { if (!_STD invoke(_Pred, _STD invoke(_Proj, _Val), _STD invoke(_Proj, *_First))) { @@ -6293,7 +6293,7 @@ _CONSTEXPR20 void push_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) { using _Diff = _Iter_diff_t<_RanIt>; _Diff _Count = _ULast - _UFirst; if (2 <= _Count) { - _Iter_value_t<_RanIt> _Val = _STD move(*--_ULast); + _Iter_value_t<_RanIt> _Val(_STD move(*--_ULast)); _STD _Push_heap_by_index(_UFirst, --_Count, _Diff(0), _STD move(_Val), _Pass_fn(_Pred)); } } @@ -6364,7 +6364,7 @@ namespace ranges { } --_Last; - iter_value_t<_It> _Val = _RANGES iter_move(_Last); + iter_value_t<_It> _Val(_RANGES iter_move(_Last)); // NB: if _Proj is a _Ref_fn, this aliases the _Proj1 and _Proj2 parameters of _Push_heap_by_index _RANGES _Push_heap_by_index(_STD move(_First), _Count - 1, 0, _STD move(_Val), _Pred, _Proj, _Proj); } @@ -6420,7 +6420,7 @@ _CONSTEXPR20 void _Pop_heap_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) { // pop *_First to *(_Last - 1) and reheap if (2 <= _Last - _First) { --_Last; - _Iter_value_t<_RanIt> _Val = _STD move(*_Last); + _Iter_value_t<_RanIt> _Val(_STD move(*_Last)); _STD _Pop_heap_hole_unchecked(_First, _Last, _Last, _STD move(_Val), _Pred); } } @@ -6498,7 +6498,7 @@ namespace ranges { } --_Last; - iter_value_t<_It> _Val = _RANGES iter_move(_Last); + iter_value_t<_It> _Val(_RANGES iter_move(_Last)); // NB: if _Proj is a _Ref_fn, this aliases the _Proj1 and _Proj2 parameters of _Pop_heap_hole_unchecked _RANGES _Pop_heap_hole_unchecked(_STD move(_First), _Last, _Last, _STD move(_Val), _Pred, _Proj, _Proj); } @@ -6542,7 +6542,7 @@ _CONSTEXPR20 void _Make_heap_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) { for (_Diff _Hole = _Bottom >> 1; _Hole > 0;) { // shift for codegen // reheap top half, bottom to top --_Hole; - _Iter_value_t<_RanIt> _Val = _STD move(*(_First + _Hole)); + _Iter_value_t<_RanIt> _Val(_STD move(*(_First + _Hole))); _STD _Pop_heap_hole_by_index(_First, _Hole, _Bottom, _STD move(_Val), _Pred); } } @@ -6569,7 +6569,7 @@ namespace ranges { for (_Diff _Hole = _Bottom >> 1; _Hole > 0;) { // shift for codegen // reheap top half, bottom to top --_Hole; - iter_value_t<_It> _Val = _RANGES iter_move(_First + _Hole); + iter_value_t<_It> _Val(_RANGES iter_move(_First + _Hole)); // NB: if _Proj is a _Ref_fn, this aliases the _Proj1 and _Proj2 parameters of _Pop_heap_hole_by_index _RANGES _Pop_heap_hole_by_index(_First, _Hole, _Bottom, _STD move(_Val), _Pred, _Proj, _Proj); } @@ -7833,8 +7833,8 @@ _CONSTEXPR20 _BidIt _Insertion_sort_unchecked(const _BidIt _First, const _BidIt // insertion sort [_First, _Last) if (_First != _Last) { for (_BidIt _Mid = _First; ++_Mid != _Last;) { // order next element - _BidIt _Hole = _Mid; - _Iter_value_t<_BidIt> _Val = _STD move(*_Mid); + _BidIt _Hole = _Mid; + _Iter_value_t<_BidIt> _Val(_STD move(*_Mid)); if (_DEBUG_LT_PRED(_Pred, _Val, *_First)) { // found new earliest element, move to front _Move_backward_unchecked(_First, _Mid, ++_Hole); @@ -8022,8 +8022,8 @@ namespace ranges { } for (auto _Mid = _First; ++_Mid != _Last;) { // order next element - iter_value_t<_It> _Val = _RANGES iter_move(_Mid); - auto _Hole = _Mid; + iter_value_t<_It> _Val(_RANGES iter_move(_Mid)); + auto _Hole = _Mid; for (auto _Prev = _Hole;;) { --_Prev; @@ -8684,7 +8684,7 @@ _CONSTEXPR20 void partial_sort(_RanIt _First, _RanIt _Mid, _RanIt _Last, _Pr _Pr _Make_heap_unchecked(_UFirst, _UMid, _Pass_fn(_Pred)); for (auto _UNext = _UMid; _UNext < _ULast; ++_UNext) { if (_DEBUG_LT_PRED(_Pred, *_UNext, *_UFirst)) { // replace top with new largest - _Iter_value_t<_RanIt> _Val = _STD move(*_UNext); + _Iter_value_t<_RanIt> _Val(_STD move(*_UNext)); _STD _Pop_heap_hole_unchecked(_UFirst, _UMid, _UNext, _STD move(_Val), _Pass_fn(_Pred)); } } @@ -8774,7 +8774,7 @@ namespace ranges { for (auto _Next = _Mid; _Next != _Last; ++_Next) { if (_STD invoke(_Pred, _STD invoke(_Proj, *_Next), _STD invoke(_Proj, *_First))) { // replace top with new largest - iter_value_t<_It> _Val = _RANGES iter_move(_Next); + iter_value_t<_It> _Val(_RANGES iter_move(_Next)); _RANGES _Pop_heap_hole_unchecked(_First, _Mid, _Next, _STD move(_Val), _Pred, _Proj, _Proj); } } diff --git a/stl/inc/numeric b/stl/inc/numeric index 994e14d29b..2e8701c5da 100644 --- a/stl/inc/numeric +++ b/stl/inc/numeric @@ -343,7 +343,7 @@ _CONSTEXPR20 _OutIt inclusive_scan(const _InIt _First, const _InIt _Last, _OutIt const auto _ULast = _Get_unwrapped(_Last); auto _UDest = _Get_unwrapped_n(_Dest, _Idl_distance<_InIt>(_UFirst, _ULast)); if (_UFirst != _ULast) { - _Iter_value_t<_InIt> _Val = *_UFirst; // Requirement missing from N4950 + _Iter_value_t<_InIt> _Val(*_UFirst); // Requirement missing from N4950 for (;;) { *_UDest = _Val; ++_UDest; @@ -476,10 +476,10 @@ _CONSTEXPR20 _OutIt adjacent_difference(const _InIt _First, const _InIt _Last, _ const auto _ULast = _Get_unwrapped(_Last); auto _UDest = _Get_unwrapped_n(_Dest, _Idl_distance<_InIt>(_UFirst, _ULast)); if (_UFirst != _ULast) { - _Iter_value_t<_InIt> _Val = *_UFirst; - *_UDest = _Val; + _Iter_value_t<_InIt> _Val(*_UFirst); + *_UDest = _Val; while (++_UFirst != _ULast) { // compute another difference - _Iter_value_t<_InIt> _Tmp = *_UFirst; + _Iter_value_t<_InIt> _Tmp(*_UFirst); #if _HAS_CXX20 *++_UDest = _Func(_Tmp, _STD move(_Val)); #else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv diff --git a/stl/inc/random b/stl/inc/random index 318884284a..80f5d4a171 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -177,7 +177,7 @@ public: const size_t _Mx = _Nx <= _Sx ? _Sx + 1 : _Nx; size_t _Kx; - _Iter_value_t<_RanIt> _Mask = _Iter_value_t<_RanIt>(1) << 31; + _Iter_value_t<_RanIt> _Mask(_Iter_value_t<_RanIt>(1) << 31); _Mask <<= 1; // build 32-bit mask safely _Mask -= 1; diff --git a/tests/std/test.lst b/tests/std/test.lst index 825f2055c2..0eb59e05cf 100644 --- a/tests/std/test.lst +++ b/tests/std/test.lst @@ -234,6 +234,7 @@ tests\GH_003840_tellg_when_reading_lf_file_in_text_mode tests\GH_003867_output_nan tests\GH_004023_mdspan_fwd_prod_overflow tests\GH_004040_container_nonmember_functions +tests\GH_004109_iter_value_t_direct_initialization tests\LWG2381_num_get_floating_point tests\LWG2597_complex_branch_cut tests\LWG3018_shared_ptr_function diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/env.lst b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/env.lst new file mode 100644 index 0000000000..7b6bcff483 --- /dev/null +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/env.lst @@ -0,0 +1,4 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +RUNALL_INCLUDE ..\strict_concepts_20_matrix.lst diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp new file mode 100644 index 0000000000..323b4d5c3e --- /dev/null +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cpp_lib_execution +#include +#endif // __cpp_lib_execution + +using namespace std; + +struct Val; + +struct RRef { + RRef(const Val&); +}; + +struct Val { + explicit Val(const RRef&); + Val& operator=(const RRef&); + auto operator<=>(const Val&) const = default; +}; + +struct I { + using value_type = Val; + using difference_type = int; + Val& operator*() const; + Val& operator[](int) const; + I& operator++(); + I operator++(int); + I& operator--(); + I operator--(int); + I& operator+=(int); + I& operator-=(int); + friend auto operator<=>(I, I) = default; + friend int operator-(I, I); + friend I operator+(I, int); + friend I operator-(I, int); + friend I operator+(int, I); + friend RRef iter_move(const I&); +}; + +static_assert(random_access_iterator); +static_assert(sortable); + +bool always_true(Val) { + return true; +} + +bool always_false(Val) { + return false; +} + +extern Val arr[3]; +extern Val res[3]; +extern Val val; +const int zero = 0; +// GH-4109: : iter_value_t should always use direct-initialization +void test_gh_4109() { + I nil{}; + + bool (*pred)(Val) = nullptr; + bool (*pred2)(Val, Val) = nullptr; + bool (*comp)(Val, Val) = nullptr; + Val (*gen)() = nullptr; + Val (*unop)(Val) = nullptr; + Val (*binop)(Val, Val) = nullptr; + + + (void) all_of(nil, nil, pred); + (void) any_of(nil, nil, pred); + (void) none_of(nil, nil, pred); + for_each(nil, nil, pred); + for_each_n(nil, zero, pred); + (void) find(nil, nil, val); + (void) find_if(nil, nil, pred); + (void) find_if_not(nil, nil, pred); + (void) find_end(nil, nil, nil, nil); + (void) find_end(nil, nil, nil, nil, pred2); + (void) find_end(begin(arr), end(arr), nil, nil); + (void) find_end(begin(arr), end(arr), nil, nil, pred2); + (void) find_end(nil, nil, begin(arr), end(arr)); + (void) find_end(nil, nil, begin(arr), end(arr), pred2); + (void) find_first_of(nil, nil, nil, nil); + (void) find_first_of(nil, nil, nil, nil, pred2); + (void) find_first_of(begin(arr), end(arr), nil, nil); + (void) find_first_of(begin(arr), end(arr), nil, nil, pred2); + (void) find_first_of(nil, nil, begin(arr), end(arr)); + (void) find_first_of(nil, nil, begin(arr), end(arr), pred2); + (void) adjacent_find(nil, nil); + (void) adjacent_find(nil, nil, pred2); + (void) adjacent_find(begin(arr), begin(arr) + 1); + (void) adjacent_find(begin(arr), begin(arr) + 1, pred2); + (void) count(nil, nil, val); + (void) count_if(nil, nil, pred); + (void) mismatch(nil, nil, nil); + (void) mismatch(nil, nil, nil, pred2); + (void) mismatch(nil, nil, nil, nil); + (void) mismatch(nil, nil, nil, nil, pred2); + (void) mismatch(begin(arr), end(arr), nil, nil); + (void) mismatch(begin(arr), end(arr), nil, nil, pred2); + (void) mismatch(nil, nil, begin(arr), end(arr)); + (void) mismatch(nil, nil, begin(arr), end(arr), pred2); + (void) equal(nil, nil, nil); + (void) equal(nil, nil, nil, pred2); + (void) equal(nil, nil, nil, nil); + (void) equal(nil, nil, nil, nil, pred2); + (void) equal(begin(arr), end(arr), nil, nil); + (void) equal(begin(arr), end(arr), nil, nil, pred2); + (void) equal(nil, nil, begin(arr), end(arr)); + (void) equal(nil, nil, begin(arr), end(arr), pred2); + (void) is_permutation(nil, nil, nil); + (void) is_permutation(nil, nil, nil, pred2); + (void) is_permutation(nil, nil, nil, nil); + (void) is_permutation(nil, nil, nil, nil, pred2); + (void) is_permutation(begin(arr), end(arr), nil, nil); + (void) is_permutation(begin(arr), end(arr), nil, nil, pred2); + (void) is_permutation(nil, nil, begin(arr), end(arr)); + (void) is_permutation(nil, nil, begin(arr), end(arr), pred2); + (void) search(nil, nil, nil, nil); + (void) search(nil, nil, nil, nil, pred2); + (void) search(begin(arr), end(arr), nil, nil); + (void) search(begin(arr), end(arr), nil, nil, pred2); + (void) search(nil, nil, begin(arr), end(arr)); + (void) search(nil, nil, begin(arr), end(arr), pred2); + (void) search_n(nil, nil, zero, val); + (void) search_n(nil, nil, 5, val); + (void) search_n(nil, nil, zero, val, pred2); + (void) search_n(nil, nil, 5, val, pred2); + copy(nil, nil, nil); + copy_n(nil, zero, nil); + copy_if(nil, nil, nil, pred); + copy_if(begin(arr), end(arr), nil, &always_false); + copy_backward(nil, nil, nil); + move(nil, nil, nil); + move_backward(nil, nil, nil); + swap_ranges(nil, nil, nil); + transform(nil, nil, nil, unop); + transform(nil, nil, nil, nil, binop); + replace(nil, nil, val, val); + replace_if(nil, nil, pred, val); + replace_copy(nil, nil, nil, val, val); + replace_copy_if(nil, nil, nil, pred, val); + fill(nil, nil, val); + fill_n(nil, zero, val); + generate(nil, nil, gen); + generate_n(nil, zero, gen); + (void) remove(nil, nil, val); + (void) remove_if(nil, nil, pred); + remove_copy(nil, nil, nil, val); + remove_copy(begin(arr), end(arr), nil, val); + remove_copy_if(nil, nil, nil, pred); + remove_copy_if(begin(arr), end(arr), nil, &always_true); + (void) unique(nil, nil); + (void) unique(nil, nil, pred2); + (void) unique(begin(arr), begin(arr) + 1); + (void) unique(begin(arr), begin(arr) + 1, pred2); + unique_copy(nil, nil, nil); + unique_copy(nil, nil, nil, pred2); + reverse(nil, nil); + reverse_copy(nil, nil, nil); + rotate(nil, nil, nil); + rotate_copy(nil, nil, nil, nil); + sample(nil, nil, nil, zero, mt19937(1729)); + shuffle(nil, nil, mt19937(1729)); + shift_left(nil, nil, 1729); + shift_right(nil, nil, 1729); + (void) is_partitioned(nil, nil, pred); + partition(nil, nil, pred); + stable_partition(nil, nil, pred); + partition_copy(nil, nil, nil, nil, pred); + partition_copy(begin(arr), end(arr), begin(res), nil, &always_true); + partition_copy(begin(arr), end(arr), nil, begin(res), &always_false); + (void) partition_point(nil, nil, pred); + sort(nil, nil); + sort(nil, nil, comp); + sort(begin(arr), begin(arr) + 1); + sort(begin(arr), begin(arr) + 1, comp); + stable_sort(nil, nil); + stable_sort(nil, nil, comp); + stable_sort(begin(arr), begin(arr) + 1); + stable_sort(begin(arr), begin(arr) + 1, comp); + partial_sort(nil, nil, nil); + partial_sort(nil, nil, nil, comp); + partial_sort_copy(nil, nil, nil, nil); + partial_sort_copy(nil, nil, nil, nil, comp); + (void) is_sorted(nil, nil); + (void) is_sorted(nil, nil, comp); + (void) is_sorted(begin(arr), begin(arr) + 1); + (void) is_sorted(begin(arr), begin(arr) + 1, comp); + (void) is_sorted_until(nil, nil); + (void) is_sorted_until(nil, nil, comp); + (void) is_sorted_until(begin(arr), begin(arr) + 1); + (void) is_sorted_until(begin(arr), begin(arr) + 1, comp); + nth_element(nil, nil, nil); + nth_element(nil, nil, nil, comp); + (void) lower_bound(nil, nil, val); + (void) lower_bound(nil, nil, val, comp); + (void) upper_bound(nil, nil, val); + (void) upper_bound(nil, nil, val, comp); + (void) equal_range(nil, nil, val); + (void) equal_range(nil, nil, val, comp); + (void) binary_search(nil, nil, val); + (void) binary_search(nil, nil, val, comp); + merge(nil, nil, nil, nil, nil); + merge(nil, nil, nil, nil, nil, comp); + inplace_merge(nil, nil, nil); + inplace_merge(nil, nil, nil, comp); + (void) includes(nil, nil, nil, nil); + (void) includes(nil, nil, nil, nil, comp); + set_union(nil, nil, nil, nil, nil); + set_union(nil, nil, nil, nil, nil, comp); + set_intersection(nil, nil, nil, nil, nil); + set_intersection(nil, nil, nil, nil, nil, comp); + set_difference(nil, nil, nil, nil, nil); + set_difference(nil, nil, nil, nil, nil, comp); + set_symmetric_difference(nil, nil, nil, nil, nil); + set_symmetric_difference(nil, nil, nil, nil, nil, comp); + make_heap(nil, nil); + make_heap(nil, nil, comp); + sort_heap(nil, nil); + sort_heap(nil, nil, comp); + (void) is_heap(nil, nil); + (void) is_heap(nil, nil, comp); + (void) is_heap_until(nil, nil); + (void) is_heap_until(nil, nil, comp); + + (void) min_element(nil, nil); + (void) min_element(nil, nil, comp); + (void) min_element(begin(arr), begin(arr) + 1); + (void) min_element(begin(arr), begin(arr) + 1, comp); + (void) max_element(nil, nil); + (void) max_element(nil, nil, comp); + (void) max_element(begin(arr), begin(arr) + 1); + (void) max_element(begin(arr), begin(arr) + 1, comp); + (void) minmax_element(nil, nil); + (void) minmax_element(nil, nil, comp); + (void) minmax_element(begin(arr), begin(arr) + 1); + (void) minmax_element(begin(arr), begin(arr) + 1, comp); + (void) lexicographical_compare(nil, nil, nil, nil); + (void) lexicographical_compare(begin(arr), end(arr), nil, nil); + (void) lexicographical_compare(nil, nil, begin(arr), end(arr)); + (void) lexicographical_compare(nil, nil, nil, nil, comp); + (void) lexicographical_compare(begin(arr), end(arr), nil, nil, comp); + (void) lexicographical_compare(nil, nil, begin(arr), end(arr), comp); + next_permutation(nil, nil); + next_permutation(nil, nil, comp); + prev_permutation(nil, nil); + prev_permutation(nil, nil, comp); + (void) accumulate(nil, nil, val, binop); + (void) reduce(nil, nil, val, binop); + (void) inner_product(nil, nil, nil, val, binop, binop); + (void) transform_reduce(nil, nil, nil, val, binop, binop); + (void) transform_reduce(nil, nil, val, binop, unop); + partial_sum(nil, nil, nil, binop); + exclusive_scan(nil, nil, nil, val, binop); + inclusive_scan(nil, nil, nil, binop); + inclusive_scan(nil, nil, nil, binop, val); + transform_exclusive_scan(nil, nil, nil, val, binop, unop); + transform_inclusive_scan(nil, nil, nil, binop, unop); + transform_inclusive_scan(nil, nil, nil, binop, unop, val); + adjacent_difference(nil, nil, nil, binop); + uninitialized_copy(nil, nil, nil); + uninitialized_copy_n(nil, zero, nil); + uninitialized_fill(nil, nil, val); + uninitialized_fill_n(nil, zero, val); + +#ifdef __cpp_lib_execution + using namespace std::execution; + (void) all_of(par, nil, nil, pred); + (void) any_of(par, nil, nil, pred); + (void) none_of(par, nil, nil, pred); + for_each(par, nil, nil, pred); + for_each_n(par, nil, zero, pred); + (void) find(par, nil, nil, val); + (void) find_if(par, nil, nil, pred); + (void) find_if_not(par, nil, nil, pred); + (void) find_end(par, nil, nil, nil, nil); + (void) find_end(par, nil, nil, nil, nil, comp); + (void) find_first_of(par, nil, nil, nil, nil); + (void) find_first_of(par, nil, nil, nil, nil, comp); + (void) adjacent_find(par, nil, nil); + (void) adjacent_find(par, nil, nil, pred2); + (void) count(par, nil, nil, val); + (void) count_if(par, nil, nil, pred); + (void) mismatch(par, nil, nil, nil); + (void) mismatch(par, nil, nil, nil, pred2); + (void) mismatch(par, nil, nil, nil, nil); + (void) mismatch(par, nil, nil, nil, nil, pred2); + (void) mismatch(par, begin(arr), end(arr), nil, nil); + (void) mismatch(par, begin(arr), end(arr), nil, nil, pred2); + (void) mismatch(par, nil, nil, begin(arr), end(arr)); + (void) mismatch(par, nil, nil, begin(arr), end(arr), pred2); + (void) equal(par, nil, nil, nil); + (void) equal(par, nil, nil, nil, pred2); + (void) equal(par, nil, nil, nil, nil); + (void) equal(par, nil, nil, nil, nil, pred2); + (void) equal(par, begin(arr), end(arr), nil, nil); + (void) equal(par, begin(arr), end(arr), nil, nil, pred2); + (void) equal(par, nil, nil, begin(arr), end(arr)); + (void) equal(par, nil, nil, begin(arr), end(arr), pred2); + (void) search(par, nil, nil, nil, nil); + (void) search(par, nil, nil, nil, nil, pred2); + (void) search_n(par, nil, nil, zero, val); + (void) search_n(par, nil, nil, 5, val); + (void) search_n(par, nil, nil, zero, val, pred2); + (void) search_n(par, nil, nil, 5, val, pred2); + + copy(par, nil, nil, nil); + copy_if(par, nil, nil, nil, pred); + copy_n(par, nil, zero, nil); + move(par, nil, nil, nil); + swap_ranges(par, nil, nil, nil); + transform(par, nil, nil, nil, unop); + transform(par, nil, nil, nil, nil, binop); + replace(par, nil, nil, val, val); + replace_if(par, nil, nil, pred, val); + replace_copy(par, nil, nil, nil, val, val); + replace_copy_if(par, nil, nil, nil, pred, val); + fill(par, nil, nil, val); + fill_n(par, nil, zero, val); + generate(par, nil, nil, gen); + generate_n(par, nil, zero, gen); + (void) remove(par, nil, nil, val); + (void) remove_if(par, nil, nil, pred); + remove_copy(par, nil, nil, nil, val); + remove_copy_if(par, nil, nil, nil, pred); + (void) unique(par, nil, nil); + (void) unique(par, nil, nil, comp); + unique_copy(par, nil, nil, nil); + unique_copy(par, nil, nil, nil, comp); + reverse(par, nil, nil); + reverse_copy(par, nil, nil, nil); + rotate(par, nil, nil, nil); + rotate_copy(par, nil, nil, nil, nil); + + sort(par, begin(arr), begin(arr) + 1); + sort(par, begin(arr), begin(arr) + 1, comp); + sort(par, nil, nil); + sort(par, nil, nil, comp); + stable_sort(par, nil, nil); + stable_sort(par, nil, nil, comp); + stable_sort(par, begin(arr), begin(arr) + 1); + stable_sort(par, begin(arr), begin(arr) + 1, comp); + partial_sort(par, nil, nil, nil); + partial_sort(par, nil, nil, nil, comp); + partial_sort_copy(par, nil, nil, nil, nil); + partial_sort_copy(par, nil, nil, nil, nil, comp); + (void) is_sorted(par, nil, nil); + (void) is_sorted(par, nil, nil, comp); + (void) is_sorted_until(par, nil, nil); + (void) is_sorted_until(par, nil, nil, comp); + + nth_element(par, nil, nil, nil); + nth_element(par, nil, nil, nil, comp); + + shift_left(par, nil, nil, 1729); + shift_right(par, nil, nil, 1729); + + partition(par, nil, nil, pred); + partition_copy(par, nil, nil, nil, nil, pred); + stable_partition(par, nil, nil, pred); + (void) is_partitioned(par, nil, nil, pred); + + merge(par, nil, nil, nil, nil, nil); + merge(par, nil, nil, nil, nil, nil, comp); + inplace_merge(par, nil, nil, nil); + inplace_merge(par, nil, nil, nil, comp); + + (void) includes(par, nil, nil, nil, nil); + (void) includes(par, nil, nil, nil, nil, comp); + set_union(par, nil, nil, nil, nil, nil); + set_union(par, nil, nil, nil, nil, nil, comp); + set_intersection(par, nil, nil, nil, nil, nil); + set_intersection(par, nil, nil, nil, nil, nil, comp); + set_difference(par, nil, nil, nil, nil, nil); + set_difference(par, nil, nil, nil, nil, nil, comp); + set_symmetric_difference(par, nil, nil, nil, nil, nil); + set_symmetric_difference(par, nil, nil, nil, nil, nil, comp); + + (void) is_heap(par, nil, nil); + (void) is_heap(par, nil, nil, comp); + (void) is_heap_until(par, nil, nil); + (void) is_heap_until(par, nil, nil, comp); + + (void) min_element(par, nil, nil); + (void) min_element(par, nil, nil, comp); + (void) max_element(par, nil, nil); + (void) max_element(par, nil, nil, comp); + (void) minmax_element(par, nil, nil); + (void) minmax_element(par, nil, nil, comp); + + (void) lexicographical_compare(par, nil, nil, nil, nil); + (void) lexicographical_compare(par, nil, nil, nil, nil, comp); + + (void) reduce(par, nil, nil, val, binop); + + (void) transform_reduce(par, nil, nil, nil, val, binop, binop); + (void) transform_reduce(par, nil, nil, val, binop, unop); + + exclusive_scan(par, nil, nil, nil, val, binop); + inclusive_scan(par, nil, nil, nil, binop, val); + transform_exclusive_scan(par, nil, nil, nil, val, binop, unop); + transform_inclusive_scan(par, nil, nil, nil, binop, unop, val); + + adjacent_difference(par, nil, nil, nil, binop); +#endif // __cpp_lib_execution +} diff --git a/tests/std/tests/P0896R4_common_iterator/test.cpp b/tests/std/tests/P0896R4_common_iterator/test.cpp index c4e6784c8e..c4691a7c6e 100644 --- a/tests/std/tests/P0896R4_common_iterator/test.cpp +++ b/tests/std/tests/P0896R4_common_iterator/test.cpp @@ -161,7 +161,7 @@ struct instantiator { if constexpr (input_iterator) { // iter_move Cit iter1{Iter{input}}; - const same_as> auto element1 = ranges::iter_move(iter1); + const same_as> auto element1(ranges::iter_move(iter1)); assert(element1 == P(0, 1)); } From eecac284f5ae295700d22be2f4e85b12c1ba8ff3 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Tue, 5 Dec 2023 00:20:23 +0700 Subject: [PATCH 02/20] add more tests --- .../env.lst | 2 +- .../test.compile.pass.cpp | 300 +++++++++++++++++- 2 files changed, 294 insertions(+), 8 deletions(-) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/env.lst b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/env.lst index 7b6bcff483..19f025bd0e 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/env.lst +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/env.lst @@ -1,4 +1,4 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -RUNALL_INCLUDE ..\strict_concepts_20_matrix.lst +RUNALL_INCLUDE ..\usual_matrix.lst diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index 323b4d5c3e..f0b15d5254 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -22,14 +22,25 @@ struct RRef { }; struct Val { + using difference_type = int; explicit Val(const RRef&); Val& operator=(const RRef&); - auto operator<=>(const Val&) const = default; + bool operator==(const Val&) const; + bool operator!=(const Val&) const; + bool operator<(const Val&) const; + bool operator<=(const Val&) const; + bool operator>(const Val&) const; + bool operator>=(const Val&) const; + Val& operator++(); + Val operator++(int); }; struct I { - using value_type = Val; - using difference_type = int; + using iterator_category = random_access_iterator_tag; + using pointer = Val*; + using value_type = Val; + using reference = Val&; + using difference_type = int; Val& operator*() const; Val& operator[](int) const; I& operator++(); @@ -38,7 +49,12 @@ struct I { I operator--(int); I& operator+=(int); I& operator-=(int); - friend auto operator<=>(I, I) = default; + friend bool operator==(const I&, const I&); + friend bool operator!=(const I&, const I&); + friend bool operator<(const I&, const I&); + friend bool operator<=(const I&, const I&); + friend bool operator>(const I&, const I&); + friend bool operator>=(const I&, const I&); friend int operator-(I, I); friend I operator+(I, int); friend I operator-(I, int); @@ -46,8 +62,10 @@ struct I { friend RRef iter_move(const I&); }; +#ifdef __cpp_lib_concepts static_assert(random_access_iterator); static_assert(sortable); +#endif // __cpp_lib_concepts bool always_true(Val) { return true; @@ -69,15 +87,19 @@ void test_gh_4109() { bool (*pred2)(Val, Val) = nullptr; bool (*comp)(Val, Val) = nullptr; Val (*gen)() = nullptr; - Val (*unop)(Val) = nullptr; - Val (*binop)(Val, Val) = nullptr; - +#if _HAS_AUTO_PTR_ETC + int (*rng)(int) = nullptr; +#endif // _HAS_AUTO_PTR_ETC + Val (*unop)(Val) = nullptr; + Val (*binop)(Val, Val) = nullptr; (void) all_of(nil, nil, pred); (void) any_of(nil, nil, pred); (void) none_of(nil, nil, pred); for_each(nil, nil, pred); +#if _HAS_CXX17 for_each_n(nil, zero, pred); +#endif // _HAS_CXX17 (void) find(nil, nil, val); (void) find_if(nil, nil, pred); (void) find_if_not(nil, nil, pred); @@ -167,10 +189,18 @@ void test_gh_4109() { reverse_copy(nil, nil, nil); rotate(nil, nil, nil); rotate_copy(nil, nil, nil, nil); +#if _HAS_AUTO_PTR_ETC + random_shuffle(nil, nil); + random_shuffle(nil, nil, rng); +#endif // _HAS_AUTO_PTR_ETC +#if _HAS_CXX17 sample(nil, nil, nil, zero, mt19937(1729)); +#endif // _HAS_CXX17 shuffle(nil, nil, mt19937(1729)); +#if _HAS_CXX20 shift_left(nil, nil, 1729); shift_right(nil, nil, 1729); +#endif // _HAS_CXX20 (void) is_partitioned(nil, nil, pred); partition(nil, nil, pred); stable_partition(nil, nil, pred); @@ -254,18 +284,25 @@ void test_gh_4109() { prev_permutation(nil, nil); prev_permutation(nil, nil, comp); (void) accumulate(nil, nil, val, binop); +#if _HAS_CXX17 (void) reduce(nil, nil, val, binop); +#endif // _HAS_CXX17 (void) inner_product(nil, nil, nil, val, binop, binop); +#if _HAS_CXX17 (void) transform_reduce(nil, nil, nil, val, binop, binop); (void) transform_reduce(nil, nil, val, binop, unop); +#endif // _HAS_CXX17 partial_sum(nil, nil, nil, binop); +#if _HAS_CXX17 exclusive_scan(nil, nil, nil, val, binop); inclusive_scan(nil, nil, nil, binop); inclusive_scan(nil, nil, nil, binop, val); transform_exclusive_scan(nil, nil, nil, val, binop, unop); transform_inclusive_scan(nil, nil, nil, binop, unop); transform_inclusive_scan(nil, nil, nil, binop, unop, val); +#endif // _HAS_CXX17 adjacent_difference(nil, nil, nil, binop); + iota(nil, nil, val); uninitialized_copy(nil, nil, nil); uninitialized_copy_n(nil, zero, nil); uninitialized_fill(nil, nil, val); @@ -360,8 +397,10 @@ void test_gh_4109() { nth_element(par, nil, nil, nil); nth_element(par, nil, nil, nil, comp); +#if _HAS_CXX20 shift_left(par, nil, nil, 1729); shift_right(par, nil, nil, 1729); +#endif // _HAS_CXX20 partition(par, nil, nil, pred); partition_copy(par, nil, nil, nil, nil, pred); @@ -411,4 +450,251 @@ void test_gh_4109() { adjacent_difference(par, nil, nil, nil, binop); #endif // __cpp_lib_execution + +#ifdef __cpp_lib_concepts + // Non-modifying sequence operations + (void) ranges::all_of(nil, nil, pred); + (void) ranges::any_of(nil, nil, pred); + (void) ranges::none_of(nil, nil, pred); + + ranges::for_each(nil, nil, pred); + ranges::for_each_n(nil, zero, pred); + + (void) ranges::count(nil, nil, val); + (void) ranges::count_if(nil, nil, pred); + + (void) ranges::mismatch(nil, nil, nil, nil); + (void) ranges::mismatch(nil, nil, nil, nil, pred2); + + (void) ranges::equal(nil, nil, nil, nil); + (void) ranges::equal(nil, nil, nil, nil, pred2); + + (void) ranges::lexicographical_compare(nil, nil, nil, nil); + (void) ranges::lexicographical_compare(nil, nil, nil, nil, comp); + + (void) ranges::find(nil, nil, val); + (void) ranges::find_if(nil, nil, pred); + (void) ranges::find_if_not(nil, nil, pred); + +#if _HAS_CXX23 + (void) ranges::find_last(nil, nil, val); + (void) ranges::find_last_if(nil, nil, pred); + (void) ranges::find_last_if_not(nil, nil, pred); +#endif // _HAS_CXX23 + + (void) ranges::find_end(nil, nil, nil, nil); + (void) ranges::find_end(nil, nil, nil, nil, pred2); + + (void) ranges::find_first_of(nil, nil, nil, nil); + (void) ranges::find_first_of(nil, nil, nil, nil, pred2); + + (void) ranges::adjacent_find(nil, nil); + (void) ranges::adjacent_find(nil, nil, pred2); + + (void) ranges::search(nil, nil, nil, nil); + (void) ranges::search(nil, nil, nil, nil, pred2); + + (void) ranges::search_n(nil, nil, zero, val); + (void) ranges::search_n(nil, nil, zero, val, pred2); + +#if _HAS_CXX23 + (void) ranges::contains(nil, nil, val); + (void) ranges::contains_subrange(nil, nil, nil, nil); + + (void) ranges::starts_with(nil, nil, nil, nil); + (void) ranges::starts_with(nil, nil, nil, nil, pred2); + + (void) ranges::ends_with(nil, nil, nil, nil); + (void) ranges::ends_with(nil, nil, nil, nil, pred2); +#endif // _HAS_CXX23 + + // Modifying sequence operations + ranges::copy(nil, nil, nil); + ranges::copy_if(nil, nil, nil, pred); + + ranges::copy_n(nil, zero, nil); + + ranges::copy_backward(nil, nil, nil); + + ranges::move(nil, nil, nil); + + ranges::move_backward(nil, nil, nil); + + ranges::fill(nil, nil, val); + + ranges::fill_n(nil, zero, val); + + ranges::transform(nil, nil, nil, unop); + // ranges::transform(nil, nil, nil, nil, binop); + + ranges::generate(nil, nil, gen); + + ranges::generate_n(nil, zero, gen); + + (void) ranges::remove(nil, nil, val); + (void) ranges::remove_if(nil, nil, pred); + + ranges::remove_copy(nil, nil, nil, val); + ranges::remove_copy_if(nil, nil, nil, pred); + + ranges::replace(nil, nil, val, val); + ranges::replace_if(nil, nil, pred, val); + + ranges::replace_copy(nil, nil, nil, val, val); + ranges::replace_copy_if(nil, nil, nil, pred, val); + + ranges::swap_ranges(nil, nil, nil, nil); + + ranges::reverse(nil, nil); + ranges::reverse_copy(nil, nil, nil); + + ranges::rotate(nil, nil, nil); + ranges::rotate_copy(nil, nil, nil, nil); + + ranges::shuffle(nil, nil, mt19937(1729)); + +#if _HAS_CXX23 + ranges::shift_left(nil, nil, 1729); + ranges::shift_right(nil, nil, 1729); +#endif // _HAS_CXX23 + + ranges::sample(nil, nil, nil, zero, mt19937(1729)); + + (void) ranges::unique(nil, nil); + (void) ranges::unique(nil, nil, pred2); + + ranges::unique_copy(nil, nil, nil); + ranges::unique_copy(nil, nil, nil, pred2); + + // Partitioning operations + (void) ranges::is_partitioned(nil, nil, pred); + ranges::partition(nil, nil, pred); + ranges::partition_copy(nil, nil, nil, nil, pred); + ranges::stable_partition(nil, nil, pred); + (void) ranges::partition_point(nil, nil, pred); + + // Sorting operations + (void) ranges::is_sorted(nil, nil); + (void) ranges::is_sorted(nil, nil, comp); + + (void) ranges::is_sorted_until(nil, nil); + (void) ranges::is_sorted_until(nil, nil, comp); + + ranges::sort(nil, nil); + ranges::sort(nil, nil, comp); + + ranges::partial_sort(nil, nil, nil); + ranges::partial_sort(nil, nil, nil, comp); + + ranges::partial_sort_copy(nil, nil, nil, nil); + ranges::partial_sort_copy(nil, nil, nil, nil, comp); + + ranges::stable_sort(nil, nil); + ranges::stable_sort(nil, nil, comp); + + ranges::nth_element(nil, nil, nil); + + // Binary search operations (on sorted ranges) + (void) ranges::lower_bound(nil, nil, val); + (void) ranges::lower_bound(nil, nil, val, comp); + + (void) ranges::upper_bound(nil, nil, val); + (void) ranges::upper_bound(nil, nil, val, comp); + + (void) ranges::binary_search(nil, nil, val); + (void) ranges::binary_search(nil, nil, val, comp); + + (void) ranges::equal_range(nil, nil, val); + (void) ranges::equal_range(nil, nil, val, comp); + + // Set operations (on sorted ranges) + ranges::merge(nil, nil, nil, nil, nil); + ranges::merge(nil, nil, nil, nil, nil, comp); + + ranges::inplace_merge(nil, nil, nil); + ranges::inplace_merge(nil, nil, nil, comp); + + (void) ranges::includes(nil, nil, nil, nil); + (void) ranges::includes(nil, nil, nil, nil, comp); + + ranges::set_difference(nil, nil, nil, nil, nil); + ranges::set_difference(nil, nil, nil, nil, nil, comp); + + ranges::set_intersection(nil, nil, nil, nil, nil); + ranges::set_intersection(nil, nil, nil, nil, nil, comp); + + ranges::set_symmetric_difference(nil, nil, nil, nil, nil); + ranges::set_symmetric_difference(nil, nil, nil, nil, nil, comp); + + ranges::set_union(nil, nil, nil, nil, nil); + ranges::set_union(nil, nil, nil, nil, nil, comp); + + // Heap operations + (void) ranges::is_heap(nil, nil); + (void) ranges::is_heap(nil, nil, comp); + + (void) ranges::is_heap_until(nil, nil); + (void) ranges::is_heap_until(nil, nil, comp); + + ranges::make_heap(nil, nil); + ranges::make_heap(nil, nil, comp); + + ranges::push_heap(nil, nil); + ranges::push_heap(nil, nil, comp); + + ranges::pop_heap(nil, nil); + ranges::pop_heap(nil, nil, comp); + + ranges::sort_heap(nil, nil); + ranges::sort_heap(nil, nil, comp); + + // Minimum/maximum operations + (void) ranges::max_element(nil, nil); + (void) ranges::max_element(nil, nil, comp); + + (void) ranges::min_element(nil, nil); + (void) ranges::min_element(nil, nil, comp); + + //(void) ranges::minmax_element(nil, nil); + //(void) ranges::minmax_element(nil, nil, comp); + + // Permutation operations + (void) ranges::is_permutation(nil, nil, nil, nil); + (void) ranges::is_permutation(nil, nil, nil, nil, pred2); + + ranges::next_permutation(nil, nil); + ranges::next_permutation(nil, nil, comp); + + ranges::prev_permutation(nil, nil); + ranges::prev_permutation(nil, nil, comp); + + // Constrained numeric operations +#if _HAS_CXX23 + ranges::iota(nil, nil, val); +#endif // _HAS_CXX23 + + // Constrained fold operations +#if _HAS_CXX23 + (void) ranges::fold_left(nil, nil, val, binop); + (void) ranges::fold_left_first(nil, nil, binop); + (void) ranges::fold_right(nil, nil, val, binop); + (void) ranges::fold_right_last(nil, nil, binop); + (void) ranges::fold_left_with_iter(nil, nil, val, binop); + (void) ranges::fold_left_first_with_iter(nil, nil, binop); +#endif // _HAS_CXX23 + + // Constrained uninitialized memory algorithms + ranges::uninitialized_copy(nil, nil, nil, nil); + ranges::uninitialized_copy_n(nil, zero, nil, nil); + + ranges::uninitialized_fill(nil, nil, val); + ranges::uninitialized_fill_n(nil, zero, val); + + ranges::uninitialized_move(nil, nil, nil, nil); + ranges::uninitialized_move_n(nil, zero, nil, nil); + + ranges::destroy(nil, nil); + + ranges::destroy_n(nil, zero); +#endif // __cpp_lib_concepts } From b78ce8f39a70287207b0a466c33390374d66e6e0 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Tue, 5 Dec 2023 09:34:46 +0700 Subject: [PATCH 03/20] fix ranges::transform Co-authored-by: A. Jiang --- .../test.compile.pass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index f0b15d5254..acbf8ceb5f 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -525,7 +525,7 @@ void test_gh_4109() { ranges::fill_n(nil, zero, val); ranges::transform(nil, nil, nil, unop); - // ranges::transform(nil, nil, nil, nil, binop); + ranges::transform(nil, nil, nil, nil, nil, binop); ranges::generate(nil, nil, gen); From bb7c218e5be903393e8b96ce731b7fb4ab3d54ad Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 16:33:43 -0800 Subject: [PATCH 04/20] `using namespace std::execution;` => `using std::execution::par;` --- .../test.compile.pass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index acbf8ceb5f..8777c48d36 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -11,6 +11,7 @@ #ifdef __cpp_lib_execution #include +using std::execution::par; #endif // __cpp_lib_execution using namespace std; @@ -309,7 +310,6 @@ void test_gh_4109() { uninitialized_fill_n(nil, zero, val); #ifdef __cpp_lib_execution - using namespace std::execution; (void) all_of(par, nil, nil, pred); (void) any_of(par, nil, nil, pred); (void) none_of(par, nil, nil, pred); From 88e5edcf800dead404d29399208f051d318ea851 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 16:34:23 -0800 Subject: [PATCH 05/20] `mt19937(1729)` => `extern mt19937 urbg;` --- .../test.compile.pass.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index 8777c48d36..1a7b001e1d 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -79,6 +79,7 @@ bool always_false(Val) { extern Val arr[3]; extern Val res[3]; extern Val val; +extern mt19937 urbg; // UniformRandomBitGenerator const int zero = 0; // GH-4109: : iter_value_t should always use direct-initialization void test_gh_4109() { @@ -195,9 +196,9 @@ void test_gh_4109() { random_shuffle(nil, nil, rng); #endif // _HAS_AUTO_PTR_ETC #if _HAS_CXX17 - sample(nil, nil, nil, zero, mt19937(1729)); + sample(nil, nil, nil, zero, urbg); #endif // _HAS_CXX17 - shuffle(nil, nil, mt19937(1729)); + shuffle(nil, nil, urbg); #if _HAS_CXX20 shift_left(nil, nil, 1729); shift_right(nil, nil, 1729); @@ -551,14 +552,14 @@ void test_gh_4109() { ranges::rotate(nil, nil, nil); ranges::rotate_copy(nil, nil, nil, nil); - ranges::shuffle(nil, nil, mt19937(1729)); + ranges::shuffle(nil, nil, urbg); #if _HAS_CXX23 ranges::shift_left(nil, nil, 1729); ranges::shift_right(nil, nil, 1729); #endif // _HAS_CXX23 - ranges::sample(nil, nil, nil, zero, mt19937(1729)); + ranges::sample(nil, nil, nil, zero, urbg); (void) ranges::unique(nil, nil); (void) ranges::unique(nil, nil, pred2); From 30062a408d504f6a330fa73442fc8f5185f0f546 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 16:50:33 -0800 Subject: [PATCH 06/20] Work around VSO-1941943 "Bogus warning C4700 (uninitialized local variable) when returning an aggregate of empty structs". --- .../test.compile.pass.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index 1a7b001e1d..a409613033 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -61,6 +61,10 @@ struct I { friend I operator-(I, int); friend I operator+(int, I); friend RRef iter_move(const I&); + +#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1941943 + int dummy{0}; +#endif // ^^^ workaround ^^^ }; #ifdef __cpp_lib_concepts @@ -656,8 +660,8 @@ void test_gh_4109() { (void) ranges::min_element(nil, nil); (void) ranges::min_element(nil, nil, comp); - //(void) ranges::minmax_element(nil, nil); - //(void) ranges::minmax_element(nil, nil, comp); + (void) ranges::minmax_element(nil, nil); + (void) ranges::minmax_element(nil, nil, comp); // Permutation operations (void) ranges::is_permutation(nil, nil, nil, nil); From 53b81771be8b9d6ff19895abc33f115545eb88f3 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 18:04:22 -0800 Subject: [PATCH 07/20] Remove unused headers. --- .../test.compile.pass.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index a409613033..a48344b746 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -#include -#include #include #include #include From b095712ab46af7d0d39d7df4e818ab19d8d5cf9b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 18:04:55 -0800 Subject: [PATCH 08/20] Test classic `push_heap` and `pop_heap`. --- .../test.compile.pass.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index a48344b746..a5e494775a 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -256,6 +256,10 @@ void test_gh_4109() { set_difference(nil, nil, nil, nil, nil, comp); set_symmetric_difference(nil, nil, nil, nil, nil); set_symmetric_difference(nil, nil, nil, nil, nil, comp); + push_heap(nil, nil); + push_heap(nil, nil, comp); + pop_heap(nil, nil); + pop_heap(nil, nil, comp); make_heap(nil, nil); make_heap(nil, nil, comp); sort_heap(nil, nil); From 32d0ef0c7e93b015f59502cf7dbdfce5ae9cdf88 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 18:05:49 -0800 Subject: [PATCH 09/20] Test classic `uninitialized_move[_n]`. --- .../test.compile.pass.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index a5e494775a..dbdad8cd08 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -313,6 +313,10 @@ void test_gh_4109() { iota(nil, nil, val); uninitialized_copy(nil, nil, nil); uninitialized_copy_n(nil, zero, nil); +#if _HAS_CXX17 + uninitialized_move(nil, nil, nil); + uninitialized_move_n(nil, zero, nil); +#endif // _HAS_CXX17 uninitialized_fill(nil, nil, val); uninitialized_fill_n(nil, zero, val); From b9a25930d1e5f7fcb514e6dafd199b619f7e9b4a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 18:06:20 -0800 Subject: [PATCH 10/20] Test parallel `uninitialized_MEOW`. --- .../test.compile.pass.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index dbdad8cd08..d5a1f75038 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -460,6 +460,13 @@ void test_gh_4109() { transform_inclusive_scan(par, nil, nil, nil, binop, unop, val); adjacent_difference(par, nil, nil, nil, binop); + + uninitialized_copy(par, nil, nil, nil); + uninitialized_copy_n(par, nil, zero, nil); + uninitialized_move(par, nil, nil, nil); + uninitialized_move_n(par, nil, zero, nil); + uninitialized_fill(par, nil, nil, val); + uninitialized_fill_n(par, nil, zero, val); #endif // __cpp_lib_execution #ifdef __cpp_lib_concepts From 0185169f6eb664437d48f0bed6e1db76b8d2c630 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 18:06:58 -0800 Subject: [PATCH 11/20] Test classic `lexicographical_compare_three_way`. --- .../test.compile.pass.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index d5a1f75038..60b04e8a91 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -25,11 +25,15 @@ struct Val { explicit Val(const RRef&); Val& operator=(const RRef&); bool operator==(const Val&) const; +#if _HAS_CXX20 + strong_ordering operator<=>(const Val&) const; +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv bool operator!=(const Val&) const; bool operator<(const Val&) const; bool operator<=(const Val&) const; bool operator>(const Val&) const; bool operator>=(const Val&) const; +#endif // ^^^ !_HAS_CXX20 ^^^ Val& operator++(); Val operator++(int); }; @@ -96,6 +100,9 @@ void test_gh_4109() { #endif // _HAS_AUTO_PTR_ETC Val (*unop)(Val) = nullptr; Val (*binop)(Val, Val) = nullptr; +#ifdef __cpp_lib_concepts + strong_ordering (*comp_three_way)(Val, Val) = nullptr; +#endif // __cpp_lib_concepts (void) all_of(nil, nil, pred); (void) any_of(nil, nil, pred); @@ -287,6 +294,10 @@ void test_gh_4109() { (void) lexicographical_compare(nil, nil, nil, nil, comp); (void) lexicographical_compare(begin(arr), end(arr), nil, nil, comp); (void) lexicographical_compare(nil, nil, begin(arr), end(arr), comp); +#ifdef __cpp_lib_concepts + (void) lexicographical_compare_three_way(nil, nil, nil, nil); + (void) lexicographical_compare_three_way(nil, nil, nil, nil, comp_three_way); +#endif // __cpp_lib_concepts next_permutation(nil, nil); next_permutation(nil, nil, comp); prev_permutation(nil, nil); From efe441d4654b57ec467874c49a696e3c74260b91 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 18:22:36 -0800 Subject: [PATCH 12/20] `comp` => `pred2` when we aren't using less-than comparisons. --- .../test.compile.pass.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index 60b04e8a91..16ec231b35 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -341,9 +341,9 @@ void test_gh_4109() { (void) find_if(par, nil, nil, pred); (void) find_if_not(par, nil, nil, pred); (void) find_end(par, nil, nil, nil, nil); - (void) find_end(par, nil, nil, nil, nil, comp); + (void) find_end(par, nil, nil, nil, nil, pred2); (void) find_first_of(par, nil, nil, nil, nil); - (void) find_first_of(par, nil, nil, nil, nil, comp); + (void) find_first_of(par, nil, nil, nil, nil, pred2); (void) adjacent_find(par, nil, nil); (void) adjacent_find(par, nil, nil, pred2); (void) count(par, nil, nil, val); @@ -391,9 +391,9 @@ void test_gh_4109() { remove_copy(par, nil, nil, nil, val); remove_copy_if(par, nil, nil, nil, pred); (void) unique(par, nil, nil); - (void) unique(par, nil, nil, comp); + (void) unique(par, nil, nil, pred2); unique_copy(par, nil, nil, nil); - unique_copy(par, nil, nil, nil, comp); + unique_copy(par, nil, nil, nil, pred2); reverse(par, nil, nil); reverse_copy(par, nil, nil, nil); rotate(par, nil, nil, nil); From e4bfa4e336b6e18aba79ee6118cd57cbb4383793 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 18:23:09 -0800 Subject: [PATCH 13/20] Test `ranges::nth_element` with optional `comp`. --- .../test.compile.pass.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index 16ec231b35..ba2a44352b 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -622,6 +622,7 @@ void test_gh_4109() { ranges::stable_sort(nil, nil, comp); ranges::nth_element(nil, nil, nil); + ranges::nth_element(nil, nil, nil, comp); // Binary search operations (on sorted ranges) (void) ranges::lower_bound(nil, nil, val); From 28523b0d1f81ca083186ed8ce3f487ff8a449215 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 18:57:40 -0800 Subject: [PATCH 14/20] Follow N4971 synopsis order. Adjust newlines/comments, no other changes. --- .../test.compile.pass.cpp | 246 ++++++------------ 1 file changed, 76 insertions(+), 170 deletions(-) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index ba2a44352b..d9dbef0ed0 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -212,13 +212,6 @@ void test_gh_4109() { shift_left(nil, nil, 1729); shift_right(nil, nil, 1729); #endif // _HAS_CXX20 - (void) is_partitioned(nil, nil, pred); - partition(nil, nil, pred); - stable_partition(nil, nil, pred); - partition_copy(nil, nil, nil, nil, pred); - partition_copy(begin(arr), end(arr), begin(res), nil, &always_true); - partition_copy(begin(arr), end(arr), nil, begin(res), &always_false); - (void) partition_point(nil, nil, pred); sort(nil, nil); sort(nil, nil, comp); sort(begin(arr), begin(arr) + 1); @@ -249,6 +242,13 @@ void test_gh_4109() { (void) equal_range(nil, nil, val, comp); (void) binary_search(nil, nil, val); (void) binary_search(nil, nil, val, comp); + (void) is_partitioned(nil, nil, pred); + partition(nil, nil, pred); + stable_partition(nil, nil, pred); + partition_copy(nil, nil, nil, nil, pred); + partition_copy(begin(arr), end(arr), begin(res), nil, &always_true); + partition_copy(begin(arr), end(arr), nil, begin(res), &always_false); + (void) partition_point(nil, nil, pred); merge(nil, nil, nil, nil, nil); merge(nil, nil, nil, nil, nil, comp); inplace_merge(nil, nil, nil); @@ -275,7 +275,6 @@ void test_gh_4109() { (void) is_heap(nil, nil, comp); (void) is_heap_until(nil, nil); (void) is_heap_until(nil, nil, comp); - (void) min_element(nil, nil); (void) min_element(nil, nil, comp); (void) min_element(begin(arr), begin(arr) + 1); @@ -302,6 +301,7 @@ void test_gh_4109() { next_permutation(nil, nil, comp); prev_permutation(nil, nil); prev_permutation(nil, nil, comp); + (void) accumulate(nil, nil, val, binop); #if _HAS_CXX17 (void) reduce(nil, nil, val, binop); @@ -322,6 +322,7 @@ void test_gh_4109() { #endif // _HAS_CXX17 adjacent_difference(nil, nil, nil, binop); iota(nil, nil, val); + uninitialized_copy(nil, nil, nil); uninitialized_copy_n(nil, zero, nil); #if _HAS_CXX17 @@ -370,10 +371,9 @@ void test_gh_4109() { (void) search_n(par, nil, nil, 5, val); (void) search_n(par, nil, nil, zero, val, pred2); (void) search_n(par, nil, nil, 5, val, pred2); - copy(par, nil, nil, nil); - copy_if(par, nil, nil, nil, pred); copy_n(par, nil, zero, nil); + copy_if(par, nil, nil, nil, pred); move(par, nil, nil, nil); swap_ranges(par, nil, nil, nil); transform(par, nil, nil, nil, unop); @@ -398,7 +398,10 @@ void test_gh_4109() { reverse_copy(par, nil, nil, nil); rotate(par, nil, nil, nil); rotate_copy(par, nil, nil, nil, nil); - +#if _HAS_CXX20 + shift_left(par, nil, nil, 1729); + shift_right(par, nil, nil, 1729); +#endif // _HAS_CXX20 sort(par, begin(arr), begin(arr) + 1); sort(par, begin(arr), begin(arr) + 1, comp); sort(par, nil, nil); @@ -415,25 +418,16 @@ void test_gh_4109() { (void) is_sorted(par, nil, nil, comp); (void) is_sorted_until(par, nil, nil); (void) is_sorted_until(par, nil, nil, comp); - nth_element(par, nil, nil, nil); nth_element(par, nil, nil, nil, comp); - -#if _HAS_CXX20 - shift_left(par, nil, nil, 1729); - shift_right(par, nil, nil, 1729); -#endif // _HAS_CXX20 - + (void) is_partitioned(par, nil, nil, pred); partition(par, nil, nil, pred); - partition_copy(par, nil, nil, nil, nil, pred); stable_partition(par, nil, nil, pred); - (void) is_partitioned(par, nil, nil, pred); - + partition_copy(par, nil, nil, nil, nil, pred); merge(par, nil, nil, nil, nil, nil); merge(par, nil, nil, nil, nil, nil, comp); inplace_merge(par, nil, nil, nil); inplace_merge(par, nil, nil, nil, comp); - (void) includes(par, nil, nil, nil, nil); (void) includes(par, nil, nil, nil, nil, comp); set_union(par, nil, nil, nil, nil, nil); @@ -444,32 +438,26 @@ void test_gh_4109() { set_difference(par, nil, nil, nil, nil, nil, comp); set_symmetric_difference(par, nil, nil, nil, nil, nil); set_symmetric_difference(par, nil, nil, nil, nil, nil, comp); - (void) is_heap(par, nil, nil); (void) is_heap(par, nil, nil, comp); (void) is_heap_until(par, nil, nil); (void) is_heap_until(par, nil, nil, comp); - (void) min_element(par, nil, nil); (void) min_element(par, nil, nil, comp); (void) max_element(par, nil, nil); (void) max_element(par, nil, nil, comp); (void) minmax_element(par, nil, nil); (void) minmax_element(par, nil, nil, comp); - (void) lexicographical_compare(par, nil, nil, nil, nil); (void) lexicographical_compare(par, nil, nil, nil, nil, comp); (void) reduce(par, nil, nil, val, binop); - (void) transform_reduce(par, nil, nil, nil, val, binop, binop); (void) transform_reduce(par, nil, nil, val, binop, unop); - exclusive_scan(par, nil, nil, nil, val, binop); inclusive_scan(par, nil, nil, nil, binop, val); transform_exclusive_scan(par, nil, nil, nil, val, binop, unop); transform_inclusive_scan(par, nil, nil, nil, binop, unop, val); - adjacent_difference(par, nil, nil, nil, binop); uninitialized_copy(par, nil, nil, nil); @@ -485,216 +473,148 @@ void test_gh_4109() { (void) ranges::all_of(nil, nil, pred); (void) ranges::any_of(nil, nil, pred); (void) ranges::none_of(nil, nil, pred); - +#if _HAS_CXX23 + (void) ranges::contains(nil, nil, val); + (void) ranges::contains_subrange(nil, nil, nil, nil); +#endif // _HAS_CXX23 ranges::for_each(nil, nil, pred); ranges::for_each_n(nil, zero, pred); - - (void) ranges::count(nil, nil, val); - (void) ranges::count_if(nil, nil, pred); - - (void) ranges::mismatch(nil, nil, nil, nil); - (void) ranges::mismatch(nil, nil, nil, nil, pred2); - - (void) ranges::equal(nil, nil, nil, nil); - (void) ranges::equal(nil, nil, nil, nil, pred2); - - (void) ranges::lexicographical_compare(nil, nil, nil, nil); - (void) ranges::lexicographical_compare(nil, nil, nil, nil, comp); - (void) ranges::find(nil, nil, val); (void) ranges::find_if(nil, nil, pred); (void) ranges::find_if_not(nil, nil, pred); - #if _HAS_CXX23 (void) ranges::find_last(nil, nil, val); (void) ranges::find_last_if(nil, nil, pred); (void) ranges::find_last_if_not(nil, nil, pred); #endif // _HAS_CXX23 - (void) ranges::find_end(nil, nil, nil, nil); (void) ranges::find_end(nil, nil, nil, nil, pred2); - (void) ranges::find_first_of(nil, nil, nil, nil); (void) ranges::find_first_of(nil, nil, nil, nil, pred2); - (void) ranges::adjacent_find(nil, nil); (void) ranges::adjacent_find(nil, nil, pred2); - + (void) ranges::count(nil, nil, val); + (void) ranges::count_if(nil, nil, pred); + (void) ranges::mismatch(nil, nil, nil, nil); + (void) ranges::mismatch(nil, nil, nil, nil, pred2); + (void) ranges::equal(nil, nil, nil, nil); + (void) ranges::equal(nil, nil, nil, nil, pred2); + (void) ranges::is_permutation(nil, nil, nil, nil); + (void) ranges::is_permutation(nil, nil, nil, nil, pred2); (void) ranges::search(nil, nil, nil, nil); (void) ranges::search(nil, nil, nil, nil, pred2); - (void) ranges::search_n(nil, nil, zero, val); (void) ranges::search_n(nil, nil, zero, val, pred2); - #if _HAS_CXX23 - (void) ranges::contains(nil, nil, val); - (void) ranges::contains_subrange(nil, nil, nil, nil); - (void) ranges::starts_with(nil, nil, nil, nil); (void) ranges::starts_with(nil, nil, nil, nil, pred2); - (void) ranges::ends_with(nil, nil, nil, nil); (void) ranges::ends_with(nil, nil, nil, nil, pred2); + (void) ranges::fold_left(nil, nil, val, binop); + (void) ranges::fold_left_first(nil, nil, binop); + (void) ranges::fold_right(nil, nil, val, binop); + (void) ranges::fold_right_last(nil, nil, binop); + (void) ranges::fold_left_with_iter(nil, nil, val, binop); + (void) ranges::fold_left_first_with_iter(nil, nil, binop); #endif // _HAS_CXX23 - - // Modifying sequence operations ranges::copy(nil, nil, nil); - ranges::copy_if(nil, nil, nil, pred); - ranges::copy_n(nil, zero, nil); - + ranges::copy_if(nil, nil, nil, pred); ranges::copy_backward(nil, nil, nil); - ranges::move(nil, nil, nil); - ranges::move_backward(nil, nil, nil); - - ranges::fill(nil, nil, val); - - ranges::fill_n(nil, zero, val); - + ranges::swap_ranges(nil, nil, nil, nil); ranges::transform(nil, nil, nil, unop); ranges::transform(nil, nil, nil, nil, nil, binop); - + ranges::replace(nil, nil, val, val); + ranges::replace_if(nil, nil, pred, val); + ranges::replace_copy(nil, nil, nil, val, val); + ranges::replace_copy_if(nil, nil, nil, pred, val); + ranges::fill(nil, nil, val); + ranges::fill_n(nil, zero, val); ranges::generate(nil, nil, gen); - ranges::generate_n(nil, zero, gen); - (void) ranges::remove(nil, nil, val); (void) ranges::remove_if(nil, nil, pred); - ranges::remove_copy(nil, nil, nil, val); ranges::remove_copy_if(nil, nil, nil, pred); - - ranges::replace(nil, nil, val, val); - ranges::replace_if(nil, nil, pred, val); - - ranges::replace_copy(nil, nil, nil, val, val); - ranges::replace_copy_if(nil, nil, nil, pred, val); - - ranges::swap_ranges(nil, nil, nil, nil); - + (void) ranges::unique(nil, nil); + (void) ranges::unique(nil, nil, pred2); + ranges::unique_copy(nil, nil, nil); + ranges::unique_copy(nil, nil, nil, pred2); ranges::reverse(nil, nil); ranges::reverse_copy(nil, nil, nil); - ranges::rotate(nil, nil, nil); ranges::rotate_copy(nil, nil, nil, nil); - + ranges::sample(nil, nil, nil, zero, urbg); ranges::shuffle(nil, nil, urbg); - #if _HAS_CXX23 ranges::shift_left(nil, nil, 1729); ranges::shift_right(nil, nil, 1729); #endif // _HAS_CXX23 - - ranges::sample(nil, nil, nil, zero, urbg); - - (void) ranges::unique(nil, nil); - (void) ranges::unique(nil, nil, pred2); - - ranges::unique_copy(nil, nil, nil); - ranges::unique_copy(nil, nil, nil, pred2); - - // Partitioning operations - (void) ranges::is_partitioned(nil, nil, pred); - ranges::partition(nil, nil, pred); - ranges::partition_copy(nil, nil, nil, nil, pred); - ranges::stable_partition(nil, nil, pred); - (void) ranges::partition_point(nil, nil, pred); - - // Sorting operations - (void) ranges::is_sorted(nil, nil); - (void) ranges::is_sorted(nil, nil, comp); - - (void) ranges::is_sorted_until(nil, nil); - (void) ranges::is_sorted_until(nil, nil, comp); - ranges::sort(nil, nil); ranges::sort(nil, nil, comp); - + ranges::stable_sort(nil, nil); + ranges::stable_sort(nil, nil, comp); ranges::partial_sort(nil, nil, nil); ranges::partial_sort(nil, nil, nil, comp); - ranges::partial_sort_copy(nil, nil, nil, nil); ranges::partial_sort_copy(nil, nil, nil, nil, comp); - - ranges::stable_sort(nil, nil); - ranges::stable_sort(nil, nil, comp); - + (void) ranges::is_sorted(nil, nil); + (void) ranges::is_sorted(nil, nil, comp); + (void) ranges::is_sorted_until(nil, nil); + (void) ranges::is_sorted_until(nil, nil, comp); ranges::nth_element(nil, nil, nil); ranges::nth_element(nil, nil, nil, comp); - - // Binary search operations (on sorted ranges) (void) ranges::lower_bound(nil, nil, val); (void) ranges::lower_bound(nil, nil, val, comp); - (void) ranges::upper_bound(nil, nil, val); (void) ranges::upper_bound(nil, nil, val, comp); - - (void) ranges::binary_search(nil, nil, val); - (void) ranges::binary_search(nil, nil, val, comp); - (void) ranges::equal_range(nil, nil, val); (void) ranges::equal_range(nil, nil, val, comp); - - // Set operations (on sorted ranges) + (void) ranges::binary_search(nil, nil, val); + (void) ranges::binary_search(nil, nil, val, comp); + (void) ranges::is_partitioned(nil, nil, pred); + ranges::partition(nil, nil, pred); + ranges::stable_partition(nil, nil, pred); + ranges::partition_copy(nil, nil, nil, nil, pred); + (void) ranges::partition_point(nil, nil, pred); ranges::merge(nil, nil, nil, nil, nil); ranges::merge(nil, nil, nil, nil, nil, comp); - ranges::inplace_merge(nil, nil, nil); ranges::inplace_merge(nil, nil, nil, comp); - (void) ranges::includes(nil, nil, nil, nil); (void) ranges::includes(nil, nil, nil, nil, comp); - - ranges::set_difference(nil, nil, nil, nil, nil); - ranges::set_difference(nil, nil, nil, nil, nil, comp); - + ranges::set_union(nil, nil, nil, nil, nil); + ranges::set_union(nil, nil, nil, nil, nil, comp); ranges::set_intersection(nil, nil, nil, nil, nil); ranges::set_intersection(nil, nil, nil, nil, nil, comp); - + ranges::set_difference(nil, nil, nil, nil, nil); + ranges::set_difference(nil, nil, nil, nil, nil, comp); ranges::set_symmetric_difference(nil, nil, nil, nil, nil); ranges::set_symmetric_difference(nil, nil, nil, nil, nil, comp); - - ranges::set_union(nil, nil, nil, nil, nil); - ranges::set_union(nil, nil, nil, nil, nil, comp); - - // Heap operations - (void) ranges::is_heap(nil, nil); - (void) ranges::is_heap(nil, nil, comp); - - (void) ranges::is_heap_until(nil, nil); - (void) ranges::is_heap_until(nil, nil, comp); - - ranges::make_heap(nil, nil); - ranges::make_heap(nil, nil, comp); - ranges::push_heap(nil, nil); ranges::push_heap(nil, nil, comp); - ranges::pop_heap(nil, nil); ranges::pop_heap(nil, nil, comp); - + ranges::make_heap(nil, nil); + ranges::make_heap(nil, nil, comp); ranges::sort_heap(nil, nil); ranges::sort_heap(nil, nil, comp); - - // Minimum/maximum operations - (void) ranges::max_element(nil, nil); - (void) ranges::max_element(nil, nil, comp); - + (void) ranges::is_heap(nil, nil); + (void) ranges::is_heap(nil, nil, comp); + (void) ranges::is_heap_until(nil, nil); + (void) ranges::is_heap_until(nil, nil, comp); (void) ranges::min_element(nil, nil); (void) ranges::min_element(nil, nil, comp); - + (void) ranges::max_element(nil, nil); + (void) ranges::max_element(nil, nil, comp); (void) ranges::minmax_element(nil, nil); (void) ranges::minmax_element(nil, nil, comp); - - // Permutation operations - (void) ranges::is_permutation(nil, nil, nil, nil); - (void) ranges::is_permutation(nil, nil, nil, nil, pred2); - + (void) ranges::lexicographical_compare(nil, nil, nil, nil); + (void) ranges::lexicographical_compare(nil, nil, nil, nil, comp); ranges::next_permutation(nil, nil); ranges::next_permutation(nil, nil, comp); - ranges::prev_permutation(nil, nil); ranges::prev_permutation(nil, nil, comp); @@ -703,28 +623,14 @@ void test_gh_4109() { ranges::iota(nil, nil, val); #endif // _HAS_CXX23 - // Constrained fold operations -#if _HAS_CXX23 - (void) ranges::fold_left(nil, nil, val, binop); - (void) ranges::fold_left_first(nil, nil, binop); - (void) ranges::fold_right(nil, nil, val, binop); - (void) ranges::fold_right_last(nil, nil, binop); - (void) ranges::fold_left_with_iter(nil, nil, val, binop); - (void) ranges::fold_left_first_with_iter(nil, nil, binop); -#endif // _HAS_CXX23 - // Constrained uninitialized memory algorithms ranges::uninitialized_copy(nil, nil, nil, nil); ranges::uninitialized_copy_n(nil, zero, nil, nil); - - ranges::uninitialized_fill(nil, nil, val); - ranges::uninitialized_fill_n(nil, zero, val); - ranges::uninitialized_move(nil, nil, nil, nil); ranges::uninitialized_move_n(nil, zero, nil, nil); - + ranges::uninitialized_fill(nil, nil, val); + ranges::uninitialized_fill_n(nil, zero, val); ranges::destroy(nil, nil); - ranges::destroy_n(nil, zero); #endif // __cpp_lib_concepts } From 53c88ec219ab71fd77e1842b9589374c001d4c3a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 20:43:10 -0800 Subject: [PATCH 15/20] `using std::execution::par;` in Dev11_0253803_debug_pointer for consistency. --- tests/std/tests/Dev11_0253803_debug_pointer/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/Dev11_0253803_debug_pointer/test.cpp b/tests/std/tests/Dev11_0253803_debug_pointer/test.cpp index a9b67d7556..530f709ebc 100644 --- a/tests/std/tests/Dev11_0253803_debug_pointer/test.cpp +++ b/tests/std/tests/Dev11_0253803_debug_pointer/test.cpp @@ -13,6 +13,7 @@ #ifdef __cpp_lib_execution #include +using std::execution::par; #endif // __cpp_lib_execution using namespace std; @@ -272,7 +273,6 @@ int main() { uninitialized_fill_n(nil, zero, 1729); #ifdef __cpp_lib_execution - using namespace std::execution; (void) all_of(par, nil, nil, pred); (void) any_of(par, nil, nil, pred); (void) none_of(par, nil, nil, pred); From 02398b95a3b19e6df2b216195ec44b8807d69753 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Jan 2024 21:11:27 -0800 Subject: [PATCH 16/20] `always_true`/`always_false` => `pred`, this is compile-only. --- .../test.compile.pass.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index d9dbef0ed0..be4094461b 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -74,14 +74,6 @@ static_assert(random_access_iterator); static_assert(sortable); #endif // __cpp_lib_concepts -bool always_true(Val) { - return true; -} - -bool always_false(Val) { - return false; -} - extern Val arr[3]; extern Val res[3]; extern Val val; @@ -169,7 +161,7 @@ void test_gh_4109() { copy(nil, nil, nil); copy_n(nil, zero, nil); copy_if(nil, nil, nil, pred); - copy_if(begin(arr), end(arr), nil, &always_false); + copy_if(begin(arr), end(arr), nil, pred); copy_backward(nil, nil, nil); move(nil, nil, nil); move_backward(nil, nil, nil); @@ -189,7 +181,7 @@ void test_gh_4109() { remove_copy(nil, nil, nil, val); remove_copy(begin(arr), end(arr), nil, val); remove_copy_if(nil, nil, nil, pred); - remove_copy_if(begin(arr), end(arr), nil, &always_true); + remove_copy_if(begin(arr), end(arr), nil, pred); (void) unique(nil, nil); (void) unique(nil, nil, pred2); (void) unique(begin(arr), begin(arr) + 1); @@ -246,8 +238,8 @@ void test_gh_4109() { partition(nil, nil, pred); stable_partition(nil, nil, pred); partition_copy(nil, nil, nil, nil, pred); - partition_copy(begin(arr), end(arr), begin(res), nil, &always_true); - partition_copy(begin(arr), end(arr), nil, begin(res), &always_false); + partition_copy(begin(arr), end(arr), begin(res), nil, pred); + partition_copy(begin(arr), end(arr), nil, begin(res), pred); (void) partition_point(nil, nil, pred); merge(nil, nil, nil, nil, nil); merge(nil, nil, nil, nil, nil, comp); From 392ca5d4c21aec2c434b87297bdd40f41a11930f Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 18 Jan 2024 16:19:20 -0800 Subject: [PATCH 17/20] No need to test `ranges::destroy`, `ranges::destroy_n`. --- .../test.compile.pass.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index be4094461b..da49e1ab56 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -622,7 +622,5 @@ void test_gh_4109() { ranges::uninitialized_move_n(nil, zero, nil, nil); ranges::uninitialized_fill(nil, nil, val); ranges::uninitialized_fill_n(nil, zero, val); - ranges::destroy(nil, nil); - ranges::destroy_n(nil, zero); #endif // __cpp_lib_concepts } From 1b0bf4bef8c0f1b727b7f6280b2b6e29421eee88 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 18 Jan 2024 16:38:40 -0800 Subject: [PATCH 18/20] Test more overloads of parallel `inclusive_scan` and `transform_inclusive_scan`. --- .../test.compile.pass.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index da49e1ab56..50442be91f 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -447,8 +447,10 @@ void test_gh_4109() { (void) transform_reduce(par, nil, nil, nil, val, binop, binop); (void) transform_reduce(par, nil, nil, val, binop, unop); exclusive_scan(par, nil, nil, nil, val, binop); + inclusive_scan(par, nil, nil, nil, binop); inclusive_scan(par, nil, nil, nil, binop, val); transform_exclusive_scan(par, nil, nil, nil, val, binop, unop); + transform_inclusive_scan(par, nil, nil, nil, binop, unop); transform_inclusive_scan(par, nil, nil, nil, binop, unop, val); adjacent_difference(par, nil, nil, nil, binop); From 16b5c856e831d5e7b9f765dca1c322cf97d8b25d Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 18 Jan 2024 16:40:17 -0800 Subject: [PATCH 19/20] Drop unnecessary argument variations - this is compile-only. --- .../test.compile.pass.cpp | 69 ------------------- 1 file changed, 69 deletions(-) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index 50442be91f..be43fcac28 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -74,8 +74,6 @@ static_assert(random_access_iterator); static_assert(sortable); #endif // __cpp_lib_concepts -extern Val arr[3]; -extern Val res[3]; extern Val val; extern mt19937 urbg; // UniformRandomBitGenerator const int zero = 0; @@ -108,60 +106,31 @@ void test_gh_4109() { (void) find_if_not(nil, nil, pred); (void) find_end(nil, nil, nil, nil); (void) find_end(nil, nil, nil, nil, pred2); - (void) find_end(begin(arr), end(arr), nil, nil); - (void) find_end(begin(arr), end(arr), nil, nil, pred2); - (void) find_end(nil, nil, begin(arr), end(arr)); - (void) find_end(nil, nil, begin(arr), end(arr), pred2); (void) find_first_of(nil, nil, nil, nil); (void) find_first_of(nil, nil, nil, nil, pred2); - (void) find_first_of(begin(arr), end(arr), nil, nil); - (void) find_first_of(begin(arr), end(arr), nil, nil, pred2); - (void) find_first_of(nil, nil, begin(arr), end(arr)); - (void) find_first_of(nil, nil, begin(arr), end(arr), pred2); (void) adjacent_find(nil, nil); (void) adjacent_find(nil, nil, pred2); - (void) adjacent_find(begin(arr), begin(arr) + 1); - (void) adjacent_find(begin(arr), begin(arr) + 1, pred2); (void) count(nil, nil, val); (void) count_if(nil, nil, pred); (void) mismatch(nil, nil, nil); (void) mismatch(nil, nil, nil, pred2); (void) mismatch(nil, nil, nil, nil); (void) mismatch(nil, nil, nil, nil, pred2); - (void) mismatch(begin(arr), end(arr), nil, nil); - (void) mismatch(begin(arr), end(arr), nil, nil, pred2); - (void) mismatch(nil, nil, begin(arr), end(arr)); - (void) mismatch(nil, nil, begin(arr), end(arr), pred2); (void) equal(nil, nil, nil); (void) equal(nil, nil, nil, pred2); (void) equal(nil, nil, nil, nil); (void) equal(nil, nil, nil, nil, pred2); - (void) equal(begin(arr), end(arr), nil, nil); - (void) equal(begin(arr), end(arr), nil, nil, pred2); - (void) equal(nil, nil, begin(arr), end(arr)); - (void) equal(nil, nil, begin(arr), end(arr), pred2); (void) is_permutation(nil, nil, nil); (void) is_permutation(nil, nil, nil, pred2); (void) is_permutation(nil, nil, nil, nil); (void) is_permutation(nil, nil, nil, nil, pred2); - (void) is_permutation(begin(arr), end(arr), nil, nil); - (void) is_permutation(begin(arr), end(arr), nil, nil, pred2); - (void) is_permutation(nil, nil, begin(arr), end(arr)); - (void) is_permutation(nil, nil, begin(arr), end(arr), pred2); (void) search(nil, nil, nil, nil); (void) search(nil, nil, nil, nil, pred2); - (void) search(begin(arr), end(arr), nil, nil); - (void) search(begin(arr), end(arr), nil, nil, pred2); - (void) search(nil, nil, begin(arr), end(arr)); - (void) search(nil, nil, begin(arr), end(arr), pred2); (void) search_n(nil, nil, zero, val); - (void) search_n(nil, nil, 5, val); (void) search_n(nil, nil, zero, val, pred2); - (void) search_n(nil, nil, 5, val, pred2); copy(nil, nil, nil); copy_n(nil, zero, nil); copy_if(nil, nil, nil, pred); - copy_if(begin(arr), end(arr), nil, pred); copy_backward(nil, nil, nil); move(nil, nil, nil); move_backward(nil, nil, nil); @@ -179,13 +148,9 @@ void test_gh_4109() { (void) remove(nil, nil, val); (void) remove_if(nil, nil, pred); remove_copy(nil, nil, nil, val); - remove_copy(begin(arr), end(arr), nil, val); remove_copy_if(nil, nil, nil, pred); - remove_copy_if(begin(arr), end(arr), nil, pred); (void) unique(nil, nil); (void) unique(nil, nil, pred2); - (void) unique(begin(arr), begin(arr) + 1); - (void) unique(begin(arr), begin(arr) + 1, pred2); unique_copy(nil, nil, nil); unique_copy(nil, nil, nil, pred2); reverse(nil, nil); @@ -206,24 +171,16 @@ void test_gh_4109() { #endif // _HAS_CXX20 sort(nil, nil); sort(nil, nil, comp); - sort(begin(arr), begin(arr) + 1); - sort(begin(arr), begin(arr) + 1, comp); stable_sort(nil, nil); stable_sort(nil, nil, comp); - stable_sort(begin(arr), begin(arr) + 1); - stable_sort(begin(arr), begin(arr) + 1, comp); partial_sort(nil, nil, nil); partial_sort(nil, nil, nil, comp); partial_sort_copy(nil, nil, nil, nil); partial_sort_copy(nil, nil, nil, nil, comp); (void) is_sorted(nil, nil); (void) is_sorted(nil, nil, comp); - (void) is_sorted(begin(arr), begin(arr) + 1); - (void) is_sorted(begin(arr), begin(arr) + 1, comp); (void) is_sorted_until(nil, nil); (void) is_sorted_until(nil, nil, comp); - (void) is_sorted_until(begin(arr), begin(arr) + 1); - (void) is_sorted_until(begin(arr), begin(arr) + 1, comp); nth_element(nil, nil, nil); nth_element(nil, nil, nil, comp); (void) lower_bound(nil, nil, val); @@ -238,8 +195,6 @@ void test_gh_4109() { partition(nil, nil, pred); stable_partition(nil, nil, pred); partition_copy(nil, nil, nil, nil, pred); - partition_copy(begin(arr), end(arr), begin(res), nil, pred); - partition_copy(begin(arr), end(arr), nil, begin(res), pred); (void) partition_point(nil, nil, pred); merge(nil, nil, nil, nil, nil); merge(nil, nil, nil, nil, nil, comp); @@ -269,22 +224,12 @@ void test_gh_4109() { (void) is_heap_until(nil, nil, comp); (void) min_element(nil, nil); (void) min_element(nil, nil, comp); - (void) min_element(begin(arr), begin(arr) + 1); - (void) min_element(begin(arr), begin(arr) + 1, comp); (void) max_element(nil, nil); (void) max_element(nil, nil, comp); - (void) max_element(begin(arr), begin(arr) + 1); - (void) max_element(begin(arr), begin(arr) + 1, comp); (void) minmax_element(nil, nil); (void) minmax_element(nil, nil, comp); - (void) minmax_element(begin(arr), begin(arr) + 1); - (void) minmax_element(begin(arr), begin(arr) + 1, comp); (void) lexicographical_compare(nil, nil, nil, nil); - (void) lexicographical_compare(begin(arr), end(arr), nil, nil); - (void) lexicographical_compare(nil, nil, begin(arr), end(arr)); (void) lexicographical_compare(nil, nil, nil, nil, comp); - (void) lexicographical_compare(begin(arr), end(arr), nil, nil, comp); - (void) lexicographical_compare(nil, nil, begin(arr), end(arr), comp); #ifdef __cpp_lib_concepts (void) lexicographical_compare_three_way(nil, nil, nil, nil); (void) lexicographical_compare_three_way(nil, nil, nil, nil, comp_three_way); @@ -345,24 +290,14 @@ void test_gh_4109() { (void) mismatch(par, nil, nil, nil, pred2); (void) mismatch(par, nil, nil, nil, nil); (void) mismatch(par, nil, nil, nil, nil, pred2); - (void) mismatch(par, begin(arr), end(arr), nil, nil); - (void) mismatch(par, begin(arr), end(arr), nil, nil, pred2); - (void) mismatch(par, nil, nil, begin(arr), end(arr)); - (void) mismatch(par, nil, nil, begin(arr), end(arr), pred2); (void) equal(par, nil, nil, nil); (void) equal(par, nil, nil, nil, pred2); (void) equal(par, nil, nil, nil, nil); (void) equal(par, nil, nil, nil, nil, pred2); - (void) equal(par, begin(arr), end(arr), nil, nil); - (void) equal(par, begin(arr), end(arr), nil, nil, pred2); - (void) equal(par, nil, nil, begin(arr), end(arr)); - (void) equal(par, nil, nil, begin(arr), end(arr), pred2); (void) search(par, nil, nil, nil, nil); (void) search(par, nil, nil, nil, nil, pred2); (void) search_n(par, nil, nil, zero, val); - (void) search_n(par, nil, nil, 5, val); (void) search_n(par, nil, nil, zero, val, pred2); - (void) search_n(par, nil, nil, 5, val, pred2); copy(par, nil, nil, nil); copy_n(par, nil, zero, nil); copy_if(par, nil, nil, nil, pred); @@ -394,14 +329,10 @@ void test_gh_4109() { shift_left(par, nil, nil, 1729); shift_right(par, nil, nil, 1729); #endif // _HAS_CXX20 - sort(par, begin(arr), begin(arr) + 1); - sort(par, begin(arr), begin(arr) + 1, comp); sort(par, nil, nil); sort(par, nil, nil, comp); stable_sort(par, nil, nil); stable_sort(par, nil, nil, comp); - stable_sort(par, begin(arr), begin(arr) + 1); - stable_sort(par, begin(arr), begin(arr) + 1, comp); partial_sort(par, nil, nil, nil); partial_sort(par, nil, nil, nil, comp); partial_sort_copy(par, nil, nil, nil, nil); From de4585e0f9d7ec71013e615ecbf3680a0751919d Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Jan 2024 04:18:24 -0800 Subject: [PATCH 20/20] Work around VSO-1946395 "/clr /std:c++20 /Od backend ICE for parallel std::find_end". --- .../test.compile.pass.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp index be43fcac28..08520f59bf 100644 --- a/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp +++ b/tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp @@ -278,8 +278,10 @@ void test_gh_4109() { (void) find(par, nil, nil, val); (void) find_if(par, nil, nil, pred); (void) find_if_not(par, nil, nil, pred); +#ifndef _M_CEE // TRANSITION, VSO-1946395 (void) find_end(par, nil, nil, nil, nil); (void) find_end(par, nil, nil, nil, nil, pred2); +#endif // ^^^ no workaround ^^^ (void) find_first_of(par, nil, nil, nil, nil); (void) find_first_of(par, nil, nil, nil, nil, pred2); (void) adjacent_find(par, nil, nil);