From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5C18238582BD; Wed, 2 Aug 2023 15:10:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C18238582BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690989032; bh=m1cbtb2sNFAjHIIe7TNsUBaJbqlGU3oa5feue2GSQ1o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LBvXlvZslRQsY3t+7WtXJ7aVJ1XPwpj6jszTuG1eOiBMIVqzPQdemWHccAu9pEESi ezplDeOcnqRQ6C8sNOu4F9TgTxwVBztIJzC9mzKSIMCNLG9dQ6TrdoTlZ5lGIW9+bS 1aMMk/QkM5U1lHi3yxqmN/3pEn68SWt1w2Kl4BeU= From: "sichert at in dot tum.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101027] Short-circuit behavior not respected with co_await in while head Date: Wed, 02 Aug 2023 15:10:31 +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.1.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: sichert at in dot tum.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: cc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101027 Moritz Sichert changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sichert at in dot tum.de --- Comment #2 from Moritz Sichert --- Created attachment 55677 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55677&action=3Dedit Coroutine that segfaults because it does not short-circuit I have encountered the same problem where co_await in a logical operation d= oes not short-circuit correctly. See the attached example. The code segfaults because in the condition "foo && co_await foo->foo(123)"= it starts executing the coroutine even if foo is nullptr. For some reason the error only occurs if the condition is nested in a logical-|| expression.=