make_future: drop static_assert from detail::make_future#7282
Open
guptapratykshh wants to merge 1 commit into
Open
make_future: drop static_assert from detail::make_future#7282guptapratykshh wants to merge 1 commit into
guptapratykshh wants to merge 1 commit into
Conversation
Up to standards ✅🟢 Issues
|
Collaborator
|
Can one of the admins verify this patch? |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes a non-SFINAE-friendly static_assert (and its helper trait) from detail::make_future(Sender, Allocator) that was introduced to prevent a known runtime hang for run-loop scheduled senders, and replaces it with an explanatory comment. The PR relies on the public make_future CPO’s existing tag_override_invoke routing to ensure run-loop completion schedulers are handled by the scheduler-form overload that drives loop.run().
Changes:
- Removed
sender_completion_is_run_loop_schedulerand thestatic_assertindetail::make_future(Sender, Allocator)that could break GCC 12 debug due to template probing/instantiation. - Added a comment explaining why the compile-time guard is not present in the fallback and where the actual run-loop driving behavior is implemented.
…2 debug regression) Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
64bf4c9 to
8097af5
Compare
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.
Proposed Changes
sender_completion_is_run_loop_schedulertrait and thestatic_assertadded insidedetail::make_future(Sender, Allocator)by make_future: static_assert against silent-hang run_loop_scheduler sender #7248. They were intended to catchmake_future(sender)calls whose set_value completion scheduler isrun_loop_scheduler(1-arg overload would silently hang becausefuture_datahas noloop.run()driver), but thestatic_assertis a hard error during template substitution, not a SFINAE-friendly constraint, so it breakstag_priority's overload-resolution probing on GCC 12 debug.detail::make_futurepointing at the actual silent-hang protection: the publicmake_futureCPO'stag_override_invokeoverload already routesmake_future(run_loop_sender)to the scheduler-formtag_invoke, which buildsfuture_data_with_run_loopand drivesloop.run()inexecute_deferred.Any background context you want to provide?
Checklist
Not all points below apply to all pull requests.