Correct issues from investigation of VSO-938163 #1191
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been helping the MSVC compiler team's
constexpr
specialist investigate VSO-938163 (which we'll call "constexpr
hatesranges::iter_swap
") and its interactions with our Ranges tests. She discovered there are really two different bugs that we've been calling VSO-938163, and fixed them both. In the process we found some miscategorization and other problems hidden behind VSO-938163.<algorithm>
: Applied perma-workaround for VSO-1141368 ("constexpr
hates lifetime extension") by avoiding structured binding and the consequent lifetime extension of temporaries implicitly bound to references.tests/std/tests/P0896R4_P1614R2_comparisons
: This test triggers a different bug for which I filed VSO-1168721 with a minimal repro:I've changed the TRANSITION comment appropriately.
tests/std/tests/P0896R4_ranges_alg_partition
: In addition to VSO-938163, this triggers VSO-1168723 in whichstd::array<std::pair<int, int>, N>
's implicit copy assignment operator is incorrectly not consideredconstexpr
despite thatstd::pair<int, int>
can be copy assigned in a constant expression. I've applied a perma-workaround to avoid VSO-1168723.tests/std/tests/P0896R4_ranges_iterator_machinery
: Change#ifdef __clang__
guard to#if defined(__clang__) || defined(__EDG__)
for consistency.I've verified that the tests will all pass with the fixed compiler after applying these changes and removing all remaining workarounds for VSO-938163, which we'll be able to do after the fixed compiler ships.