https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102489

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=100476

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Arseny Solokha from comment #0)
> g++-12.0.0-alpha20210919 snapshot
> (g:32731fa5b0abf092029b8e2be64319b978bda514) ICEs when compiling the
> following testcase, reduced from gcc/testsuite/g++.dg/coroutines/pr95736.C,
> w/ -O1 -fcoroutines:
> 
> #include <coroutine>
> 
> struct footask {
>   struct promise_type {
>     std::suspend_never initial_suspend();
>     std::suspend_never final_suspend() noexcept;
>     void unhandled_exception();
>     void get_return_object();
>   };
> 
>   std::suspend_always foo;
> 
>   footask taskfun() { co_await foo; }
> };

the use a of a void get_return_object() to invoke a default CTOR for the
coroutine object was allowed (and I think that there was some code in early
coroutines libraries that expected this to work).

However, see PR100476, where it is considered that this is not implied by the
standard wording.

Clearly, we should not ICE in any event - but this could well be reclassified
as ice-on-invalid (it is on the TODO to check / produce a suitable error).

Reply via email to