Summary
A sender that compiles successfully with GCC 11.4 fails to compile with GCC 13.1 when passed to exec::start_detached.
The failure appears to come from the sender_in constraint. GCC 13.1 evaluates:
__constant_completion_signatures_v<STDEXEC::get_completion_signatures<_Sender, _Env...>()>
as false, apparently because decltype(_Completions) is const completion_signatures<...>.
GCC 11 succeeds because stdexec has a GCC < 13 workaround that removes const:
std::remove_const_t<decltype(_Completions)>
GCC 13 takes the other branch and does not remove const.
Reproducer
// reproducer.cpp
#include <stdexec/execution.hpp>
using S = decltype(stdexec::just());
static_assert(stdexec::sender_in<S, stdexec::__root_env>);
int main(){}
/* my usage:
#include <stdexec/execution.hpp>
#include <exec/start_detached.hpp>
int main(){
stdexec::inline_scheduler sch;
auto sender = stdexec::schedule(sch) | stdexec::then([]() noexcept { });
exec::start_detached(std::move(sender));
}
*/
cmake_minimum_required(VERSION 3.21)
project(issue_stdexec
VERSION 0.0.1
LANGUAGES CXX)
include(CPM.cmake)
CPMAddPackage(
NAME stdexec
GITHUB_REPOSITORY NVIDIA/stdexec
GIT_TAG 6d7ad68
)
add_executable(reproducer reproducer.cpp)
target_link_libraries(reproducer PUBLIC STDEXEC::stdexec)
Environment
Linux GCC 11.4: compiles successfully
Linux GCC 13.1: fails
C++ mode: -std=gnu++20
Possible Cause
The issue may be related to stdexec/__detail/__sender_concepts.hpp #2027 :
#if STDEXEC_GCC() && STDEXEC_GCC_VERSION < 1300
template <auto _Completions>
inline constexpr bool __constant_completion_signatures_v =
__valid_completion_signatures<std::remove_const_t<decltype(_Completions)>>;
#else
template <auto _Completions>
inline constexpr bool __constant_completion_signatures_v =
__valid_completion_signatures<decltype(_Completions)>;
#endif
On GCC 13.1, the remove_const_t workaround still seems necessary.
Summary
A sender that compiles successfully with GCC 11.4 fails to compile with GCC 13.1 when passed to
exec::start_detached.The failure appears to come from the
sender_inconstraint. GCC 13.1 evaluates:as
false, apparently becausedecltype(_Completions)isconst completion_signatures<...>.GCC 11 succeeds because stdexec has a GCC < 13 workaround that removes
const:GCC 13 takes the other branch and does not remove const.
Reproducer
Environment
Linux GCC 11.4: compiles successfully
Linux GCC 13.1: fails
C++ mode: -std=gnu++20
Possible Cause
The issue may be related to stdexec/__detail/__sender_concepts.hpp #2027 :
On GCC 13.1, the
remove_const_tworkaround still seems necessary.