Co-authored-by: ArtemSarmini <16746066+ArtemSarmini@users.noreply.github.com>
Co-authored-by: Michael Schellenberger Costa <mschellenbergercosta@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Ahana Mukhopadhyay <t-ahmukh@microsoft.com>
Co-authored-by: Anju Del Moral Gonzalez <judelmor@microsoft.com>
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Charlie Barto <chbarto@microsoft.com>
Co-authored-by: Curtis Bezault <cubezaul@microsoft.com>
Co-authored-by: d-winsor <danwin@microsoft.com>
Co-authored-by: Michael Schellenberger Costa <mschellenbergercosta@googlemail.com>
Co-authored-by: statementreply <statementreply@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Co-Authored-By: Adam Bucior <35536269+AdamBucior@users.noreply.github.com>
Co-Authored-By: Berrysoft <37586447+Berrysoft@users.noreply.github.com>
Co-Authored-By: Michael Schellenberger Costa <mschellenbergercosta@googlemail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Igor Zhukov <4289847+fsb4000@users.noreply.github.com>
Co-authored-by: S. B. Tam <8998201+cpplearner@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Billy O'Neal <bion@microsoft.com>
Co-authored-by: Curtis J Bezault <curtbezault@gmail.com>
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Adam Bucior <35536269+AdamBucior@users.noreply.github.com>
Co-authored-by: Curtis Jacques Bezault <curtbezault@gmail.com>
Co-authored-by: Michael Schellenberger Costa <mschellenbergercosta@gmail.com>
Co-authored-by: mnatsuhara <46756417+mnatsuhara@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
* Fix#1471 by properly waiting for the Windows Driver Kit installation to finish.
* Update `azure-pipelines.yml` to use the new pool `StlBuild-2020-12-08`.
* Update `README.md` to mention Preview 2. (Its CMake and Ninja versions haven't changed,
and we don't directly mention the Clang version.)
* Update `yvals_core.h` to require Clang 11. (Note that MSVC's `_MSC_VER` is remaining `1928` for the 16.9 release.)
* Remove the workaround for LLVM-37556. (We were treating it as an uncommented perma-workaround, but I remembered.)
* Remove many workarounds in `P1502R1_standard_library_header_units`.
* Remove the VSO-1225825 workaround in `<iterator>` and `<ranges>`.
* Unrelated cleanup in `<valarray>`: `__cpp_aligned_new` implies `if constexpr`.
* Update the vcpkg submodule for Boost 1.74.0. This is just their latest commit.
* In `CMakeLists.txt`, require Boost 1.74.0. (This, combined with the toolset update,
implies that contributors will need to `git submodule update`, clean out the `vcpkg`
submodule with `git clean -x -d -f`, and then bootstrap vcpkg and build boost-math.)
* Simplify conditional operators in `seed_seq::generate`.
+ Thanks to @AlexGuteniev for suggesting extracting `_Off` and noticing
that `_Myvec[(_Kx - 1) % _Sx]` was unnecessarily complicated. Given `_Kx` in `[1, _Sx]`,
then `_Kx - 1` is in `[0, _Sx - 1]`, so `% _Sx` does nothing.
* Take advantage of clang-format 11. This sets `AlignOperands: AlignAfterOperator` and `IndentCaseBlocks: true`.
* Fix undue overflow and underflow in complex sqrt
Modifies the scale factors in `_Fabs` (used by `sqrt`) such that:
- `_Fabs` doesn't underflow when the input is tiny.
- `sqrt` doesn't overflow when the input is huge.
* Improve accuracy of `log` when |z| is close to 1
When |z| is close to 1, compute log(|z|) as log1p(norm_minus_1(z)) / 2,
where norm_minus_1(z) = real(z) ^ 2 + imag(z) ^ 2 - 1 computed with
double width arithmetic to avoid catastrophic cancellation.
* Fix log(complex{1, tiny}) incorrectly returning -0 under FE_DOWNWARD
Co-authored-by: Curtis J Bezault <curtbezault@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Co-authored-by: S. B. Tam <cpplearner@outlook.com>
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Partially addresses #39.
Co-authored-by: Adam Bucior <35536269+AdamBucior@users.noreply.github.com>
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Weheineman <t-giwein@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Co-authored-by: Casey Carter <cacarter@microsoft.com>
When `_CONTAINER_DEBUG_LEVEL` is `1` (which is implied by `_ITERATOR_DEBUG_LEVEL != 0`) `optional::operator*` and `optional::operator->` verify the precondition that the `optional` is not empty.
Drive-by: Add a default constructor to `death_test_executive` so we need not construct with a do-nothing function when there are no "normal" tests.
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Removes workarounds for:
* VSO-938163 "`constexpr` hates pointers", revealing VSO-1132704 "Bogus C3615 when implicitly-constexpr defaulted SMF calls non-trivial SMF in base class" and VSO-1217687 "Casting object reference to base and back loses track of member values in constant expression" beneath.
* VSO-1002863 "Failure to short-circuit substitution when evaluating disjunction of atomic constraints"
* VSO-1062618 "Asymmetric behavior from conditional operator with char32_t operands"
* VSO-1125263 "EDG rejects valid code using consteval"
* VSO-1132105 "[EDG] Error using non-static data member with dependent type in noexcept-specifier of member function template"
* VSO-1132186 "[EDG] Weirdness with dependent template in noexcept-specifier"
* VSO-1178211 "[EDG] Internal compiler error on template template parameter instantiated from inherited template"
Also relabels the workarounds for VSO-1174090 "Assertion failure for member subobject with multiple prospective destructors" (which is fixed!) as workarounds for VSO-1225825 "ModuleReader doesn't understand concept overloading".
As a bonus, remove unnecessary workarounds for DevCom-1159442 "type-constraint in deduced variable type fails when immediately following an if statement"; these type-constraints don't follow the _compound-statement_ of an `if` conditional, and so don't trigger the bug.
Drive-by cleanup:
* explicitly compare pointers with `nullptr` in preference to `if (ptr)` and `if (!ptr)`
* `_STL_INTERNAL_CHECK` checkable preconditions
* Use `constinit` when available to verify `constexpr` constructor
Fixes#1309.
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
* Minimal changes to support constexpr allocation in MSVC
* Define `_CONSTEXPR20_DYNALLOC` macro to `constexpr` when the compiler defines `__cpp_constexpr_dynamic_alloc` and `inline` otherwise.
* Implement and test `ranges::construct_at` and `ranges::destroy_at`, mark them (and `std` flavors) `_CONSTEXPR20_DYNALLOC`.
* Implement `ranges::destroy` and `ranges::destroy_n` which share machinery with `ranges::destroy_at` with minimal test coverage. (More to follow.)
[This is a dual of internal MSVC-PR-275909.]
Completes a bit more of WG21-P1739 "Avoiding Template Bloat For Ranges".
Annotate implementation of P1391R4 and partial implementation of P1739R4 in `<yvals_core.h>`.
* Implement non-concepts fallback for coroutine_handle operator<=>
... to allow EDG to compile `<coroutine>`. [This is a dual of MSVC-PR-271029.]
* Reorder feature-tests in `<experimental/generator>`
... so it won't notice that Edge defines both `__cpp_impl_coroutine` and `__cpp_coroutines` in C++20 mode.
Also don't test `VSO_0971246_legacy_await_headers` with `/BE /await`; `/await` is meaningless for Edge.
* Implement views:all and views::reverse
Also, perma-workaround LLVM-37556.
Co-authored-by: Michael Schellenberger Costa <mschellenbergercosta@gmail.com>
1. Hexfloat output now ignores precision as required by the standard. (Fixes #1125.)
2. Zero precision is now correctly passed to sprintf.
3. Negative precision no longer crashes.
Small changes to help the new IntelliSense compiler better work with the concepts-using C++20 STL.
Drive-by: Avoid `/analyze:only` run timeouts in two Ranges tests that weren't quite exhausting memory.
So our test coverage won't be damaged when the compiler changes `/std:c++latest` to imply `/permissive-`. I do so by adding `/permissive-` to every `/std:c++latest` command line that doesn't yet have it, and then reverting one configuration in each matrix to `/permissive`. It seems sensible to me that the majority of our coverage should change from permissive to strict mode to reflect the change in compiler default.
Co-authored-by: Billy O'Neal <bion@microsoft.com>
Co-authored-by: Adam Bucior <35536269+AdamBucior@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Disable some tests due to impact of P0960R3: allow initializing aggregates from a parenthesized list of values
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: Curtis J Bezault <curtbezault@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: S. B. Tam <cpplearner@outlook.com>
Co-authored-by: Casey Carter <cartec69@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
`_Pass_fn` returns a copy of arguments no larger than `void*`, and a call-forwarding reference-wrapper-alike `_Ref_fn` for larger function objects. This became a problem when Ranges started throwing pointers-to-member at `_Pass_fn` with the expectation that they would eventually be `invoke`d: pointers-to-member can be larger than `void*`, but `_Ref_fn` doesn't speak the `invoke` protocol.
There are two relatively obvious possible fixes:
1. Teach `_Pass_fn` to always return copies of pointers-to-member regardless of size
2. Teach `_Ref_fn` to obey the `invoke` protocol
(1) results in "large" pointers-to-member that can't be enregistered being copied and passed by hidden reference resulting in larger codesize than (2), but with no corresponding performance benefits. We therefore implement (2) by teaching `_Ref_fn` to call-forward through `invoke` when it wraps a pointer-to-member.
Fixes GH-1089.
Includes the `mergeable` concept and algorithms `ranges::includes`, `ranges::set_union`, `ranges::set_intersection`, `ranges::set_difference`, and `ranges::set_symmetric_difference`.
* Remove unnecessary comments in ranges tests.
We taught clang-format how to sort like this automatically.
* Fix x86 compiler error in stljobs.h.
This never compiled for x86 where size_t and SIZE_T are different types.
* Update .clang-format for Clang 10.
AllowShortBlocksOnASingleLine changed from false/true to
Never/Empty/Always. We still want the default of Never, as Empty
appears to misbehave.
DeriveLineEnding was added, defaulting to true. We want to disable line
ending auto-detection.
SortPriority was added. Its documentation is difficult to understand,
but it can be used to group includes together while modifying their
otherwise-lexicographic ordering. Here, I'm using it to group WinSDK
includes together, while still sorting WinIoCtl.h last.
IncludeIsMainSourceRegex was added. This doesn't appear to be relevant
to us.
IndentGotoLabels was added. We've avoided goto.
SpaceInEmptyBlock was added. We prefer the default of no space.
SpacesInConditionalStatement was added. We definitely prefer the
default of no space.
SpaceBeforeSquareBrackets was added. Again, we definitely prefer the
default of no space.
The Standard option was overhauled. Previously, Cpp11 meant "use the
latest supported standard". That was confusing, so it has been
deprecated in favor of Latest.
UseCRLF was added. We currently use CRLF for all files. (Previously,
validate.cpp would detect LF files, but clang-format wouldn't fix
them.)
* In .clang-format, delete empty lines and move comment.
The empty lines were intended to make it easier to see customized
options, but they were actually making it harder to diff the default
config against our config.
Move the StatementMacros comment next to our customized settings,
and rewrap it.
* Reformat filesystem.cpp.
Mathematically, `_Par0._Pcdf.back()` should be one. However, when it is
actually slightly smaller than one due to rounding error, there is a
small probability that `_Px > _Par0._Pcdf.back()` and the original code
returns the invalid value of `_Par0._Pcdf.size()`.
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
Co-authored-by: Casey Carter <cartec69@gmail.com>
* Break <compare> ABI again, and fix#1050.
* Remove obsolete conditional compilation from <compare>.
Co-authored-by: statementreply <statementreply@gmail.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>