From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1083D3851C1D; Tue, 9 Jun 2020 05:33:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1083D3851C1D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591680788; bh=rzzbc2Uvy6Z3Xxs+Nzru71Ve0SqHFfuDH9Uzajy4LQ8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Jj5kc38rnxfo7pUbBEQ4wd3n18L6VqHJqn6PJjyAIkV1k6KO0phN4/scWCnmNWwSz 7cuytW2X8yyvW8L/YrBXO6krmEAUL8XwIlPyk5/Zq0Gwv2odd+4P8yMr1YAXgvKWyV pD2gtyLEO9m/pNoJmO3prXTQe6pqpF7AdLEF4OsY= From: "lewissbaker.opensource at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95599] [coroutines] destructor for temporary operand to co_yield expression called before end of full-expression Date: Tue, 09 Jun 2020 05:33:07 +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: 10.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lewissbaker.opensource at gmail dot com 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: 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: Tue, 09 Jun 2020 05:33:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95599 --- Comment #1 from Lewis Baker -= -- Note there is also some different behaviour if we change the example slight= ly by removing awaitable::~awaitable() and leaving the awaitable type with a trivial destructor. See https://godbolt.org/z/ff5Uvy In this case, instead of the resource destructor being called before the coroutine suspends, the resource destructor is never called. ie. observed output becomes: ``` resource() awaitable::await_suspend() awaitable::await_resume() ```=