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

            Bug ID: 95505
           Summary: [coroutines] ICE assert with
                    get_return_object_on_allocation_failure
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bruck.michael at gmail dot com
  Target Milestone: ---

https://gcc.godbolt.org/z/2LXQ2c

#include <coroutine>

struct dummy
{
    struct promise_type
    {
        dummy get_return_object() const noexcept { return {}; }
        static dummy get_return_object_on_allocation_failure() noexcept {
return {}; }

        std::suspend_always initial_suspend() const noexcept { return {}; }
        std::suspend_never final_suspend() const noexcept { return {}; }
        void return_void() const noexcept {}
        void unhandled_exception() const noexcept {}
    };
};

dummy foo()
{
    co_return;
}

int main() {}
----

source>: In function 'dummy foo()':
<source>:20:1: internal compiler error: tree check: expected call_expr, have
error_mark in morph_fn_to_coro, at cp/coroutines.cc:4050
   20 | }
      | ^

Reply via email to