[all-commits] [llvm/llvm-project] 2ba083: [libc++] [test] Fix portability issues for MSVC (#...
Stephan T. Lavavej via All-commits
all-commits at lists.llvm.org
Tue May 28 12:21:19 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 2ba08386156ef25913b1bee170d8fe95aaceb234
https://github.com/llvm/llvm-project/commit/2ba08386156ef25913b1bee170d8fe95aaceb234
Author: Stephan T. Lavavej <stl at nuwen.net>
Date: 2024-05-28 (Tue, 28 May 2024)
Changed paths:
M libcxx/test/libcxx/time/time.zone/time.zone.db/time.zone.db.tzdb/locate_zone.pass.cpp
M libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains_subrange.pass.cpp
R libcxx/test/std/containers/sequences/vector/vector.modifiers/destory_elements.pass.cpp
A libcxx/test/std/containers/sequences/vector/vector.modifiers/destroy_elements.pass.cpp
M libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
M libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
M libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
M libcxx/test/std/iterators/predef.iterators/move.iterators/sized_sentinel.compile.pass.cpp
M libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
M libcxx/test/std/time/time.zone/time.zone.db/time.zone.db.access/current_zone.pass.cpp
M libcxx/test/std/time/time.zone/time.zone.db/time.zone.db.access/locate_zone.pass.cpp
M libcxx/test/std/time/time.zone/time.zone.db/time.zone.db.tzdb/current_zone.pass.cpp
M libcxx/test/std/time/time.zone/time.zone.db/time.zone.db.tzdb/locate_zone.pass.cpp
M libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
M libcxx/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
M libcxx/test/support/msvc_stdlib_force_include.h
Log Message:
-----------
[libc++] [test] Fix portability issues for MSVC (#93259)
* Guard `std::__make_from_tuple_impl` tests with `#ifdef _LIBCPP_VERSION` and `LIBCPP_STATIC_ASSERT`.
* Change `_LIBCPP_CONSTEXPR_SINCE_CXX20` to `TEST_CONSTEXPR_CXX20`.
+ Other functions in `variant.swap/swap.pass.cpp` were already using the proper test macro.
* Mark `what` as `[[maybe_unused]]` when used by `TEST_LIBCPP_REQUIRE`.
+ This updates one occurrence in `libcxx/test/libcxx` for consistency.
* Windows `_putenv_s()` takes 2 arguments, not 3.
+ See MSVC documentation: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/putenv-s-wputenv-s?view=msvc-170
+ POSIX `setenv()` takes `int overwrite`, but Windows `_putenv_s()` always overwrites.
* Avoid non-Standard zero-length arrays.
+ Followup to #74183 and #79792.
* Add `operator++()` to `unsized_it`.
+ The Standard requires this due to [N4981][] [move.iter.requirements]/1 "The template parameter `Iterator` shall
either meet the *Cpp17InputIterator* requirements ([input.iterators])
or model `input_iterator` ([iterator.concept.input])."
+ MSVC's STL requires this because it has a strengthened exception
specification in `move_iterator` that inspects the underlying iterator's
increment operator.
* `uniform_int_distribution` forbids `int8_t`/`uint8_t`.
+ See [N4981][] [rand.req.genl]/1.5. MSVC's STL enforces this.
+ Note that when changing the distribution's `IntType`, we need to be
careful to preserve the original value range of `[0, max_input]`.
* fstreams are constructible from `const fs::path::value_type*` on wide systems.
+ See [ifstream.cons], [ofstream.cons], [fstream.cons].
* In `msvc_stdlib_force_include.h`, map `_HAS_CXX23` to `TEST_STD_VER` 23 instead of 99.
+ On 2023-05-23, https://github.com/llvm/llvm-project/commit/71400505ca048507e827013eb1ea0bc863525cab
started recognizing 23 as a distinct value.
* Fix test name typo: `destory_elements.pass.cpp` => `destroy_elements.pass.cpp`
[N4981]: https://wg21.link/N4981
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list