diff options
author | Stephan T. Lavavej <stl@nuwen.net> | 2023-12-05 06:46:41 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-05 09:46:41 -0500 |
commit | 164c204a19f7859d570003d4c5e82faf48cb65a9 (patch) | |
tree | 039aee664dfe2df7ec88684575da32b7f83bbc3c /libcxx/test/std/algorithms/alg.modifying.operations | |
parent | 410bf5e1425432e49a46d3c4b7962b747a976c85 (diff) | |
download | llvm-164c204a19f7859d570003d4c5e82faf48cb65a9.zip llvm-164c204a19f7859d570003d4c5e82faf48cb65a9.tar.gz llvm-164c204a19f7859d570003d4c5e82faf48cb65a9.tar.bz2 |
[libc++][test] Fix simple warnings (#74186)
Found while running libc++'s tests with MSVC's STL. This fixes 3 kinds of warnings:
- Add void-casts to fix `-Wunused-variable` warnings.
- Avoid sign/truncation warnings in `ConvertibleToIntegral.h`.
- Add `TEST_STD_AT_LEAST_23_OR_RUNTIME_EVALUATED` to avoid mixing preprocessor
and runtime tests.
- Cleanup: Add `TEST_STD_AT_LEAST_20_OR_RUNTIME_EVALUATED` for
consistency.
Diffstat (limited to 'libcxx/test/std/algorithms/alg.modifying.operations')
-rw-r--r-- | libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp | 2 | ||||
-rw-r--r-- | libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp index ce5cf05..b1ad687 100644 --- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp +++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp @@ -94,7 +94,7 @@ struct Test1OutIters { TEST_CONSTEXPR_CXX20 bool test() { types::for_each(types::cpp17_input_iterator_list<int*>(), TestOutIters()); - if (TEST_STD_VER >= 23 || !TEST_IS_CONSTANT_EVALUATED) + if (TEST_STD_AT_LEAST_23_OR_RUNTIME_EVALUATED) types::for_each(types::cpp17_input_iterator_list<std::unique_ptr<int>*>(), Test1OutIters()); { // Make sure that padding bits aren't copied diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp index 2ed4d37..61dea47 100644 --- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp +++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp @@ -92,7 +92,7 @@ struct Test1OutIters { TEST_CONSTEXPR_CXX20 bool test() { types::for_each(types::bidirectional_iterator_list<int*>(), TestOutIters()); - if (TEST_STD_VER >= 23 || !TEST_IS_CONSTANT_EVALUATED) + if (TEST_STD_AT_LEAST_23_OR_RUNTIME_EVALUATED) types::for_each(types::bidirectional_iterator_list<std::unique_ptr<int>*>(), Test1OutIters()); { // Make sure that padding bits aren't copied |