Skip to content

Error completion signature of let_error changed recently #2197

Description

@dkolsen-pgi

This test program started getting compilation errors about five days ago.

#include <stdexec/execution.hpp>

int main() {
  auto snd = stdexec::just_error(2) |
             stdexec::let_error([](int n) noexcept {
                 return stdexec::just_error(n * 10);
             }) |
             stdexec::upon_error([](int n) noexcept { return n + 3; });
  auto opt = stdexec::sync_wait(std::move(snd));
  assert(opt.has_value());
  assert(std::get<0>(*opt) == 23);
}

When compiled with nvc++ 26.5 with the latest stdexec main branch:

$ nvc++ --c++26 --no-stdexec -isystem /proj/cuda/stdexec/main/include letg.cpp
"/proj/cuda/stdexec/main/include/stdexec/__detail/__upon_error.hpp", line 213: error: the deduced placeholder type "stdexec::__sexpr_t<stdexec::upon_error_t, lambda [](int)->int noexcept, stdexec::<unnamed>::__sexpr<lambda [](_Desc)->auto{}>>" (aka "stdexec::<unnamed>::__sexpr<lambda [](_Desc)->auto{}>") failed the type constraint
      constexpr auto operator()(_Sender&& __sndr, _Fun __fun) const -> __well_formed_sender auto
                                                                       ^
"/proj/cuda/stdexec/main/include/stdexec/__detail/__senders.hpp", line 75: note: concept is false for arguments "<stdexec::<unnamed>::__sexpr<lambda [](_Desc)->auto{}>>"
    concept __well_formed_sender = sender_in<_Sender> || dependent_sender<_Sender>;
                                                         ^
"/proj/cuda/stdexec/main/include/stdexec/__detail/__sender_concepts.hpp", line 245: note: concept is false for arguments "<stdexec::<unnamed>::__sexpr<lambda [](_Desc)->auto{}>>"
    concept dependent_sender = sender<_Sender> && __is_dependent_sender<_Sender>;
                                                  ^
"/proj/cuda/stdexec/main/include/stdexec/__detail/__get_completion_signatures.hpp", line 454: note: concept is false for arguments "<stdexec::_ERROR_<stdexec::_WHAT_ (stdexec::_INVALID_EXPRESSION_), stdexec::_WHY_ (stdexec::_FUNCTION_IS_NOT_CALLABLE_WITH_THE_GIVEN_ARGUMENTS_), stdexec::_WHERE_ (stdexec::_IN_ALGORITHM_, stdexec::upon_error_t), stdexec::_WITH_FUNCTION_ (lambda [](int)->int noexcept), stdexec::_WITH_ARGUMENTS_ (std::__exception_ptr::exception_ptr)>, stdexec::dependent_sender_error>"
      __std::derived_from<__completion_signatures_of_t<_Sender>, dependent_sender_error>;
      ^
"/proj/cuda/stdexec/main/include/stdexec/__detail/__senders.hpp", line 75: note: concept is false for arguments "<stdexec::<unnamed>::__sexpr<lambda [](_Desc)->auto{}>>"
    concept __well_formed_sender = sender_in<_Sender> || dependent_sender<_Sender>;
                                   ^
"/proj/cuda/stdexec/main/include/stdexec/__detail/__sender_concepts.hpp", line 181: note: atomic constraint evaluates to false
      && __constant_completion_signatures_v<STDEXEC::get_completion_signatures<_Sender, _Env...>()>;
         ^
"/usr/include/c++/11/concepts", line 67: note: atomic constraint evaluates to false
      concept derived_from = __is_base_of(_Base, _Derived)
                             ^
          detected during instantiation of "auto stdexec::upon_error_t::operator()(_Sender &&, _Fun) const->stdexec::__well_formed_sender auto [with _Sender=stdexec::<unnamed>::__sexpr<lambda [](_Desc)->auto{}>, _Fun=lambda [](int)->int noexcept]" at line 8 of "letg.cpp"

1 error detected in the compilation of "letg.cpp".

Even though the error message is coming from upon_error, it is the behavior of let_error that changed. It looks like the error completion for that let_error is std::execption_ptr when it had been int previously.

I spent a little time trying to find the change that triggered this failure, but it wasn't obvious to me and I stopped looking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions