From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 01E343943426; Fri, 14 May 2021 16:21:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01E343943426 From: "nilsgladitz at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99576] [coroutines] destructor of a temporary called too early within co_await expression Date: Fri, 14 May 2021 16:21:04 +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.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: nilsgladitz 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: cc 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: Fri, 14 May 2021 16:21:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99576 Nils Gladitz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nilsgladitz at gmail dot c= om --- Comment #1 from Nils Gladitz --- I am seeing issues with lambdas and coroutines that I can't quite explain y= et. Specifically reference counting objects capture copied (e.g. std::shared_pt= r) seemed to decrease their reference count more often than they should. Found this issue which didn't quite seem to match but trying Pawe=C5=82 Weg= ner's test case I see something that may explain some weirdness (haven't fully digested the test case or disregarded the possibility that it is my fault though). With vanilla gcc 10.2.0 I am seeing what Pawe=C5=82 observed: START TASK Foo() ~Foo() IN LAMBDA With vanilla 10.3.0 and 11.1.0 I however see the following: START TASK Foo() IN LAMBDA ~Foo() ~Foo() i.e. the Foo destructor now gets called later but apparently twice=