diff options
author | Billy Robert O'Neal III <bion@microsoft.com> | 2018-01-06 02:18:20 +0000 |
---|---|---|
committer | Billy Robert O'Neal III <bion@microsoft.com> | 2018-01-06 02:18:20 +0000 |
commit | 1e1195dce5bc07a2f925c3e3cc3a62534fffa82d (patch) | |
tree | 12189190c22b7d01cb322a5283c4fc9bddb3cd3e /libcxx/test/std/numerics/numeric.ops/exclusive.scan | |
parent | a263c346e568e15dde95ad2d1417444c5cda134f (diff) | |
download | bcm5719-llvm-1e1195dce5bc07a2f925c3e3cc3a62534fffa82d.tar.gz bcm5719-llvm-1e1195dce5bc07a2f925c3e3cc3a62534fffa82d.zip |
[libcxx] [test] Remove nonstandard things and resolve warnings in Xxx_scan tests
Reviewed as https://reviews.llvm.org/D41748
* These tests use function objects from functional, back_inserter from iterator, and equal from algorithm, so add those headers.
* The use of iota targeting vector<unsigned char> with an int parameter triggers warnings on MSVC++ assigning an into a unsigned char&; so change the parameter to unsigned char with a static_cast.
* Avoid naming unary_function in identity here as that is removed in '17. (This also fixes naming _VSTD, _NOEXCEPT_, and other libcxx-isms)
* Change the predicate in the transform tests to add_ten so that problems with multiple application are caught.
llvm-svn: 321922
Diffstat (limited to 'libcxx/test/std/numerics/numeric.ops/exclusive.scan')
-rw-r--r-- | libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp | 5 | ||||
-rw-r--r-- | libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp b/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp index 34181f508e2..0cf6f2345e3 100644 --- a/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp +++ b/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp @@ -16,8 +16,11 @@ // #include <numeric> -#include <vector> +#include <algorithm> #include <cassert> +#include <functional> +#include <iterator> +#include <vector> #include "test_iterators.h" diff --git a/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp b/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp index c15cb1661e2..c6771697649 100644 --- a/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp +++ b/libcxx/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp @@ -17,8 +17,11 @@ // T init, BinaryOperation binary_op); // C++17 #include <numeric> -#include <vector> +#include <algorithm> #include <cassert> +#include <functional> +#include <iterator> +#include <vector> #include "test_iterators.h" @@ -70,7 +73,7 @@ int main() // Make sure that the calculations are done using the init typedef { std::vector<unsigned char> v(10); - std::iota(v.begin(), v.end(), 1); + std::iota(v.begin(), v.end(), static_cast<unsigned char>(1)); std::vector<int> res; std::exclusive_scan(v.begin(), v.end(), std::back_inserter(res), 1, std::multiplies<>()); |