Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2502R2 <generator>: Synchronous Coroutine Generator For Ranges #4953

Open
wants to merge 72 commits into
base: main
Choose a base branch
from

Conversation

CaseyCarter
Copy link
Member

@CaseyCarter CaseyCarter commented Sep 13, 2024

This is the 44 commits from feature/generator plus one more to add a forward in a test_one overload in P2502R2_generator.
I've verified that we implement the resolutions of the three LWG issues mentioned in #2936, and recently validated that we address all the "add a new header requirements".

Closes #2936, fixes #4952 (comment).

I stuffed all the implementation details in <generator> into namespace _Gen_detail, and simplified names that no longer need disambiguation. The delta looks huge, but the largest commit (b61b7ba) is mostly just additional indentation, and the remainder are a single rename each.

CaseyCarter and others added 30 commits January 25, 2024 21:14
Resolved conflict in yvals_core.h, removing all guards around `__cpp_lib_generator` except `_HAS_CXX23`.

* `__cpp_lib_concepts` is now always available in C++20 and later.
* `<generator>` doesn't care about `std::byte` now.
* C1XX, Clang, and EDG all define `__cpp_impl_coroutine` in C++20 and later, which wasn't the case earlier.
Also add a missing semicolon - this emits a `_Pragma`.
VSO-1951821 "EDG instantiates the wrong overload of `promise_type::operator new` for `generator` machinery"
Resolved a trivial merge conflict in `<ranges>` with the `inline constexpr` change for `_Compile_time_max_size`.
Co-authored-by: Stephan T. Lavavej <[email protected]>
Co-authored-by: Alex Guteniev <[email protected]>
stl/inc/xmemory Outdated Show resolved Hide resolved
stl/inc/generator Outdated Show resolved Hide resolved
stl/inc/generator Outdated Show resolved Hide resolved
stl/inc/generator Outdated Show resolved Hide resolved
stl/inc/generator Outdated Show resolved Hide resolved
stl/inc/generator Outdated Show resolved Hide resolved
stl/inc/generator Outdated Show resolved Hide resolved
stl/inc/generator Outdated Show resolved Hide resolved
stl/inc/generator Outdated Show resolved Hide resolved
tests/std/include/test_generator_support.hpp Outdated Show resolved Hide resolved
@StephanTLavavej

This comment was marked as resolved.

* `const`-ify members of awaitable objects that can be `const`.
* Annotate that the iterator's `operator*` has a `/* strengthened */` _noexcept-specifier_.
tests/std/tests/P2502R2_generator/test.cpp Outdated Show resolved Hide resolved
tests/std/tests/P2502R2_generator/test.cpp Outdated Show resolved Hide resolved
tests/std/tests/P2502R2_generator/test.cpp Outdated Show resolved Hide resolved
tests/std/tests/P2502R2_generator/test.cpp Outdated Show resolved Hide resolved
tests/std/tests/P2502R2_generator/test.cpp Outdated Show resolved Hide resolved
tests/std/tests/P2502R2_generator_promise/test.cpp Outdated Show resolved Hide resolved
tests/std/tests/P2502R2_generator_promise/test.cpp Outdated Show resolved Hide resolved
@StephanTLavavej

This comment was marked as resolved.

Several minor nits, and I burned away all the unnecessary parts of "mutable rvalue reference type". Don't know where I was heading with it, but it never made it there.
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Copy link
Member

I had to push an additional commit to work around VSO-2254804 "EDG ICE in cpfe.dll!make_coroutine_result_expression with C++23 <generator> test" (an internal assertion, which is why we didn't see it with shipping EDG). I checked how much code I could enable without ICEing, and it turned out that the regions we need to workaround are exactly the same as for Clang x86.

@CaseyCarter
Copy link
Member Author

... it turned out that the regions we need to workaround are exactly the same as for Clang x86.

I suspect this is related to the confusion about coroutines and x86 MSABI discussed in LLVM-59382.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cxx23 C++23 feature generator C++23 generator
Projects
Status: Ready To Merge
Development

Successfully merging this pull request may close these issues.

P2502R2 <generator>: Synchronous Coroutine Generator For Ranges
5 participants