Skip to content

Commit 547d3bc

Browse files
fix(exec): use STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS in iterate operation state
The range, iterator, and sentinel members of __operation_base_base are part of an operation state, so the plain no_unique_address attribute is not the right macro for them: on gcc it must be dropped for immovable types (gcc#98995). STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS does exactly that -- it expands to nothing on gcc and to [[no_unique_address]] elsewhere -- and is what the rest of the codebase uses for operation state members. clang-format 21 clean; test.exec (394 cases) and test.stdexec (628 cases) pass in Release and Debug with STDEXEC_ENABLE_EXTRA_TYPE_CHECKING on.
1 parent 4ee2abc commit 547d3bc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎include/exec/sequence/iterate.hpp‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ namespace experimental::execution
9292
}
9393
}
9494

95-
STDEXEC_ATTRIBUTE(no_unique_address) _Range __range_;
96-
STDEXEC_ATTRIBUTE(no_unique_address) std::ranges::iterator_t<_Range> __iterator_;
97-
STDEXEC_ATTRIBUTE(no_unique_address)
95+
STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS
96+
_Range __range_;
97+
STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS
98+
std::ranges::iterator_t<_Range> __iterator_;
99+
STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS
98100
std::conditional_t<__cache_sentinel, std::ranges::sentinel_t<_Range>, __ignore> __sentinel_;
99101
trampoline_scheduler __scheduler_{};
100102
};

0 commit comments

Comments
 (0)