Skip to content

make_future: drop static_assert from detail::make_future#7282

Open
guptapratykshh wants to merge 1 commit into
TheHPXProject:masterfrom
guptapratykshh:fix/make_future-revert-7248-static-assert
Open

make_future: drop static_assert from detail::make_future#7282
guptapratykshh wants to merge 1 commit into
TheHPXProject:masterfrom
guptapratykshh:fix/make_future-revert-7248-static-assert

Conversation

@guptapratykshh
Copy link
Copy Markdown
Contributor

Proposed Changes

  • Drop the sender_completion_is_run_loop_scheduler trait and the static_assert added inside detail::make_future(Sender, Allocator) by make_future: static_assert against silent-hang run_loop_scheduler sender #7248. They were intended to catch make_future(sender) calls whose set_value completion scheduler is run_loop_scheduler (1-arg overload would silently hang because future_data has no loop.run() driver), but the static_assert is a hard error during template substitution, not a SFINAE-friendly constraint, so it breaks tag_priority's overload-resolution probing on GCC 12 debug.
  • Add an explanatory comment in detail::make_future pointing at the actual silent-hang protection: the public make_future CPO's tag_override_invoke overload already routes make_future(run_loop_sender) to the scheduler-form tag_invoke, which builds future_data_with_run_loop and drives loop.run() in execute_deferred.

Any background context you want to provide?

Checklist

Not all points below apply to all pull requests.

  • I have added a new feature and have added tests to go along with it.
  • I have fixed a bug and have added a regression test.
  • I have added a test using random numbers; I have made sure it uses a seed, and that random numbers generated are valid inputs for the tests.

@guptapratykshh guptapratykshh requested a review from hkaiser as a code owner May 20, 2026 03:28
Copilot AI review requested due to automatic review settings May 20, 2026 03:28
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 20, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@StellarBot
Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_scheduler and the static_assert in detail::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.

Comment thread libs/core/execution/include/hpx/execution/algorithms/make_future.hpp Outdated
…2 debug regression)

Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
@guptapratykshh guptapratykshh force-pushed the fix/make_future-revert-7248-static-assert branch from 64bf4c9 to 8097af5 Compare May 20, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants