diff options
| author | c8ef <c8ef@outlook.com> | 2026-02-09 20:51:55 +0800 |
|---|---|---|
| committer | c8ef <c8ef@outlook.com> | 2026-02-09 20:51:55 +0800 |
| commit | 909cc3ccca41cc99c62cb78b18031639b161d3b5 (patch) | |
| tree | 4f7b93bc6ae9f53e2febfb671b8aaec03c9d475b | |
| parent | 64cbb9da3441726607565185a76f4f77ddf73ddb (diff) | |
| download | llvm-users/c8ef/fold_left_first.tar.gz llvm-users/c8ef/fold_left_first.tar.bz2 llvm-users/c8ef/fold_left_first.zip | |
elinimate msvc warningusers/c8ef/fold_left_first
| -rw-r--r-- | libcxx/test/std/algorithms/alg.nonmodifying/alg.fold/ranges.fold_left_first.pass.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.fold/ranges.fold_left_first.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.fold/ranges.fold_left_first.pass.cpp index 0f2902bc6dc5..2f7930552293 100644 --- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.fold/ranges.fold_left_first.pass.cpp +++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.fold/ranges.fold_left_first.pass.cpp @@ -10,9 +10,6 @@ // REQUIRES: std-at-least-c++23 -// MSVC warning C4244: 'argument': conversion from 'double' to 'const int', possible loss of data -// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4244 - // template<input_iterator I, sentinel_for<I> S, // indirectly-binary-left-foldable<iter_value_t<I>, I> F> // requires constructible_from<iter_value_t<I>, iter_reference_t<I>> @@ -318,7 +315,7 @@ void runtime_only_test_case() { { auto const data = std::deque<double>{-1.1, -2.2, -3.3, -4.4, -5.5, -6.6}; - auto plus = [](int const x, double const y) { return x + y; }; + auto plus = [](double const x, double const y) { return static_cast<int>(x) + y; }; auto const expected = -21.6; // int(- 1.1) + -2.2 = - 1 + -2.2 = -3.2 // int(- 3.2) + -3.3 = - 3 + -3.3 = -6.3 // int(- 6.3) + -4.4 = - 6 + -4.4 = -10.4 |
