https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100476
Bug ID: 100476
Summary: coroutines: questionable handling of void
get_return_object
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jason at gcc dot gnu.org
CC: iains at gcc dot gnu.org
Target Milestone: ---
morph_fn_to_coro includes the comment
/* For class type return objects, we can attempt to construct,
even if the gro is void. */
I don't see anything in the standard to allow this.
Disabling that support breaks pr96749-2.C, pr94879-folly-1.C,
pr94883-folly-2.C, which all have void get_return_object() and a coroutine that
returns non-void. I believe this is the result of testcase reduction, not
something that a user actually wrote.
Munging the second of those to appease clang gives the error I expect:
https://godbolt.org/z/PTbsWf8hj
<source>:50:3: error: no viable conversion from returned value of type 'void'
to function return type 'n'