[async_scope] __future_opstate touches incomplete __future_state members when STDEXEC_ENABLE_EXTRA_TYPE_CHECKING=ON
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.4k
- Forks
- 270
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 39
Description
Requested by @ericniebler in #2271 — follow-up found while verifying that PR with -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING=ON. Fails on pristine main, so it is separate from the fix in #2271.
Description
With -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING=ON, building test/test_type_async_scope.cpp fails in include/exec/async_scope.hpp: __future_opstate accesses members of __future_state while that type is still incomplete. The debug machinery forces earlier instantiation of queries/members than a normal build does, exposing the incomplete type.
Reproduction
Configure/build the async_scope tests with the flag enabled (e.g. a TU including exec/async_scope.hpp compiled with -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING=1). Reproduces on pristine main.
Suggested fix direction
Forward-declare what __future_opstate needs, or move the accessed members into a base class defined before __future_opstate, so the debug build's earlier instantiation point is valid.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with include/exec/async_scope.hpp and inspect how __future_opstate accesses the incomplete __future_state. Configure and build test/test_type_async_scope.cpp with STDEXEC_ENABLE_EXTRA_TYPE_CHECKING=1 to reproduce the failure. Done means the async_scope test builds successfully on pristine main with the flag enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100