Repository navigation
Conversation
ispeters
force-pushed
the
check-noexcept-through-domain-transform
branch
from
October 28, 2026 18:29
9502c06 to
f90b85b
Compare
Contributor
Author
|
This depends on #2377. |
`transform_sender` transforms a sender repeatedly, until a domain's transformation returns a sender of the same type, and its `noexcept` is meant to be the conjunction of the steps'. The step that ends the recursion reports only its own `noexcept`, though, dropping the earlier steps'. So when a potentially-throwing transformation returns a sender that's then transformed again, for example by `default_domain`'s identity transformation, `transform_sender`, and with it `connect`, claim not to throw, and an exception thrown by the transformation calls `std::terminate`. This diff makes the last step report the conjunction too. That exposes a missing `noexcept` on `sequence`'s lowering, whose `transform_sender` had no exception specification, so connecting a `sequence`, or a `repeat_n`, which connects one, became potentially-throwing. It's now `noexcept` exactly when moving or copying the children into the lowered sender is. The new tests check that a potentially-throwing transformation whose result is transformed again makes `transform_sender` and `connect` potentially-throwing, that its exception propagates out of `connect`, and when lowering a `sequence` is `noexcept`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `noexcept` function type promises that invoking its factory and connecting the sender the factory returns don't throw, and its constructors check that promise against the factory. Until now, the check skipped any sender that a domain transforms, trusting both the transformation and the transformed sender's `connect`, so it accepted factories whose senders can throw when connected, including any sender passed to `bulk`, whose default lowering isn't declared `noexcept`. `connect` passes the sender through `transform_sender` first, and its `noexcept` accounts for the transformation, so this diff checks `connect`'s `noexcept` for every sender. Checking the transformation when the function is constructed is sound because no caller can change it: the domains that can transform the sender depend only on the sender and on the queries the function type declares. The new tests check that a `noexcept` transformation into a sender that connects without throwing is accepted, and that a transformation that may throw, or one into a sender whose `connect` may throw, is rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ispeters
force-pushed
the
check-noexcept-through-domain-transform
branch
from
October 29, 2026 02:32
f90b85b to
79a8a26
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A
noexceptfunction type promises that invoking its factory and connecting the sender the factory returns don't throw, and its constructors check that promise against the factory. Until now, the check skipped any sender that a domain transforms, trusting both the transformation and the transformed sender'sconnect, so it accepted factories whose senders can throw when connected, including any sender passed tobulk, whose default lowering isn't declarednoexcept.connectpasses the sender throughtransform_senderfirst, and itsnoexceptaccounts for the transformation, so this diff checksconnect'snoexceptfor every sender. Checking the transformation when the function is constructed is sound because no caller can change it: the domains that can transform the sender depend only on the sender and on the queries the function type declares.The new tests check that a
noexcepttransformation into a sender that connects without throwing is accepted, and that a transformation that may throw, or one into a sender whoseconnectmay throw, is rejected.