Interaction with passing lvalue to set_value when sender sends a value
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- cpp
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Tái hiện chẩn đoán bằng lệnh gcc-13 được báo cáo và tệp mẫu set_value.cpp, sau đó kiểm tra khu vực xung quanh việc kiểm tra completion-signature trong stdexec/include/stdexec/execution.hpp. Xác định cách xử lý dự kiến đối với một lvalue được truyền vào set_value khi sender khai báo set_value_t(int), và bổ sung coverage thể hiện hành vi đã thống nhất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In the sample code below, compiling with gcc-13 ( g++-13 -std=c++20 set_value.cpp -I stdexec/include -c), my bespoke sender claims it completes with set_value_t(int), although the implementation ends up sending an lvalue v, an int declared on the stack.
#include <stdexec/execution.hpp>
#include <exec/finally.hpp>
struct StdexecSender {
using is_sender = void;
template <class Receiver>
struct Operation {
Receiver r;
friend auto tag_invoke(stdexec::start_t, Operation& self) noexcept {
int v = 0;
stdexec::set_value((Receiver&&)self.r, v);
};
};
template <class Self, class Receiver>
requires (std::same_as<StdexecSender, std::remove_cv_t<Self>>)
friend auto tag_invoke(stdexec::connect_t, Self&& self, Receiver&& r) {
return Operation<std::decay_t<Receiver>>(std::forward<Receiver>(r));
}
using completion_signatures = stdexec::completion_signatures<stdexec::set_value_t(int)>;
};
static_assert(stdexec::sender<StdexecSender>);
void foo() {
stdexec::sync_wait(exec::finally(stdexec::let_value(StdexecSender{}, [](auto&&...) { return StdexecSender{}; }), stdexec::just()));
}
I get the following diagnostic.
./stdexec/include/exec/../stdexec/execution.hpp:1010:38: warning: 'void stdexec::__debug::_ATTENTION_() [with _Warning = stdexec::_WARNING_<_COMPLETION_SIGNATURES_MISMATCH_, _COMPLETION_SIGNATURE_<stdexec::__receivers::set_value_t(int&)>, _IS_NOT_ONE_OF_<stdexec::__receivers::set_error_t(std::__exception_ptr::exception_ptr), stdexec::__receivers::set_value_t(int)>, _SIGNAL_SENT_BY_SENDER_<stdexec::__let::__sender<stdexec::_Yp<StdexecSender>, main()::<lambda(auto:86&& ...)>, stdexec::__let::let_value_t> > >]' is deprecated: The sender claims to send a particular set of completions, but in actual fact it completes with a result that is not one of the declared completion signatures. [-Wdeprecated-declarations]
The key part is
The sender claims to send a particular set of completions, but in actual fact it completes with a result that is not one of the declared completion signatures.
This makes sense given that technically, I should be sending std::move(v) or something of that nature. That said, the lvalue v is convertible to a plain value (I'm not sure what the type category is called here). My understanding is that set_value is akin to returning from a function. A function declared returning int can write return v - should I be able to write set_value(v) here?
- Ngôn ngữ chính
- C++
- Star
- 2.4k
- Fork
- 270
- Merge trung bình
- 2 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 37
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/stdexec
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 66/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
Tất cả issue của NVIDIA/stdexec
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
duckdb/duckdb-wasm#2258 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
objectionary/eo-graphs#75 ·
-
Coarray integration tests carry no LABELS, so run_tests.py silently skips them under every backend Đang mởcoarray
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
FISCO-BCOS/FISCO-BCOS#5642 ·