Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Misleading compile error for start_detached when not included

Đang mở
#1,921 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
cpp
Lĩnh vực
developer-experience

Hướng nghiên cứu

Tái hiện chẩn đoán với include-issue.cpp bằng cách sử dụng g++ ở chế độ C++20 và include stdexec/execution.hpp được nêu. So sánh các khai báo được stdexec/execution.hpp cung cấp với exec/start_detached.hpp và xác định xem lỗi được báo cáo hoặc khả năng hiển thị của header có phải là ngoài ý muốn hay không; được coi là hoàn tất khi hành vi include và chẩn đoán mong đợi được bao phủ bởi một bài kiểm thử hồi quy.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?
Ngôn ngữ chính
C++
Star
2.4k
Fork
270
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
43

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/stdexec

Tất cả issue của NVIDIA/stdexec

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.