From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9B10E3858D28; Thu, 8 Sep 2022 08:52:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B10E3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662627147; bh=Cg9dYw/8JPINnJX51i2dZKf3AZRMdLksz5yIHYOQNBo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=u8qm8YnFDad0D69ceoYC3bjeovhdfbArGJNMcpCYTwJaV763polfrIhTjjEJFtQMm wD92WxGg305uo/H20zqIzJXFD5p4CsPKFmoOTP9Sep4USr+myiH7BXmWvmsc2Pros1 YFUzH1OB3Kqr3QfyB0MnanO4QL3TLbURXg3W6CV8= From: "avi at scylladb dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106847] deprecated class data member makes the class generate diagnostics even when the member is not used Date: Thu, 08 Sep 2022 08:52:26 +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: 13.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: avi at scylladb 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=3D106847 --- Comment #3 from Avi Kivity --- But I need it to be copied. It's a struct of options: struct options { bool frob =3D false; [[derecated]] bool quux =3D false; // will be removed soon bool grue =3D false; }; The fact that it's deprecated doesn't mean it can be coerced to false. Sure, I can create custom constructors and assignment operators, but I lose designated initializers. btw, the destructor doesn't trigger the deprecation warning, even though it does use the deprecated member. I think it's more reasonable to only emit the warning when the member is explicitly used.=