NVIDIA/stdexec

gcc trunk unhappy with just()

prlw1 opened this issue · 4 comments

gcc trunk is unhappy with stdexec::just()

Simply trying gcc trunk on the godbolt README example gives

<source>: In function 'int main()':
<source>:23:45: error: no match for 'operator|' (operand types are 'void' and 'stdexec::__closure::__binder_back<stdexec::__then::then_t, main()::<lambda(int)> >')
   23 |         stdexec::on(sched, stdexec::just(0) | stdexec::then(fun)),
      |                            ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
      |                                         |                  |
      |                                         void               stdexec::__closure::__binder_back<stdexec::__then::then_t, main()::<lambda(int)> >

async_scope.hpp is similarly unhappy:

/usr/src/local/stdexec/include/exec/async_scope.hpp: In member function 'auto exec::__scope::async_scope::on_empty() const':
/usr/src/local/stdexec/include/exec/async_scope.hpp:735:31: error: invalid use of void expression
  735 |         return when_empty(just());
      |                           ~~~~^~
/opt/compiler-explorer/libs/stdexec/trunk/include/stdexec/execution.hpp:2623:31: error: invalid use of void expression
 2623 |           __make_sexpr<then_t>(static_cast<_Fun&&>(__fun), static_cast<_Sender&&>(__sndr)));
      |           ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

__make_sexpr invocations can't ever have type void. This seems like a bug in gcc-trunk to me. I suggest reporting it there.

How did you manage to get it to spit out that error message? (I don't see mention of __make_sexpr anywhere in my output.)

The gcc team are already on the case: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114393