From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B7602385E45F; Sat, 16 Mar 2024 10:35:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7602385E45F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710585354; bh=pHJShAAGavpYCF5p+F+No+bmOzQjn6Cz1bbzDXgi/H8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=t/SQer+2AUUaUv51ses9YFgAujknmRSTJp/rDHnMniXWrAM/74OjguZ4C3LI0HbI7 xKSEuV5KFCvGx9aWPsBqtX/+FXhokErvjQwyBU5E0SfwIYf4OwG+Kbsbe+0G9t2+zD 6cZOfd85vxY4kFLY66EP7ebuwZMTibyYlNg9EQTs= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114357] Add a way to not call deconstructors for non-auto decls, like clang's no_destroy attribute Date: Sat, 16 Mar 2024 10:35:53 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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: everconfirmed cf_reconfirmed_on bug_status 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=3D114357 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2024-03-16 Status|UNCONFIRMED |NEW --- Comment #8 from Jonathan Wakely --- e.g. PR 107500 where a bare metal system wastes space for a no-op destructo= r. It would be a lot simpler if we could just mark immortal objects as [[no_destroy]] and not have to dance around what the standard allows (or no= t) about lifetimes and triviality for objects with static storage duration. It would also be better to not rely on DCE being able to figure out what we're trying to do with unions and empty destructors. There are valid use cases in a kernel or language runtime for ensuring that some objects do not end their lifetime while other code is still running.=