Skip to content

Fix duplicate is_cancelled overload with standalone Asio - #2463

Open
gycherish wants to merge 1 commit into
NVIDIA:mainfrom
gycherish:fix-standalone-asio-is-cancelled
Open

gycherish wants to merge 1 commit into
NVIDIA:mainfrom
gycherish:fix-standalone-asio-is-cancelled

Conversation

@gycherish

Copy link
Copy Markdown

When STDEXEC_ASIO_USES_STANDALONE is configured, error_code is an alias for std::error_code (see asio_config.hpp.in), so the two is_cancelled overloads in exec/asio/use_sender.hpp have identical signatures and the header fails to compile (MSVC C2084; GCC/Clang report a redefinition). The exec::asio adapter currently only compiles in the Boost configuration.

This guards the std::error_code overload to the Boost configuration, where boost::system::error_code and std::error_code are distinct types. The remaining overload already covers both operation_aborted and operation_canceled, so behavior under standalone Asio is unchanged.

Repro: configure with -DSTDEXEC_ENABLE_ASIO=ON -DSTDEXEC_ASIO_IMPLEMENTATION=standalone and include exec/asio/use_sender.hpp in any translation unit.

Verified with MSVC (VS 2026) and standalone Asio 1.36.0; a timers + TCP loopback use_sender smoke test passes (also under AddressSanitizer) with this fix.

When `STDEXEC_ASIO_USES_STANDALONE` is defined, `error_code` is an alias
for `std::error_code`, so the two `is_cancelled` overloads in
`exec/asio/use_sender.hpp` have identical signatures and the header fails
to compile (MSVC C2084; GCC/Clang report a redefinition). Guard the
`std::error_code` overload to the Boost configuration, where the types
are distinct; the remaining overload already handles both
`operation_aborted` and `operation_canceled`, so standalone behavior is
unchanged.
@copy-pr-bot

copy-pr-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test 1805010

This branch has not been deployed

No deployments
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.

2 participants