https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114393
Bug ID: 114393
Summary: over eager "invalid use of void expression" ?
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: prlw1 at cam dot ac.uk
Target Milestone: ---
When trying to use the reference implementation of the `std::execution`
proposal over at https://github.com/nvidia/stdexec, I get errors of the form
/usr/src/local/stdexec/include/exec/async_scope.hpp:735:31: error: invalid use
of void expression
735 | return when_empty(just());
with `g++ (GCC) 14.0.1 20240318 (experimental)`
In https://github.com/NVIDIA/stdexec/issues/1285 Eric Niebler traces this to
a__make_sexpr invocations which can't ever have type void.
The easiest way to reproduce this is to see the standard example on goldbolt:
https://godbolt.org/z/3cseorf7M
It compiles fine with gcc 12.3 and 13.2 (even with `-Wall -Wextra
--pendantic-errors`, but not with gcc trunk, which possibly suggests a
regression.
I have been using stdexec successfully for a while with trunk. Old checkouts of
stdexec which used to work (with maybe gcc trunk from about 2 months ago?) now
fail, which also points towards a change in gcc rather than in stdexec.