summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp
diff options
context:
space:
mode:
authorStephan T. Lavavej <stl@exchange.microsoft.com>2016-11-23 22:01:19 +0000
committerStephan T. Lavavej <stl@exchange.microsoft.com>2016-11-23 22:01:19 +0000
commite898b484f646a10e0bcf90315b417bf32cfbd659 (patch)
tree61b9e0771f1af896331adcd5e8f1f88698fd6dd8 /libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp
parent4ff1c3983d8f8ec15f6f457d7c0662825f7bdb6c (diff)
downloadbcm5719-llvm-e898b484f646a10e0bcf90315b417bf32cfbd659.tar.gz
bcm5719-llvm-e898b484f646a10e0bcf90315b417bf32cfbd659.zip
[libcxx] [test] D27013: Fix MSVC warning C4018 "signed/unsigned mismatch", part 1/12.
Change loop indices from int to std::size_t. Also, include <cstddef> when it wasn't already being included. llvm-svn: 287820
Diffstat (limited to 'libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp')
-rw-r--r--libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp b/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp
index 04ac2cdf1b9..d0417333a40 100644
--- a/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp
+++ b/libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -25,7 +26,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = v;
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v[i]);
}
{
@@ -35,7 +36,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = v;
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v[i]);
}
{
@@ -48,7 +49,7 @@ int main()
for (int i = 0; i < N; ++i)
{
assert(v2[i].size() == v[i].size());
- for (int j = 0; j < v[i].size(); ++j)
+ for (std::size_t j = 0; j < v[i].size(); ++j)
assert(v2[i][j] == v[i][j]);
}
}
OpenPOWER on IntegriCloud