fix(stdexec): silence unused-parameter warning in __fuse_token_fn - #2287
Merged
ericniebler merged 1 commit intoSep 25, 2026
Merged
Conversation
The unstoppable-token overload of __fuse_token_fn::operator() takes the receiver's stop token but intentionally ignores it (the net token is just the sender's captured token. Mark the parameter [[maybe_unused]] so that including <stdexec/execution.hpp> compiles cleanly with -Wall -Wextra -Werror on recent clang versions (e.g. Apple clang 21), where the warning fires on the uninstantiated template during header parsing. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com> EOF )
Contributor
Author
|
/ok to test |
ericniebler
approved these changes
Sep 24, 2026
Collaborator
|
/ok to test 2ec64ce |
Collaborator
|
thanks |
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.
Problem
Including
<stdexec/execution.hpp>fails to compile on recent clang versions (e.g. Apple clang 21, Xcode 26) when the user builds with-Wall -Wextra -Werror:Minimal repro (compiles with no stdexec API in use at all):
Root cause
The unstoppable-token overload of
__fuse_token_fn::operator()in__stop_when.hpptakes the receiver's stop token but intentionally ignores it — when the receiver's token is unstoppable, the net token is just the sender's captured token. Because it is an uninstantiated function template at header-parse time, clang (unlike GCC) still diagnoses the unused parameter, and-Wunused-parameteris part of-Wextra.CI misses this because
add_compile_diagnostics()applies-Wall -Wextra -Wpedantic -Werroronly forClang/GNUCMake compiler IDs — notAppleClang— and the Linux clang versions used in CI don't fire the diagnostic for this template. macOS users on Xcode 26 toolchains hit it immediately.A whole-tree scan with Apple clang 21 (
-Wall -Wextra -Werror) shows this is the only remaining such warning across all public headers; every other#includecompiles clean.Fix
Mark the intentionally-unused parameter
[[maybe_unused]], consistent with the existing convention in the codebase (e.g.exec/static_thread_pool.hpp,exec/sequence_senders.hpp,nvexec). No behavioral change.Verification
-Wall -Wextra -Werroron Apple clang 21 (Apple clang version 21.0.0); A/B-verified against pristinemain.stdexec/execution.hpp,functional.hpp,coroutine.hpp,stop_token.hpp,concepts.hpp) compile warning-free with-Wall -Wextra -Werroron Apple clang 21.test.stdexec: all tests pass (623 test cases / 3536 assertions), normal configuration.test.exec: all tests pass (365 test cases / 3438 assertions), normal configuration.STDEXEC_ENABLE_EXTRA_TYPE_CHECKING=ON: all pass, identical counts — no interaction with the debug-connect machinery.clang-format --dry-run --Werror(clang-format 21) passes on the touched file.