`sender_in` fails with GCC 13.1 due to `const completion_signatures` in `__constant_completion_signatures_v`

オープン
#2,078 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
cpp
領域
compilers

調査の方向性

stdexec/__detail/__sender_concepts.hpp から始め、特に __constant_completion_signatures_v とその GCC バージョン分岐を確認します。提供された reproducer.cpp を GCC 11.4 および GCC 13.1 で C++20 としてビルドし、その後 sender_in 制約の評価を追跡します。reproducer が GCC 13.1 でコンパイルでき、古いコンパイラのパスにリグレッションがないことをもって完了とします。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C++
スター
2.4k
フォーク
270
平均マージ
2日 17時間
マージ済み PR(30日)
37

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/stdexec のほかの issue

NVIDIA/stdexec の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。