From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B0FFA386EC78; Sun, 17 Jan 2021 13:29:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0FFA386EC78 From: "m.krause@tu-harburg.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98704] coroutine_handle::done() == false after promise's unhandled_exception() has thrown Date: Sun, 17 Jan 2021 13:29:21 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: m.krause@tu-harburg.de X-Bugzilla-Status: UNCONFIRMED 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: attachments.created 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 13:29:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98704 --- Comment #1 from Michael Krause --- Created attachment 49985 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D49985&action=3Dedit A possible fix? Would this be the proper way to fix the problem? That is, instead of genera= ting a simple "promise.unhandled_exception()" call, generate: try { promise.unhandled_exception(); } catch(...) { resume_fn_ptr =3D 0; // ensure that done() returns true throw; } Seems to fix my problem, but then I don't know the gcc code base; maybe the change has undesired side effects. If somebody can confirm this is the way = to go, I would be willing to provide a cleaned-up, mergable version including = test cases etc...=