From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CFD153858C39; Sun, 8 Oct 2023 21:55:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFD153858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696802126; bh=yrZEML2K94GQPkpfQQHHMHj+PfX+7pUoaTFUQ8C8pkI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ygcstXuLO6+Nhvo2UxQABEk6+7MDTmYxIe3+HzBVGZmm4QxTF9W8WdukiI09JeBZv g/VVu3KC9fwv7IZxdX+jbru80c8owLXzoK2fLY/urY/lLgA2wXDh4Znm2Di8TvzxDY qF3tah+2yFICO3m24qY2vVvl6+32VZekjgiF8dks= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111728] C++ 20 coroutine segmentation fault in generic lambda Date: Sun, 08 Oct 2023 21:55:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: C++-coroutines, c++-lambda X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on everconfirmed bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111728 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-10-08 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #2 from Andrew Pinski --- Reduced to just using coroutine header file: ``` #include struct promise; struct coroutine : std::coroutine_handle { using promise_type =3D ::promise; bool await_ready() { return false; } void await_suspend( coroutine_handle h) {} int await_resume() {} }; struct promise { coroutine get_return_object() { return {coroutine::from_promise(*this)}= ; } std::suspend_always initial_suspend() noexcept { return {}; } std::suspend_always final_suspend() noexcept { return {}; } void return_void() {} void unhandled_exception() {} }; coroutine=20 write_fields() { int static_buffer[10]; co_await [](auto) -> coroutine=20 { if (sizeof(static_buffer)); co_return; }(0); } ``` Confirmed.=