From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 51A473858407; Sat, 5 Nov 2022 05:27:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51A473858407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667626068; bh=6GkkCwYezn0xHoP5FWy5Bz2kgykYl4vwk/pRxwsyTUA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JCL/AXn+qPhMJfTi4KFXw59X1PUHHRukcwnw6HdirZQHk3wawQeR45zAA96b06OkY qteOsPCxO9++CgBgN5GWGRXecrpE8CG/0UFoJ78B0kOdEwch9HYeDV8Wcrv8POJ9dh gng5rSMJH1zBlSgxtdvHpP2tYRKamt1BCf2nt7zA= From: "nightstrike at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107531] List of references calls destructors, add warning? Date: Sat, 05 Nov 2022 05:27:29 +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: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nightstrike 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107531 --- Comment #2 from nightstrike --- It looks like you're right. The root cause of the problem is that in my non-reduced case, I didn't have a copy constructor, but I had a non-default destructor that was releasing resources twice. So it's clearly my fault, I just kind of hoped the compiler could be a little more omniscient :) If a warning is not really possible here, then I guess this could be "closed invalid". Or maybe there are already PR's open to request a warning to rem= ind you that you did something requiring a non-default copy constructor?=