diff options
Diffstat (limited to 'libcxx/test/std/algorithms')
3 files changed, 10 insertions, 3 deletions
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp index 967b6e37762..c923d847f11 100644 --- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp +++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp @@ -17,12 +17,13 @@ #include <algorithm> #include <cassert> +#include <cstddef> #include "test_macros.h" struct gen { - int operator()(int n) + std::ptrdiff_t operator()(std::ptrdiff_t n) { return n-1; } diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp index ebb876709b5..ea1e7dfe9fa 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp @@ -16,6 +16,7 @@ // sort(Iter first, Iter last); #include <algorithm> +#include <iterator> #include <cassert> template <class RI> @@ -23,9 +24,11 @@ void test_sort_helper(RI f, RI l) { typedef typename std::iterator_traits<RI>::value_type value_type; + typedef typename std::iterator_traits<RI>::difference_type difference_type; + if (f != l) { - long len = l - f; + difference_type len = l - f; value_type* save(new value_type[len]); do { diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp index 2721c9c01ec..74a876cee19 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp @@ -16,6 +16,7 @@ // stable_sort(Iter first, Iter last); #include <algorithm> +#include <iterator> #include <cassert> template <class RI> @@ -23,9 +24,11 @@ void test_sort_helper(RI f, RI l) { typedef typename std::iterator_traits<RI>::value_type value_type; + typedef typename std::iterator_traits<RI>::difference_type difference_type; + if (f != l) { - long len = l - f; + difference_type len = l - f; value_type* save(new value_type[len]); do { |