summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/algorithms/alg.modifying.operations
diff options
context:
space:
mode:
authorBilly Robert O'Neal III <bion@microsoft.com>2020-01-14 01:10:11 -0800
committerBilly Robert O'Neal III <bion@microsoft.com>2020-01-14 01:11:10 -0800
commit6d8abe424a77f736fbed114eeac574b9bfe6b0c1 (patch)
treeaea5f3ce748b52fea44ba7d37bf9ed7cbec7bed7 /libcxx/test/std/algorithms/alg.modifying.operations
parentd8ffd601d523fa0c0a55e25e62af9ffaa618629d (diff)
downloadbcm5719-llvm-6d8abe424a77f736fbed114eeac574b9bfe6b0c1.tar.gz
bcm5719-llvm-6d8abe424a77f736fbed114eeac574b9bfe6b0c1.zip
[libcxx] [test] Add casts to avoid signed/unsigned mismatch warnings on MSVC++
A bug was filed that these warnings should not be emitted as DevCom-883961. ( https://developercommunity.visualstudio.com/content/problem/883961/c4389-signedunsigned-mismatch-should-not-be-emitte.html )
Diffstat (limited to 'libcxx/test/std/algorithms/alg.modifying.operations')
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp2
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp2
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp
index 8dedddb4c20..37d5759f833 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp
@@ -26,7 +26,7 @@ TEST_CONSTEXPR bool test_constexpr() {
auto it = std::remove_copy(std::begin(ia), std::end(ia), std::begin(ib), 5);
- return std::distance(std::begin(ib), it) == (std::size(ia) - 2) // we removed two elements
+ return std::distance(std::begin(ib), it) == static_cast<int>(std::size(ia) - 2) // we removed two elements
&& std::none_of(std::begin(ib), it, [](int a) {return a == 5;})
&& std::all_of (it, std::end(ib), [](int a) {return a == 0;})
;
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp
index 7d10c6bd759..01b382ba004 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp
@@ -30,7 +30,7 @@ TEST_CONSTEXPR bool test_constexpr() {
auto it = std::remove_copy_if(std::begin(ia), std::end(ia), std::begin(ib), equalToTwo);
- return std::distance(std::begin(ib), it) == (std::size(ia) - 1) // we removed one element
+ return std::distance(std::begin(ib), it) == static_cast<int>(std::size(ia) - 1) // we removed one element
&& std::none_of(std::begin(ib), it, equalToTwo)
&& std::all_of (it, std::end(ib), [](int a) {return a == 0;})
;
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp
index 6967c446b75..be3e6afd047 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp
@@ -25,7 +25,7 @@ TEST_CONSTEXPR bool test_constexpr() {
auto it = std::reverse_copy(std::begin(ia), std::end(ia), std::begin(ib));
- return std::distance(std::begin(ib), it) == std::size(ia)
+ return std::distance(std::begin(ib), it) == static_cast<int>(std::size(ia))
&& std::equal (std::begin(ia), std::end(ia), std::rbegin(ib))
;
}
OpenPOWER on IntegriCloud