Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Misleading compile error for start_detached when not included

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

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

評価

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

調査の方向性

include-issue.cppを、g++をC++20モードで使用し、示されているstdexec/execution.hpp includeを指定して診断を再現します。stdexec/execution.hppによって公開される宣言をexec/start_detached.hppと比較し、報告されたエラーまたはヘッダーの可視性が意図しないものかどうかを判断します。期待されるincludeの動作と診断が回帰テストでカバーされれば完了です。

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

説明

I am not sure if this is an issue that should be fixed
For the following code, im not including <exec/start_detached.hpp> for calling exec::start_detached:

#include <stdexec/execution.hpp>
// missing include file
// #include <exec/start_detached.hpp>

void do_some_work() {
    std::this_thread::sleep_for(std::chrono::milliseconds(100));
}

int main() {
    auto work = stdexec::just() | stdexec::then([] {
        do_some_work();
    });

    exec::start_detached(std::move(work));

    std::this_thread::sleep_for(std::chrono::seconds(1));
    return 0;
}

and the compiler gives error:

-> % g++ ./include-issue.cpp -I/some/random/path/stdexec/include -std=c++20 -ltbb
./include-issue.cpp: In function ‘int main()’:
./include-issue.cpp:14:25: error: no match for call to ‘(const experimental::execution::start_detached_t) (std::remove_reference<stdexec::{anonymous}::__sexpr<<lambda closure object>stdexec::<lambda()>()>&>::type)’
   14 |     exec::start_detached(std::move(work));
      |     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
  1. it's a bit misleading the compiler reporting "no match call" instead of "not defined", there might be a forward declarations seen by compiler
  2. given that im only including files under stdexec, seeing forward declarations from exec might not be an expected behavior?
主要言語
C++
スター
2.4k
フォーク
270
平均マージ
2日 10時間
マージ済み PR(30日)
42

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

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

はじめの一歩

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

NVIDIA/stdexec のほかの issue

NVIDIA/stdexec の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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