diff options
author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-11-23 22:01:19 +0000 |
---|---|---|
committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-11-23 22:01:19 +0000 |
commit | e898b484f646a10e0bcf90315b417bf32cfbd659 (patch) | |
tree | 61b9e0771f1af896331adcd5e8f1f88698fd6dd8 /libcxx/test/std/numerics/numarray/template.valarray/valarray.unary/plus.pass.cpp | |
parent | 4ff1c3983d8f8ec15f6f457d7c0662825f7bdb6c (diff) | |
download | bcm5719-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.unary/plus.pass.cpp')
-rw-r--r-- | libcxx/test/std/numerics/numarray/template.valarray/valarray.unary/plus.pass.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libcxx/test/std/numerics/numarray/template.valarray/valarray.unary/plus.pass.cpp b/libcxx/test/std/numerics/numarray/template.valarray/valarray.unary/plus.pass.cpp index 4bcdaf095ff..df6fccc38c8 100644 --- a/libcxx/test/std/numerics/numarray/template.valarray/valarray.unary/plus.pass.cpp +++ b/libcxx/test/std/numerics/numarray/template.valarray/valarray.unary/plus.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]); } } @@ -59,7 +60,7 @@ int main() std::valarray<T> v(a, N); std::valarray<T> v2 = +(v + 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] == +2*v[i]); } } |