From 3491119f9ba466ed871a789eb91e3b7577e36272 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Wed, 19 Jun 2019 20:15:50 +0000 Subject: [PATCH] [pstl] Remove warnings in tests and headers Mostly unused parameter, unused local typedefs and shadowed declarations. This massaging it necessary if we want to be able to run the tests under the libc++ lit configuration. llvm-svn: 363872 --- pstl/include/pstl/internal/algorithm_impl.h | 5 ++-- .../pstl/internal/parallel_backend_utils.h | 12 ++++----- .../alg.merge/inplace_merge.pass.cpp | 6 ++--- .../std/algorithms/alg.merge/merge.pass.cpp | 2 +- .../alg.copy/copy_if.pass.cpp | 4 +-- .../alg.partitions/is_partitioned.pass.cpp | 2 +- .../alg.partitions/partition.pass.cpp | 8 +++--- .../alg.partitions/partition_copy.pass.cpp | 4 +-- .../alg.reverse/reverse.pass.cpp | 2 +- .../alg.reverse/reverse_copy.pass.cpp | 1 - .../copy_move.pass.cpp | 10 +++---- .../alg.modifying.operations/fill.pass.cpp | 2 +- .../generate.pass.cpp | 10 +++---- .../alg.modifying.operations/remove.pass.cpp | 2 +- .../remove_copy.pass.cpp | 7 ++--- .../alg.modifying.operations/replace.pass.cpp | 14 +++++----- .../replace_copy.pass.cpp | 2 +- .../alg.modifying.operations/rotate.pass.cpp | 4 +-- .../swap_ranges.pass.cpp | 2 +- .../transform_binary.pass.cpp | 9 ++++--- .../unique_copy_equal.pass.cpp | 6 ++--- .../alg.nonmodifying/all_of.pass.cpp | 2 +- .../alg.nonmodifying/any_of.pass.cpp | 2 +- .../alg.nonmodifying/count.pass.cpp | 2 +- .../algorithms/alg.nonmodifying/find.pass.cpp | 2 +- .../alg.nonmodifying/find_end.pass.cpp | 4 +-- .../alg.nonmodifying/find_first_of.pass.cpp | 4 +-- .../alg.nonmodifying/none_of.pass.cpp | 2 +- .../alg.nonmodifying/nth_element.pass.cpp | 4 +-- .../alg.nonmodifying/search_n.pass.cpp | 2 +- .../alg.heap.operations/is_heap.pass.cpp | 5 ++-- .../alg.set.operations/includes.pass.cpp | 4 +-- .../alg.set.operations/set.pass.cpp | 4 +-- .../algorithms/alg.sorting/is_sorted.pass.cpp | 2 +- .../alg.sorting/partial_sort.pass.cpp | 19 +++++++------- .../std/algorithms/alg.sorting/sort.pass.cpp | 6 ++--- .../numeric.ops/adjacent_difference.pass.cpp | 26 +++++++++---------- .../std/numerics/numeric.ops/scan.pass.cpp | 10 ++++--- .../numeric.ops/transform_reduce.pass.cpp | 12 ++++----- .../numeric.ops/transform_scan.pass.cpp | 9 ++++--- .../uninitialized_copy_move.pass.cpp | 2 -- 41 files changed, 118 insertions(+), 119 deletions(-) diff --git a/pstl/include/pstl/internal/algorithm_impl.h b/pstl/include/pstl/internal/algorithm_impl.h index da45b78a61ca..a809873018c7 100644 --- a/pstl/include/pstl/internal/algorithm_impl.h +++ b/pstl/include/pstl/internal/algorithm_impl.h @@ -604,7 +604,6 @@ __find_subrange(_RandomAccessIterator __first, _RandomAccessIterator __last, _Ra return __last; // According to the standard last shall be returned when count < 1 } - auto __n = __global_last - __first; auto __unary_pred = __equal_value_by_pred<_Tp, _BinaryPredicate>(__value, __pred); while (__first != __last && (static_cast<_Size>(__global_last - __first) >= __count)) { @@ -821,7 +820,7 @@ __pattern_search_n(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _Ra _Size __count, const _Tp& __value, _BinaryPredicate __pred, _IsVector __is_vector, /*is_parallel=*/std::true_type) noexcept { - if (__last - __first == __count) + if (static_cast<_Size>(__last - __first) == __count) { const bool __result = !__internal::__pattern_any_of( std::forward<_ExecutionPolicy>(__exec), __first, __last, @@ -2136,7 +2135,7 @@ __pattern_partial_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, const auto __n = __middle - __first; if(__n == 0) return; - + __internal::__except_handler([&]() { __par_backend::__parallel_stable_sort( std::forward<_ExecutionPolicy>(__exec), __first, __last, __comp, diff --git a/pstl/include/pstl/internal/parallel_backend_utils.h b/pstl/include/pstl/internal/parallel_backend_utils.h index 37b6e6965c85..d84496d4b383 100644 --- a/pstl/include/pstl/internal/parallel_backend_utils.h +++ b/pstl/include/pstl/internal/parallel_backend_utils.h @@ -79,8 +79,8 @@ struct __serial_move_merge } else if (__n == 0) { - const auto __i = __zs - __zs_beg; - if (__same_move_seq || __i < __nx) + const auto __j = __zs - __zs_beg; + if (__same_move_seq || __j < __nx) __zs = __move_sequence_x(__ys, __ye, __zs); else __zs = __move_sequence_y(__ys, __ye, __zs); @@ -97,8 +97,8 @@ struct __serial_move_merge ++__zs, --__n; if (++__xs == __xe) { - const auto __i = __zs - __zs_beg; - if (__same_move_seq || __i < __nx) + const auto __j = __zs - __zs_beg; + if (__same_move_seq || __j < __nx) __move_sequence_x(__ys, __ye, __zs); else __move_sequence_y(__ys, __ye, __zs); @@ -106,8 +106,8 @@ struct __serial_move_merge } else if (__n == 0) { - const auto i = __zs - __zs_beg; - if (__same_move_seq || __i < __nx) + const auto __j = __zs - __zs_beg; + if (__same_move_seq || __j < __nx) { __zs = __move_sequence_x(__xs, __xe, __zs); __move_sequence_x(__ys, __ye, __zs); diff --git a/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp b/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp index 7a8d065f0dec..9efe8f8d803b 100644 --- a/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp +++ b/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp @@ -42,8 +42,6 @@ struct test_one_policy operator()(Policy&& exec, BiDirIt1 first1, BiDirIt1 last1, BiDirIt1 first2, BiDirIt1 last2, Size n, Size m, Generator1 generator1, Generator2 generator2, Compare comp) { - - using T = typename std::iterator_traits::value_type; const BiDirIt1 mid1 = std::next(first1, m); fill_data(first1, mid1, generator1); fill_data(mid1, last1, generator2); @@ -60,8 +58,8 @@ struct test_one_policy template typename std::enable_if::value, void>::type - operator()(Policy&& exec, BiDirIt1 first1, BiDirIt1 last1, BiDirIt1 first2, BiDirIt1 last2, Size n, Size m, - Generator1 generator1, Generator2 generator2, Compare comp) + operator()(Policy&&, BiDirIt1, BiDirIt1, BiDirIt1, BiDirIt1, Size, Size, + Generator1, Generator2, Compare) { } }; diff --git a/pstl/test/std/algorithms/alg.merge/merge.pass.cpp b/pstl/test/std/algorithms/alg.merge/merge.pass.cpp index b215beb10af4..5912775f9e37 100644 --- a/pstl/test/std/algorithms/alg.merge/merge.pass.cpp +++ b/pstl/test/std/algorithms/alg.merge/merge.pass.cpp @@ -47,7 +47,7 @@ struct test_merge operator()(Policy&& exec, std::reverse_iterator first1, std::reverse_iterator last1, std::reverse_iterator first2, std::reverse_iterator last2, std::reverse_iterator out_first, std::reverse_iterator out_last, - Compare comp) + Compare) { using namespace std; typedef typename std::iterator_traits>::value_type T; diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp index d2bb83b63270..e0bd44d722f0 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp @@ -42,7 +42,7 @@ struct run_copy_if typename Predicate, typename T> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size n, + OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n, Predicate pred, T trash) { // Cleaning @@ -135,7 +135,7 @@ main() #endif #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN - test(-666, [](const int32_t& x) { return true; }, [](size_t j) { return j; }, false); + test(-666, [](const int32_t&) { return true; }, [](size_t j) { return j; }, false); #endif test_algo_basic_double(run_for_rnd_fw()); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp index 874595f2f142..d2608cf6e435 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp @@ -89,7 +89,7 @@ main() test([](const int32_t x) { return x > 1000; }); test([](const uint16_t x) { return x % 5 < 3; }); #if !_PSTL_ICC_18_TEST_EARLY_EXIT_MONOTONIC_RELEASE_BROKEN && !_PSTL_ICC_19_TEST_IS_PARTITIONED_RELEASE_BROKEN - test>([](const LocalWrapper& x) { return true; }); + test>([](const LocalWrapper&) { return true; }); #endif test_algo_basic_single(run_for_rnd_fw()); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp index 716f6dd3e32d..98b0e516114a 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp @@ -55,7 +55,7 @@ is_equal(Iterator first, Iterator last, Iterator d_first) template typename std::enable_if::value_type>::value, bool>::type -is_equal(Iterator first, Iterator last, Iterator d_first) +is_equal(Iterator, Iterator, Iterator) { return true; } @@ -95,7 +95,7 @@ struct test_one_policy template typename std::enable_if::value, void>::type - operator()(Policy&& exec, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, Size n, + operator()(Policy&& exec, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, Size, UnaryOp unary_op, Generator generator) { // partition @@ -119,8 +119,8 @@ struct test_one_policy } template typename std::enable_if::value, void>::type - operator()(Policy&& exec, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, Size n, - UnaryOp unary_op, Generator generator) + operator()(Policy&&, BiDirIt, BiDirIt, BiDirIt, BiDirIt, Size, + UnaryOp, Generator) { } }; diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp index dfb76e3321cb..6dc993809eab 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp @@ -25,7 +25,7 @@ struct test_partition_copy typename UnaryOp> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator true_first, - OutputIterator true_last, OutputIterator2 false_first, OutputIterator2 false_last, UnaryOp unary_op) + OutputIterator, OutputIterator2 false_first, OutputIterator2, UnaryOp unary_op) { auto actual_ret = std::partition_copy(exec, first, last, true_first, false_first, unary_op); @@ -101,7 +101,7 @@ main() test([](const int32_t value) { return value % 2; }); #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN - test([](const int32_t value) { return true; }); + test([](const int32_t) { return true; }); #endif test([](const float64_t value) { return value > 2 << 6; }); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp index 9d4615c356e2..01330196fc7c 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp @@ -52,7 +52,7 @@ struct test_one_policy template typename std::enable_if::value>::type - operator()(ExecutionPolicy&& exec, Iterator1 data_b, Iterator1 data_e, Iterator2 actual_b, Iterator2 actual_e) + operator()(ExecutionPolicy&&, Iterator1, Iterator1, Iterator2, Iterator2) { } }; diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp index 3edd3e875996..cc2bf186862b 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp @@ -79,7 +79,6 @@ struct test_one_policy { using namespace std; using T = typename iterator_traits::value_type; - using DifferenceType = typename iterator_traits::difference_type; fill(actual_b, actual_e, T(-123)); Iterator1 actual_return = reverse_copy(exec, data_b, data_e, actual_b); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp index 18ba11b1c5d5..cf395eba8015 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp @@ -44,7 +44,7 @@ struct run_copy typename T> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size size, + OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size size, Size n, T trash) { // Cleaning @@ -96,8 +96,8 @@ struct run_move template void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size size, - Size n, T trash) + OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size size, + Size, T trash) { // Cleaning std::fill_n(expected_first, size, trash); @@ -139,8 +139,8 @@ struct run_move> template void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size size, - Size n, Wrapper trash) + OutputIterator out_last, OutputIterator2, OutputIterator2, Size size, + Size, Wrapper trash) { // Cleaning std::fill_n(out_first, size, trash); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp index d54a7defb651..f1ddf5d30957 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp @@ -73,7 +73,7 @@ template void test_fill_by_type(std::size_t n) { - Sequence in(n, [](std::size_t v) -> T { return T(0); }); //fill with zeros + Sequence in(n, [](std::size_t) -> T { return T(0); }); //fill with zeros T value = -1; invoke_on_all_policies(test_fill(), in.begin(), in.end(), value); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp index 185e98c86d2a..89aa004621f7 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp @@ -54,11 +54,11 @@ struct test_generate { Generator_count g; const auto m = n / 2; - auto last = generate_n(exec, first, m, g); - Size count = std::count(first, last, g.default_value()); - EXPECT_TRUE(count == m && last == std::next(first, m), + auto actual_last = generate_n(exec, first, m, g); + Size count = std::count(first, actual_last, g.default_value()); + EXPECT_TRUE(count == m && actual_last == std::next(first, m), "generate_n wrong result for generate_n"); - std::fill(first, last, T(0)); + std::fill(first, actual_last, T(0)); } } }; @@ -69,7 +69,7 @@ test_generate_by_type() { for (size_t n = 0; n <= 100000; n = n < 16 ? n + 1 : size_t(3.1415 * n)) { - Sequence in(n, [](size_t v) -> T { return T(0); }); //fill by zero + Sequence in(n, [](size_t) -> T { return T(0); }); //fill by zero invoke_on_all_policies(test_generate(), in.begin(), in.end(), in.size()); } diff --git a/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp index 010e3c6f6164..6c56729d21ef 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp @@ -132,7 +132,7 @@ int32_t main() { #if !_PSTL_ICC_18_TEST_EARLY_EXIT_MONOTONIC_RELEASE_BROKEN - test(666, 42, [](int32_t val) { return true; }, [](size_t j) { return j; }); + test(666, 42, [](int32_t) { return true; }, [](size_t j) { return j; }); #endif test(666, 2001, [](const int32_t& val) { return val != 2001; }, diff --git a/pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp index 1dabb811fe90..a21afad742f1 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp @@ -22,7 +22,7 @@ struct run_remove_copy typename T> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size n, + OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n, const T& value, T trash) { // Cleaning @@ -30,8 +30,9 @@ struct run_remove_copy std::fill_n(out_first, n, trash); // Run copy_if - auto i = remove_copy(first, last, expected_first, value); - auto k = remove_copy(exec, first, last, out_first, value); + auto i = std::remove_copy(first, last, expected_first, value); + (void)i; + auto k = std::remove_copy(exec, first, last, out_first, value); EXPECT_EQ_N(expected_first, out_first, n, "wrong remove_copy effect"); for (size_t j = 0; j < GuardSize; ++j) { diff --git a/pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp index 9f172a4b97ab..fc5f1533e8c7 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp @@ -21,9 +21,9 @@ struct copy_int { int32_t value; int32_t copied_times = 0; - explicit copy_int(int32_t val = 0) { value = val; } + constexpr explicit copy_int(int32_t val = 0) : value(val) { } - copy_int& + constexpr copy_int& operator=(const copy_int& other) { if (&other == this) @@ -36,7 +36,7 @@ struct copy_int return *this; } - bool + constexpr bool operator==(const copy_int& other) const { return (value == other.value); @@ -81,7 +81,7 @@ struct test_one_policy template bool - check(Iterator1 b, Iterator1 e) + check(Iterator1, Iterator1) { return true; } @@ -102,13 +102,13 @@ test(Pred pred) const std::size_t max_len = 100000; - const T1 value = T1(0); - const T1 new_value = T1(666); + static constexpr T1 value = T1(0); + static constexpr T1 new_value = T1(666); Sequence expected(max_len); Sequence actual(max_len); - Sequence data(max_len, [&value](std::size_t i) { + Sequence data(max_len, [](std::size_t i) { if (i % 3 == 2) { return T1(i); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp index b6700f13e217..da74127765c2 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp @@ -24,7 +24,7 @@ struct test_replace_copy typename Predicate, typename T> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size n, + OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n, Predicate pred, const T& old_value, const T& new_value, T trash) { // Cleaning diff --git a/pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp index 4a4d07229ff3..b4e68736c427 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp @@ -115,7 +115,7 @@ struct test_one_policy !std::is_same::value && std::is_same::value_type, wrapper>::value, bool>::type - check_move(ExecutionPolicy&& exec, Iterator b, Iterator e, Size shift) + check_move(ExecutionPolicy&&, Iterator b, Iterator e, Size shift) { bool result = all_of(b, e, [](wrapper& a) { bool temp = a.move_count > 0; @@ -131,7 +131,7 @@ struct test_one_policy !std::is_same::value && std::is_same::value_type, wrapper>::value), bool>::type - check_move(ExecutionPolicy&& exec, Iterator b, Iterator e, Size shift) + check_move(ExecutionPolicy&&, Iterator, Iterator, Size) { return true; } diff --git a/pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp index 1f4031b4f31e..87472d6a34cb 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp @@ -50,7 +50,7 @@ template struct check_swap { bool - operator()(T& a) + operator()(T&) { return true; } diff --git a/pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp index e440d6708c8e..ef9e1c28a8bd 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp @@ -60,10 +60,11 @@ struct test_one_policy template void - operator()(Policy&& exec, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, - OutputIterator out_first, OutputIterator out_last, BinaryOp op) + operator()(Policy&& exec, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2, + OutputIterator out_first, OutputIterator, BinaryOp op) { - auto orrr = std::transform(exec, first1, last1, first2, out_first, op); + auto result = std::transform(exec, first1, last1, first2, out_first, op); + (void)result; check_and_reset(first1, last1, first2, out_first); } }; @@ -77,7 +78,7 @@ test(Predicate pred) Sequence in1(n, [](size_t k) { return k % 5 != 1 ? 3 * k - 7 : 0; }); Sequence in2(n, [](size_t k) { return k % 7 != 2 ? 5 * k - 5 : 0; }); - Sequence out(n, [](size_t k) { return -1; }); + Sequence out(n, [](size_t) { return -1; }); invoke_on_all_policies(test_one_policy(), in1.begin(), in1.end(), in2.begin(), in2.end(), out.begin(), out.end(), pred); diff --git a/pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp index a3adb20bfc73..9183e3d863aa 100644 --- a/pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp +++ b/pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp @@ -43,7 +43,7 @@ struct run_unique_copy typename Predicate, typename T> void operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2 expected_last, Size n, + OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n, Predicate pred, T trash) { // Cleaning @@ -114,7 +114,7 @@ struct test_non_const }; int32_t -main(int32_t argc, char* argv[]) +main() { test(Number(42, OddTag()), std::equal_to(), [](int32_t j) { return Number(3 * j / 13 ^ (j & 8), OddTag()); }); @@ -122,7 +122,7 @@ main(int32_t argc, char* argv[]) test(float32_t(42), std::equal_to(), [](int32_t j) { return float32_t(5 * j / 23 ^ (j / 7)); }); #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN - test(float32_t(42), [](float32_t x, float32_t y) { return false; }, + test(float32_t(42), [](float32_t, float32_t) { return false; }, [](int32_t j) { return float32_t(j); }, false); #endif diff --git a/pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp index 2ad0c579755c..2e7bdc6942c6 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp @@ -59,7 +59,7 @@ test(size_t bits) { // Sequence of odd values - Sequence in(n, [n, bits](size_t k) { return T(2 * HashBits(n, bits - 1) ^ 1); }); + Sequence in(n, [n, bits](size_t) { return T(2 * HashBits(n, bits - 1) ^ 1); }); // Even value, or false when T is bool. T spike(2 * HashBits(n, bits - 1)); diff --git a/pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp index 9e8cbe56e87c..0afab012bf73 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp @@ -45,7 +45,7 @@ test(size_t bits) { // Sequence of odd values - Sequence in(n, [n, bits](size_t k) { return T(2 * HashBits(n, bits - 1) ^ 1); }); + Sequence in(n, [n, bits](size_t) { return T(2 * HashBits(n, bits - 1) ^ 1); }); // Even value, or false when T is bool. T spike(2 * HashBits(n, bits - 1)); diff --git a/pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp index e1c649dacbe4..952b145997c2 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp @@ -93,7 +93,7 @@ main() { test(42, IsEqual(50, OddTag()), [](int32_t j) { return j; }); #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN - test(42, [](const int32_t& x) { return true; }, [](int32_t j) { return j; }); + test(42, [](const int32_t&) { return true; }, [](int32_t j) { return j; }); #endif test(42, IsEqual(50, OddTag()), [](int32_t j) { return float64_t(j); }); test(Number(42, OddTag()), IsEqual(Number(50, OddTag()), OddTag()), diff --git a/pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp index a5d5b8567de1..35844095ab13 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp @@ -82,7 +82,7 @@ int32_t main() { // Note that the "hit" and "miss" functions here avoid overflow issues. - test(Weird(42, OddTag()), [](int32_t j) { return Number(42, OddTag()); }, // hit + test(Weird(42, OddTag()), [](int32_t) { return Number(42, OddTag()); }, // hit [](int32_t j) { return Number(j == 42 ? 0 : j, OddTag()); }); // miss // Test with value that is equal to two different bit patterns (-0.0 and 0.0) diff --git a/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp index 466314e643d3..8d0d542cc06b 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp @@ -68,8 +68,8 @@ test(const std::size_t bits) const std::size_t max_n1 = 1000; const std::size_t max_n2 = (max_n1 * 10) / 8; - Sequence in(max_n1, [bits](std::size_t k) { return T(2 * HashBits(max_n1, bits - 1) ^ 1); }); - Sequence sub(max_n2, [bits](std::size_t k) { return T(2 * HashBits(max_n1, bits - 1)); }); + Sequence in(max_n1, [bits](std::size_t) { return T(2 * HashBits(max_n1, bits - 1) ^ 1); }); + Sequence sub(max_n2, [bits](std::size_t) { return T(2 * HashBits(max_n1, bits - 1)); }); for (std::size_t n1 = 0; n1 <= max_n1; n1 = n1 <= 16 ? n1 + 1 : size_t(3.1415 * n1)) { std::size_t sub_n[] = {0, 1, 3, n1, (n1 * 10) / 8}; diff --git a/pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp index f0903313f0f1..291cf256045f 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp @@ -56,8 +56,8 @@ test(Predicate pred) const std::size_t max_n1 = 1000; const std::size_t max_n2 = (max_n1 * 10) / 8; - Sequence in1(max_n1, [](std::size_t k) { return T(1); }); - Sequence in2(max_n2, [](std::size_t k) { return T(0); }); + Sequence in1(max_n1, [](std::size_t) { return T(1); }); + Sequence in2(max_n2, [](std::size_t) { return T(0); }); for (std::size_t n1 = 0; n1 <= max_n1; n1 = n1 <= 16 ? n1 + 1 : size_t(3.1415 * n1)) { std::size_t sub_n[] = {0, 1, n1 / 3, n1, (n1 * 10) / 8}; diff --git a/pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp index 3abf7e3bd927..9ee5936e1d3a 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp @@ -45,7 +45,7 @@ test(size_t bits) { // Sequence of odd values - Sequence in(n, [n, bits](size_t k) { return T(2 * HashBits(n, bits - 1) ^ 1); }); + Sequence in(n, [n, bits](size_t) { return T(2 * HashBits(n, bits - 1) ^ 1); }); // Even value, or false when T is bool. T spike(2 * HashBits(n, bits - 1)); diff --git a/pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp index 61fe8d7049d0..0619338fbfd0 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp @@ -111,8 +111,8 @@ struct test_one_policy template typename std::enable_if::value, void>::type - operator()(Policy&& exec, Iterator1 first1, Iterator1 last1, Iterator1 first2, Iterator1 last2, Size n, Size m, - Generator1 generator1, Generator2 generator2, Compare comp) + operator()(Policy&&, Iterator1, Iterator1, Iterator1, Iterator1, Size, Size, + Generator1, Generator2, Compare) { } }; diff --git a/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp b/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp index ac8a422698c6..d5f090260a48 100644 --- a/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp +++ b/pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp @@ -67,7 +67,7 @@ test() } for (auto r : res) { - Sequence in(n1, [](std::size_t k) { return T(0); }); + Sequence in(n1, [](std::size_t) { return T(0); }); std::size_t i = r, isub = 0; for (; i < n1 & isub < n2; ++i, ++isub) in[i] = value; diff --git a/pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp index bfee4bdffda4..28827be9d0af 100644 --- a/pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp @@ -77,13 +77,14 @@ struct test_is_heap const Iterator actual = is_heap_until(exec, first, last, pred); const auto x = std::distance(first, actual); EXPECT_TRUE(expected == actual, "wrong return value from is_heap_until with predicate"); + EXPECT_EQ(x, y, "both iterators should be the same distance away from 'first'"); } } // is_heap, is_heap_until works only with random access iterators template typename std::enable_if::value, void>::type - operator()(Policy&& exec, Iterator first, Iterator last, Predicate pred) + operator()(Policy&&, Iterator, Iterator, Predicate) { } }; @@ -111,7 +112,7 @@ test_is_heap_by_type(Comp comp) invoke_on_all_policies(test_is_heap(), in.cbegin(), in.cend(), comp); } - Sequence in(max_size / 10, [](size_t v) -> T { return T(1); }); + Sequence in(max_size / 10, [](size_t) -> T { return T(1); }); invoke_on_all_policies(test_is_heap(), in.begin(), in.end(), comp); } diff --git a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp index 431ce0d11cdb..cc9b82453c3f 100644 --- a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp @@ -55,8 +55,8 @@ struct test_one_policy template typename std::enable_if::value, void>::type - operator()(Policy&& exec, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, - Compare comp) + operator()(Policy&&, InputIterator1, InputIterator1, InputIterator2, InputIterator2, + Compare) { } }; diff --git a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp index 27e83a1129b8..8ecb0b15bac2 100644 --- a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp @@ -95,8 +95,8 @@ struct test_one_policy template typename std::enable_if::value, void>::type - operator()(Policy&& exec, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, - Compare comp) + operator()(Policy&&, InputIterator1, InputIterator1, InputIterator2, InputIterator2, + Compare) { } }; diff --git a/pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp b/pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp index e7d84f1441a4..19de214270bb 100644 --- a/pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp @@ -65,7 +65,7 @@ test_is_sorted_by_type() invoke_on_all_policies(test_is_sorted(), in0.cbegin(), in0.cend(), std::is_sorted(in0.begin(), in0.end())); //non-descending order - Sequence in1(9, [](size_t v) -> T { return T(0); }); + Sequence in1(9, [](size_t) -> T { return T(0); }); invoke_on_all_policies(test_is_sorted(), in1.begin(), in1.end(), std::is_sorted(in1.begin(), in1.end())); invoke_on_all_policies(test_is_sorted(), in1.cbegin(), in1.cend(), std::is_sorted(in1.begin(), in1.end())); } diff --git a/pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp b/pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp index 701fee2e8676..827290d614e5 100644 --- a/pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp @@ -78,19 +78,18 @@ struct test_brick_partial_sort //checking upper bound number of comparisons; O(p*(last-first)log(middle-first)); where p - number of threads; if (m1 - first > 1) { - auto complex = std::ceil(n * std::log(float32_t(m1 - first))); -#if defined(_PSTL_PAR_BACKEND_TBB) - auto p = tbb::this_task_arena::max_concurrency(); -#else - auto p = 1; -#endif - #ifdef _DEBUG +# if defined(_PSTL_PAR_BACKEND_TBB) + auto p = tbb::this_task_arena::max_concurrency(); +# else + auto p = 1; +# endif + auto complex = std::ceil(n * std::log(float32_t(m1 - first))); if (count_comp > complex * p) { std::cout << "complexity exceeded" << std::endl; } -#endif +#endif // _DEBUG } } } @@ -98,8 +97,8 @@ struct test_brick_partial_sort template typename std::enable_if::value, void>::type - operator()(Policy&& exec, InputIterator first, InputIterator last, InputIterator exp_first, InputIterator exp_last, - Compare compare) + operator()(Policy&&, InputIterator, InputIterator, InputIterator, InputIterator, + Compare) { } }; diff --git a/pstl/test/std/algorithms/alg.sorting/sort.pass.cpp b/pstl/test/std/algorithms/alg.sorting/sort.pass.cpp index 2cdb24fbcaaa..cccc92ec9ff9 100644 --- a/pstl/test/std/algorithms/alg.sorting/sort.pass.cpp +++ b/pstl/test/std/algorithms/alg.sorting/sort.pass.cpp @@ -160,7 +160,7 @@ struct test_sort_with_compare typename std::enable_if::value, void>::type operator()(Policy&& exec, OutputIterator tmp_first, OutputIterator tmp_last, OutputIterator2 expected_first, - OutputIterator2 expected_last, InputIterator first, InputIterator last, Size n, Compare compare) + OutputIterator2 expected_last, InputIterator first, InputIterator, Size n, Compare compare) { using namespace std; copy_n(first, n, expected_first); @@ -187,8 +187,8 @@ struct test_sort_with_compare typename Compare> typename std::enable_if::value, void>::type - operator()(Policy&& exec, OutputIterator tmp_first, OutputIterator tmp_last, OutputIterator2 expected_first, - OutputIterator2 expected_last, InputIterator first, InputIterator last, Size n, Compare compare) + operator()(Policy&&, OutputIterator, OutputIterator, OutputIterator2, + OutputIterator2, InputIterator, InputIterator, Size, Compare) { } }; diff --git a/pstl/test/std/numerics/numeric.ops/adjacent_difference.pass.cpp b/pstl/test/std/numerics/numeric.ops/adjacent_difference.pass.cpp index eb3a48ec3344..57133a35f804 100644 --- a/pstl/test/std/numerics/numeric.ops/adjacent_difference.pass.cpp +++ b/pstl/test/std/numerics/numeric.ops/adjacent_difference.pass.cpp @@ -21,19 +21,19 @@ template struct wrapper { T t; - explicit wrapper(T t_) : t(t_) {} + constexpr explicit wrapper(T t_) : t(t_) {} template - wrapper(const wrapper& a) + constexpr wrapper(const wrapper& a) { t = a.t; } template - void + constexpr void operator=(const wrapper& a) { t = a.t; } - wrapper + constexpr wrapper operator-(const wrapper& a) const { return wrapper(t - a.t); @@ -63,9 +63,11 @@ compute_and_check(Iterator1 first, Iterator1 last, Iterator2 d_first, T, Functio if (first == last) return true; - T2 temp(*first); - if (!compare(temp, *d_first)) - return false; + { + T2 temp(*first); + if (!compare(temp, *d_first)) + return false; + } Iterator1 second = std::next(first); ++d_first; @@ -83,7 +85,7 @@ compute_and_check(Iterator1 first, Iterator1 last, Iterator2 d_first, T, Functio // because we can't be sure it will be strictly equal for floating point types template typename std::enable_if::value, bool>::type -compute_and_check(Iterator1 first, Iterator1 last, Iterator2 d_first, T, Function) +compute_and_check(Iterator1, Iterator1, Iterator2, T, Function) { return true; } @@ -134,16 +136,14 @@ template void test(Pred pred) { - typedef typename Sequence::iterator iterator_type; - const std::size_t max_len = 100000; - const T2 value = T2(77); - const T1 trash = T1(31); + static constexpr T2 value = T2(77); + static constexpr T1 trash = T1(31); Sequence actual(max_len, [](std::size_t i) { return T1(i); }); - Sequence data(max_len, [&value](std::size_t i) { return i % 3 == 2 ? T2(i * i) : value; }); + Sequence data(max_len, [](std::size_t i) { return i % 3 == 2 ? T2(i * i) : value; }); for (std::size_t len = 0; len < max_len; len = len <= 16 ? len + 1 : std::size_t(3.1415 * len)) { diff --git a/pstl/test/std/numerics/numeric.ops/scan.pass.cpp b/pstl/test/std/numerics/numeric.ops/scan.pass.cpp index 6ae02f18b273..42090aa68854 100644 --- a/pstl/test/std/numerics/numeric.ops/scan.pass.cpp +++ b/pstl/test/std/numerics/numeric.ops/scan.pass.cpp @@ -98,12 +98,13 @@ struct test_scan_with_plus template void operator()(Policy&& exec, Iterator1 in_first, Iterator1 in_last, Iterator2 out_first, Iterator2 out_last, - Iterator3 expected_first, Iterator3 expected_last, Size n, T init, T trash) + Iterator3 expected_first, Iterator3, Size n, T init, T trash) { using namespace std; auto orr1 = inclusive ? inclusive_scan_serial(in_first, in_last, expected_first) : exclusive_scan_serial(in_first, in_last, expected_first, init); + (void)orr1; auto orr = inclusive ? inclusive_scan(exec, in_first, in_last, out_first) : exclusive_scan(exec, in_first, in_last, out_first, init); EXPECT_TRUE(out_last == orr, @@ -136,12 +137,13 @@ struct test_scan_with_binary_op typename BinaryOp> typename std::enable_if::value, void>::type operator()(Policy&& exec, Iterator1 in_first, Iterator1 in_last, Iterator2 out_first, Iterator2 out_last, - Iterator3 expected_first, Iterator3 expected_last, Size n, T init, BinaryOp binary_op, T trash) + Iterator3 expected_first, Iterator3, Size n, T init, BinaryOp binary_op, T trash) { using namespace std; auto orr1 = inclusive ? inclusive_scan_serial(in_first, in_last, expected_first, binary_op, init) : exclusive_scan_serial(in_first, in_last, expected_first, init, binary_op); + (void)orr1; auto orr = inclusive ? inclusive_scan(exec, in_first, in_last, out_first, binary_op, init) : exclusive_scan(exec, in_first, in_last, out_first, init, binary_op); @@ -152,8 +154,8 @@ struct test_scan_with_binary_op template typename std::enable_if::value, void>::type - operator()(Policy&& exec, Iterator1 in_first, Iterator1 in_last, Iterator2 out_first, Iterator2 out_last, - Iterator3 expected_first, Iterator3 expected_last, Size n, T init, BinaryOp binary_op, T trash) + operator()(Policy&&, Iterator1, Iterator1, Iterator2, Iterator2, + Iterator3, Iterator3, Size, T, BinaryOp, T) { } }; diff --git a/pstl/test/std/numerics/numeric.ops/transform_reduce.pass.cpp b/pstl/test/std/numerics/numeric.ops/transform_reduce.pass.cpp index 4065e722309d..0262bbd5a21e 100644 --- a/pstl/test/std/numerics/numeric.ops/transform_reduce.pass.cpp +++ b/pstl/test/std/numerics/numeric.ops/transform_reduce.pass.cpp @@ -73,7 +73,7 @@ CheckResults(const T& expected, const T& in) // We need to check correctness only for "int" (for example) except cases // if we have "floating-point type"-specialization void -CheckResults(const float32_t& expected, const float32_t& in) +CheckResults(const float32_t&, const float32_t&) { } @@ -83,7 +83,7 @@ struct test_transform_reduce template void - operator()(Policy&& exec, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, + operator()(Policy&& exec, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2, T init, BinaryOperation1 opB1, BinaryOperation2 opB2, UnaryOp opU) { @@ -118,16 +118,16 @@ int32_t main() { test_by_type(42, std::plus(), std::multiplies(), std::negate(), - [](std::size_t a) -> int32_t { return int32_t(rand() % 1000); }); + [](std::size_t) -> int32_t { return int32_t(rand() % 1000); }); test_by_type(0, [](const int64_t& a, const int64_t& b) -> int64_t { return a | b; }, XOR(), [](const int64_t& x) -> int64_t { return x * 2; }, - [](std::size_t a) -> int64_t { return int64_t(rand() % 1000); }); + [](std::size_t) -> int64_t { return int64_t(rand() % 1000); }); test_by_type(1.0f, std::multiplies(), [](const float32_t& a, const float32_t& b) -> float32_t { return a + b; }, [](const float32_t& x) -> float32_t { return x + 2; }, - [](std::size_t a) -> float32_t { return rand() % 1000; }); + [](std::size_t) -> float32_t { return rand() % 1000; }); test_by_type(MyClass(), std::plus(), std::multiplies(), std::negate(), - [](std::size_t a) -> MyClass { return MyClass(rand() % 1000); }); + [](std::size_t) -> MyClass { return MyClass(rand() % 1000); }); std::cout << done() << std::endl; return 0; diff --git a/pstl/test/std/numerics/numeric.ops/transform_scan.pass.cpp b/pstl/test/std/numerics/numeric.ops/transform_scan.pass.cpp index 01920e1902b6..9b9c8a353035 100644 --- a/pstl/test/std/numerics/numeric.ops/transform_scan.pass.cpp +++ b/pstl/test/std/numerics/numeric.ops/transform_scan.pass.cpp @@ -37,7 +37,7 @@ struct test_transform_scan typename T, typename BinaryOp> typename std::enable_if::value, void>::type operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator expected_first, OutputIterator expected_last, Size n, + OutputIterator out_last, OutputIterator expected_first, OutputIterator, Size n, UnaryOp unary_op, T init, BinaryOp binary_op, T trash) { using namespace std; @@ -64,9 +64,9 @@ struct test_transform_scan template typename std::enable_if::value, void>::type - operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, - OutputIterator out_last, OutputIterator expected_first, OutputIterator expected_last, Size n, - UnaryOp unary_op, T init, BinaryOp binary_op, T trash) + operator()(Policy&&, InputIterator, InputIterator, OutputIterator, + OutputIterator, OutputIterator, OutputIterator, Size, + UnaryOp, T, BinaryOp, T) { } }; @@ -130,6 +130,7 @@ test(UnaryOp unary_op, Out init, BinaryOp binary_op, Out trash) inclusive ? transform_inclusive_scan_serial(in.cbegin(), in.cend(), out.fbegin(), unary_op, init, binary_op) : transform_exclusive_scan_serial(in.cbegin(), in.cend(), out.fbegin(), unary_op, init, binary_op); + (void)result; check_and_reset(expected.begin(), out.begin(), out.size(), trash); invoke_on_all_policies(test_transform_scan(), in.begin(), in.end(), out.begin(), out.end(), expected.begin(), diff --git a/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp b/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp index 979c2e59e1a1..be40f69d5f55 100644 --- a/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp +++ b/pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp @@ -91,8 +91,6 @@ struct test_uninitialized_copy_move operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first, size_t n, /*is_trivial=*/std::true_type) { - typedef typename std::iterator_traits::value_type T; - std::uninitialized_copy(exec, first, last, out_first); EXPECT_TRUE(IsCheckValueCorrectness(first, out_first, n), "wrong uninitialized_copy"); std::destroy_n(exec, out_first, n);