make_future: drop static_assert from detail::make_future#7282
Conversation
Up to standards ✅🟢 Issues
|
|
Can one of the admins verify this patch? |
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.
64bf4c9 to
8097af5
Compare
|
@guptapratykshh Could you turn that static_assert into a runtime assert ( |
8097af5 to
cef6e84
Compare
…SERT_MSG to preserve runtime guard without breaking GCC 12 debug SFINAE Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
cef6e84 to
2f0dba0
Compare
Proposed Changes
static_assertinsidedetail::make_future(Sender, Allocator)(introduced by make_future: static_assert against silent-hang run_loop_scheduler sender #7248) withHPX_ASSERT_MSGand keep thesender_completion_is_run_loop_schedulertrait that backs it. Thestatic_assertwas a hard error during template substitution and broketag_priority's overload-resolution probing on GCC 12 debug, surfacing in rostam CDash build 53308 on thealgorithm_run_loop.cpptest cases that usemake_future(just(3) | continues_on(sched)).HPX_ASSERT_MSGis a no-op in release builds and a runtime check in debug, so it does not interfere with substitution, while still flagging the silent-hang misuse during development.#include <hpx/assert.hpp>tomake_future.hppforHPX_ASSERT_MSG.make_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), so reaching this 1-arg fallback with a run-loop completion scheduler indicates a direct call todetail::make_futurerather than going through the public API; the runtime assert exists to flag that bypass in debug, not to harden release-mode misuse.Any background context you want to provide?
Checklist
Not all points below apply to all pull requests.