summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan T. Lavavej <stl@exchange.microsoft.com>2018-11-14 23:23:46 +0000
committerStephan T. Lavavej <stl@exchange.microsoft.com>2018-11-14 23:23:46 +0000
commit21981194eb8a5faed0d5fac6b8281a69ad2acb71 (patch)
treecaac84e495f10a2238d4d43bad2c0805fd26d77a
parent6b7d6fe079af574a0d6d52fa8594b6a9258c6db8 (diff)
downloadbcm5719-llvm-21981194eb8a5faed0d5fac6b8281a69ad2acb71.tar.gz
bcm5719-llvm-21981194eb8a5faed0d5fac6b8281a69ad2acb71.zip
[libcxx] [test] Fix MSVC warning C4800.
This was implicitly converting [1, 3] to bool, which triggers an MSVC warning. The test should just pass `true`, which is simpler, has the same behavior, and avoids the warning. (This is a library test, not a compiler test, and the conversion happens before calling `push_back`, so passing [1, 3] isn't interesting in any way. This resembles a previous change to stop passing `1 == 1` in the `vector<bool>` tests.) llvm-svn: 346910
-rw-r--r--libcxx/test/std/containers/sequences/vector.bool/move.pass.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/libcxx/test/std/containers/sequences/vector.bool/move.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/move.pass.cpp
index ab2b7ce6d31..b3663c759a8 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/move.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/move.pass.cpp
@@ -26,8 +26,8 @@ int main()
std::vector<bool, test_allocator<bool> > lo(test_allocator<bool>(5));
for (int i = 1; i <= 3; ++i)
{
- l.push_back(i);
- lo.push_back(i);
+ l.push_back(true);
+ lo.push_back(true);
}
std::vector<bool, test_allocator<bool> > l2 = std::move(l);
assert(l2 == lo);
@@ -39,8 +39,8 @@ int main()
std::vector<bool, other_allocator<bool> > lo(other_allocator<bool>(5));
for (int i = 1; i <= 3; ++i)
{
- l.push_back(i);
- lo.push_back(i);
+ l.push_back(true);
+ lo.push_back(true);
}
std::vector<bool, other_allocator<bool> > l2 = std::move(l);
assert(l2 == lo);
@@ -52,8 +52,8 @@ int main()
std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{});
for (int i = 1; i <= 3; ++i)
{
- l.push_back(i);
- lo.push_back(i);
+ l.push_back(true);
+ lo.push_back(true);
}
std::vector<bool, min_allocator<bool> > l2 = std::move(l);
assert(l2 == lo);
OpenPOWER on IntegriCloud