* C++20 move_iterator changes and move_sentinel
Changes primarily come from P0896R4 "<ranges>", but the `operator<=>` from P1614R2 "Adding Spaceship <=> To The Library" is here as well.
I've also speculatively implemented the proposed resolutions of LWG-3293, LWG-3391, and LWG-3435.
I had to [patch a pair of libc++ tests](https://reviews.llvm.org/D79343) that fail with these changes; the LLVM reference is updated here to pull in those tests.
Drive-by:
* s/explicit constexpr/constexpr explicit/g (I somehow managed to sneak two occurrences into `subrange`)
* Skip flaky libc++ test (detached threads)
* Fixes GH-785, which reported that `arg(real)` was implemented as `return 0;`
but `arg(complex)` does actual work for complex numbers with
zero imaginary parts.
* `norm` should upgrade to `double` before squaring. The difference
is observable because `double`'s range is vast.
* `conj` and `proj` should return `complex`.
* `conj(real)` should behave exactly like `conj(complex)`, returning
an imaginary part of negative zero. The difference is technically
observable.
* `proj(real)` should behave exactly like `proj(complex)`, mapping
negative infinity to positive infinity.
* Test that float/double/long double aren't "upgraded".
* Tests pass for Clang, emit warnings for MSVC.
* Change most libc++ SKIPs to FAILs
... to more closely reflect expectations. This ensures that we'll find out immediately when a bug that was causing a test to fail is fixed, or when a bad test is fixed.
Other changes:
* We implement `bit_cast`; unskip the test.
* The P0556R3 tests fail not because we haven't implemented it, but because we've also implemented P1956R1 which libc++ has not.
* `aligned_storage.pass.cpp` is failing because (1) our implementation is bogus per (#784), and (2) the test is bogus - not because of VSO-120957.
* We do have `tgmath.h` now; the tgmath test now fails only with Clang because Clang provides its own broken `tgmath.h`.
* Update LLVM from upstream
* libc++ implemented P1115R3, unskip all the related tests that have now been fixed.
* `utilities\utility\pairs\pairs.pair\assign_pair.pass.cpp` passes now that I've fixed a narrowing warning upstream.
* Skip `re\re.const\re.matchflag\match_prev_avail.pass.cpp` which is now failing for unanalyzed reasons after an upstream change.
Fix Clang warnings in STL headers (when they aren't being suppressed for "system headers").
Change the test infrastructure to no longer treat STL headers as "system headers", so we'll remain clean with respect to Clang warnings in the future.
Fix Microsoft-internal VSO-609129 "`<cvt/sjis_0208>` appears to have impossible condition" which was also emitting a Clang warning.
* Implement ranges::subrange and ranges::view_interface
Product changes:
`<utility>`: declare `tuple`'s overloads of `std::get` so they are visible to the definition of `subrange`'s `_Pair_like` concept in `<xutility>`.
`<xutility>`: Implementations of `subrange`, `view_interface`, and `borrowed_subrange_t`.
Test changes:
`std/include/range_algorithm_support.hpp`: Remove `iter_move` overload landmine for non-`indirectly_readable` `test_iterator`s that hampers detection.
`std/tests/P0896R4_ranges_algorithm_machinery`: Enable `borrowed_subrange_t` smoke test.
`std/tests/P0896R4_ranges_range_machinery`: Validate that `subrange` is a `borrowed_range`.
`std/tests/P0896R4_ranges_subrange`: New test to cover `subrange` and `view_interface`.
C1XX now emits C5219 `implicit conversion from '%s' to '%s', possible loss of data` to warn about potentially lossy implicit conversions, e.g., from integer types to floating-point types. These changes avoid emission of the new warning from the internals and tests of the STL.
* `<yvals_core.h>` changes:
* Clang 10 `_HAS_CONDITIONAL_EXPLICIT` in C++14 mode (Only CUDA now requires the `_HAS_CONDITIONAL_EXPLICIT == 0` code paths)
* reject Clang < 10
* reject MSVC < 1926
* Unskip libc++ tests that need Concepts and/or `<=>`
* `std/tests/P0595R2_is_constant_evaluated`: We no longer need suppress the warning Clang 9 emits when it sees the suppression for the warning Clang 10 emits in this test ;)
* `std/tests/VSO_0157762_feature_test_macros`: Remove Clang 9 support
* `std/tests/concepts_matrix.lst`: This is now simply a copy of `usual_latest_matrix.lst` with the `/BE` lines (EDG configs) commented out. (i.e., we now run the Concepts tests with Clang as well as MSVC.)
* Remove workarounds for LLVM-38491 "clang-cl should accept __declspec(allocator)": Replace uses of `_DECLSPEC_ALLOCATOR` with `__declspec(allocator)`, and suppress Clang's warning when the return type isn't a pointer or reference.
* Remove workarounds for LLVM-43531 "clang-format damages 'alternative representations' for operators": Re-enable clang-format in the test which triggered the bug.
* Remove workarounds for LLVM-38478 "clang -fno-ms-compatibility rejects Windows.h": Add -fno-ms-compatibility to the XXX_winsdk_XXX.lst files. (Yes, we still need these because the Windows SDK breaks `/Za`.)
* Drive-by: unskip libc++ new.version now that we implement destroying delete
* [numerics] Optimize gcd to use builtins
* Fix template argument deduction for _countl_zero
* Use the same casts as the other bit operations
* Update stl/inc/numeric
Fix tpyo
* Remove whitespace
Co-Authored-By: Stephan T. Lavavej <stl@nuwen.net>
* _BitScanForward is countr_zero(x), not countl_zero(~x)
Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Casey Carter <Casey@Carter.net>
Now that LLVM-39247 has been fixed in Clang 10, we can enable this setting again. This PR does so in several Libs clang-format files which had a LLVM-39247 comment.
I've changed the end comments on unnamed namespaces from `// namespace`, which clang-format adds automatically, to `// unnamed namespace` which more clearly indicates that someone didn't simply forget to finish typing the comment.
* Minor test matrix cleanup:
* Factor "/EHsc /std:c++latest" out of each config in `usual_latest_matrix.lst` and `usual_latest_winsdk_matrix.lst`
* Remove unused `native_latest_matrix.lst`
* Avoid LLVM-45213 in `range_algorithm_support.hpp` and `std/tests/P0896R4_ranges_alg_all_of`
* <concepts> remove workaround for LLVM-44689 which is fixed in Clang 10
* Don't define `__cpp_lib_bitops` when `__EDG__`, so IntelliSense is consistent with MSVC
* Don't define `__cpp_lib_int_pow2` when `__cpp_lib_bitops` isn't defined since the facilities that correspond with `__cpp_lib_int_pow2` are only provided when `__cpp_lib_bitops` is defined.
* Update feature-test macro test accordingly
(See discussion starting at https://github.com/microsoft/STL/issues/313#issuecomment-585127653.)