aboutsummaryrefslogtreecommitdiff
path: root/pstl
diff options
context:
space:
mode:
Diffstat (limited to 'pstl')
-rw-r--r--pstl/include/pstl/internal/algorithm_impl.h5
-rw-r--r--pstl/include/pstl/internal/parallel_backend_utils.h12
-rw-r--r--pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp6
-rw-r--r--pstl/test/std/algorithms/alg.merge/merge.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp4
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp8
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp4
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp1
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp10
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp10
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp7
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp14
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp4
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp9
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp6
-rw-r--r--pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp4
-rw-r--r--pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp4
-rw-r--r--pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp4
-rw-r--r--pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp5
-rw-r--r--pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp4
-rw-r--r--pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp4
-rw-r--r--pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp2
-rw-r--r--pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp17
-rw-r--r--pstl/test/std/algorithms/alg.sorting/sort.pass.cpp6
-rw-r--r--pstl/test/std/numerics/numeric.ops/adjacent_difference.pass.cpp26
-rw-r--r--pstl/test/std/numerics/numeric.ops/scan.pass.cpp10
-rw-r--r--pstl/test/std/numerics/numeric.ops/transform_reduce.pass.cpp12
-rw-r--r--pstl/test/std/numerics/numeric.ops/transform_scan.pass.cpp9
-rw-r--r--pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp2
41 files changed, 117 insertions, 118 deletions
diff --git a/pstl/include/pstl/internal/algorithm_impl.h b/pstl/include/pstl/internal/algorithm_impl.h
index da45b78..a809873 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 37b6e69..d84496d 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 7a8d065..9efe8f8 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<BiDirIt1>::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 Policy, typename BiDirIt1, typename Size, typename Generator1, typename Generator2,
typename Compare>
typename std::enable_if<is_same_iterator_category<BiDirIt1, std::forward_iterator_tag>::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 b215beb..5912775 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<InputIterator1> first1, std::reverse_iterator<InputIterator1> last1,
std::reverse_iterator<InputIterator2> first2, std::reverse_iterator<InputIterator2> last2,
std::reverse_iterator<OutputIterator> out_first, std::reverse_iterator<OutputIterator> out_last,
- Compare comp)
+ Compare)
{
using namespace std;
typedef typename std::iterator_traits<std::reverse_iterator<InputIterator1>>::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 d2bb83b..e0bd44d 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<int32_t>(-666, [](const int32_t& x) { return true; }, [](size_t j) { return j; }, false);
+ test<int32_t>(-666, [](const int32_t&) { return true; }, [](size_t j) { return j; }, false);
#endif
test_algo_basic_double<int32_t>(run_for_rnd_fw<test_non_const>());
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 874595f..d2608cf 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<int32_t>([](const int32_t x) { return x > 1000; });
test<uint16_t>([](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<LocalWrapper<float64_t>>([](const LocalWrapper<float64_t>& x) { return true; });
+ test<LocalWrapper<float64_t>>([](const LocalWrapper<float64_t>&) { return true; });
#endif
test_algo_basic_single<int32_t>(run_for_rnd_fw<test_non_const>());
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 716f6dd..98b0e51 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 Iterator>
typename std::enable_if<!std::is_trivial<typename std::iterator_traits<Iterator>::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 Policy, typename BiDirIt, typename Size, typename UnaryOp, typename Generator>
typename std::enable_if<!is_same_iterator_category<BiDirIt, std::forward_iterator_tag>::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 Policy, typename BiDirIt, typename Size, typename UnaryOp, typename Generator>
typename std::enable_if<is_same_iterator_category<BiDirIt, std::forward_iterator_tag>::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 dfb76e3..6dc9938 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<int32_t>([](const int32_t value) { return value % 2; });
#if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN
- test<int32_t>([](const int32_t value) { return true; });
+ test<int32_t>([](const int32_t) { return true; });
#endif
test<float64_t>([](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 9d4615c..0133019 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 ExecutionPolicy, typename Iterator1, typename Iterator2>
typename std::enable_if<is_same_iterator_category<Iterator1, std::forward_iterator_tag>::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 3edd3e8..cc2bf18 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<Iterator1>::value_type;
- using DifferenceType = typename iterator_traits<Iterator1>::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 18ba11b..cf395eb 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 <typename Policy, typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size>
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<Wrapper<T>>
template <typename Policy, typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size>
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<T> trash)
+ OutputIterator out_last, OutputIterator2, OutputIterator2, Size size,
+ Size, Wrapper<T> 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 d54a7de..f1ddf5d 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 <typename T>
void
test_fill_by_type(std::size_t n)
{
- Sequence<T> in(n, [](std::size_t v) -> T { return T(0); }); //fill with zeros
+ Sequence<T> 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 185e98c..89aa004 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<T> 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<T> in(n, [](size_t v) -> T { return T(0); }); //fill by zero
+ Sequence<T> 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 010e3c6..6c56729 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<int32_t>(666, 42, [](int32_t val) { return true; }, [](size_t j) { return j; });
+ test<int32_t>(666, 42, [](int32_t) { return true; }, [](size_t j) { return j; });
#endif
test<int32_t>(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 1dabb81..a21afad 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 9f172a4..fc5f153 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 <typename T, typename Iterator1>
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<T2> expected(max_len);
Sequence<T2> actual(max_len);
- Sequence<T2> data(max_len, [&value](std::size_t i) {
+ Sequence<T2> 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 b6700f1..da74127 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 4a4d072..b4e6873 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<ExecutionPolicy, std::execution::sequenced_policy>::value &&
std::is_same<typename std::iterator_traits<Iterator>::value_type, wrapper<float32_t>>::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<float32_t>& a) {
bool temp = a.move_count > 0;
@@ -131,7 +131,7 @@ struct test_one_policy
!std::is_same<ExecutionPolicy, std::execution::sequenced_policy>::value &&
std::is_same<typename std::iterator_traits<Iterator>::value_type, wrapper<float32_t>>::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 1f4031b..87472d6 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 <typename T>
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 e440d67..ef9e1c2 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 <typename Policy, typename InputIterator1, typename InputIterator2, typename OutputIterator,
typename BinaryOp>
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> in1(n, [](size_t k) { return k % 5 != 1 ? 3 * k - 7 : 0; });
Sequence<In2> in2(n, [](size_t k) { return k % 7 != 2 ? 5 * k - 5 : 0; });
- Sequence<Out> out(n, [](size_t k) { return -1; });
+ Sequence<Out> 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 a3adb20..9183e3d 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>(Number(42, OddTag()), std::equal_to<Number>(),
[](int32_t j) { return Number(3 * j / 13 ^ (j & 8), OddTag()); });
@@ -122,7 +122,7 @@ main(int32_t argc, char* argv[])
test<float32_t>(float32_t(42), std::equal_to<float32_t>(),
[](int32_t j) { return float32_t(5 * j / 23 ^ (j / 7)); });
#if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN
- test<float32_t>(float32_t(42), [](float32_t x, float32_t y) { return false; },
+ test<float32_t>(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 2ad0c57..2e7bdc6 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<T> in(n, [n, bits](size_t k) { return T(2 * HashBits(n, bits - 1) ^ 1); });
+ Sequence<T> 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 9e8cbe5..0afab01 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<T> in(n, [n, bits](size_t k) { return T(2 * HashBits(n, bits - 1) ^ 1); });
+ Sequence<T> 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 e1c649d..952b145 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<int32_t>(42, IsEqual<int32_t>(50, OddTag()), [](int32_t j) { return j; });
#if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN
- test<int32_t>(42, [](const int32_t& x) { return true; }, [](int32_t j) { return j; });
+ test<int32_t>(42, [](const int32_t&) { return true; }, [](int32_t j) { return j; });
#endif
test<float64_t>(42, IsEqual<float64_t>(50, OddTag()), [](int32_t j) { return float64_t(j); });
test<Number>(Number(42, OddTag()), IsEqual<Number>(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 a5d5b85..3584409 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<Number>(Weird(42, OddTag()), [](int32_t j) { return Number(42, OddTag()); }, // hit
+ test<Number>(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 466314e..8d0d542 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<T> in(max_n1, [bits](std::size_t k) { return T(2 * HashBits(max_n1, bits - 1) ^ 1); });
- Sequence<T> sub(max_n2, [bits](std::size_t k) { return T(2 * HashBits(max_n1, bits - 1)); });
+ Sequence<T> in(max_n1, [bits](std::size_t) { return T(2 * HashBits(max_n1, bits - 1) ^ 1); });
+ Sequence<T> 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 f090331..291cf25 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<T> in1(max_n1, [](std::size_t k) { return T(1); });
- Sequence<T> in2(max_n2, [](std::size_t k) { return T(0); });
+ Sequence<T> in1(max_n1, [](std::size_t) { return T(1); });
+ Sequence<T> 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 3abf7e3..9ee5936 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<T> in(n, [n, bits](size_t k) { return T(2 * HashBits(n, bits - 1) ^ 1); });
+ Sequence<T> 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 61fe8d7..0619338 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 Policy, typename Iterator1, typename Size, typename Generator1, typename Generator2,
typename Compare>
typename std::enable_if<!is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::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 ac8a422..d5f0902 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<T> in(n1, [](std::size_t k) { return T(0); });
+ Sequence<T> 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 bfee4bd..28827be 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 Policy, typename Iterator, typename Predicate>
typename std::enable_if<!is_same_iterator_category<Iterator, std::random_access_iterator_tag>::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<T> in(max_size / 10, [](size_t v) -> T { return T(1); });
+ Sequence<T> 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 431ce0d..cc9b824 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 Policy, typename InputIterator1, typename InputIterator2, typename Compare>
typename std::enable_if<TestUtils::isReverse<InputIterator1>::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 27e83a1..8ecb0b1 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 Policy, typename InputIterator1, typename InputIterator2, typename Compare>
typename std::enable_if<TestUtils::isReverse<InputIterator1>::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 e7d84f1..19de214 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<T> in1(9, [](size_t v) -> T { return T(0); });
+ Sequence<T> 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 701fee2..827290d 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)
+#ifdef _DEBUG
+# if defined(_PSTL_PAR_BACKEND_TBB)
auto p = tbb::this_task_arena::max_concurrency();
-#else
+# else
auto p = 1;
-#endif
-
-#ifdef _DEBUG
+# 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 Policy, typename InputIterator, typename Compare>
typename std::enable_if<!is_same_iterator_category<InputIterator, std::random_access_iterator_tag>::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 2cdb24f..cccc92e 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<is_same_iterator_category<InputIterator, std::random_access_iterator_tag>::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<!is_same_iterator_category<InputIterator, std::random_access_iterator_tag>::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 eb3a48e..57133a3 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 <typename T>
struct wrapper
{
T t;
- explicit wrapper(T t_) : t(t_) {}
+ constexpr explicit wrapper(T t_) : t(t_) {}
template <typename T2>
- wrapper(const wrapper<T2>& a)
+ constexpr wrapper(const wrapper<T2>& a)
{
t = a.t;
}
template <typename T2>
- void
+ constexpr void
operator=(const wrapper<T2>& a)
{
t = a.t;
}
- wrapper<T>
+ constexpr wrapper<T>
operator-(const wrapper<T>& a) const
{
return wrapper<T>(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 Iterator1, typename Iterator2, typename T, typename Function>
typename std::enable_if<std::is_floating_point<T>::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 <typename T1, typename T2, typename Pred>
void
test(Pred pred)
{
- typedef typename Sequence<T2>::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<T1> actual(max_len, [](std::size_t i) { return T1(i); });
- Sequence<T2> data(max_len, [&value](std::size_t i) { return i % 3 == 2 ? T2(i * i) : value; });
+ Sequence<T2> 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 6ae02f1..42090aa 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 <typename Policy, typename Iterator1, typename Iterator2, typename Iterator3, typename Size, typename T>
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<!TestUtils::isReverse<Iterator1>::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 Policy, typename Iterator1, typename Iterator2, typename Iterator3, typename Size, typename T,
typename BinaryOp>
typename std::enable_if<TestUtils::isReverse<Iterator1>::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 4065e72..0262bbd 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 <typename Policy, typename InputIterator1, typename InputIterator2, typename T, typename BinaryOperation1,
typename BinaryOperation2, typename UnaryOp>
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<int32_t>(42, std::plus<int32_t>(), std::multiplies<int32_t>(), std::negate<int32_t>(),
- [](std::size_t a) -> int32_t { return int32_t(rand() % 1000); });
+ [](std::size_t) -> int32_t { return int32_t(rand() % 1000); });
test_by_type<int64_t>(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<float32_t>(1.0f, std::multiplies<float32_t>(),
[](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>(MyClass(), std::plus<MyClass>(), std::multiplies<MyClass>(), std::negate<MyClass>(),
- [](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 01920e1..9b9c8a3 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<!TestUtils::isReverse<InputIterator>::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 Policy, typename InputIterator, typename OutputIterator, typename Size, typename UnaryOp,
typename T, typename BinaryOp>
typename std::enable_if<TestUtils::isReverse<InputIterator>::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 979c2e5..be40f69 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<T>=*/std::true_type)
{
- typedef typename std::iterator_traits<InputIterator>::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);