From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BA5E3385840B; Tue, 30 Nov 2021 00:46:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA5E3385840B From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103480] [10/11/12 Regression] -Werror=useless-cast with constexpr destructor Date: Tue, 30 Nov 2021 00:46:40 +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.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc target_milestone priority 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, 30 Nov 2021 00:46:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103480 Marek Polacek changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|-Werror=3Duseless-cast with |[10/11/12 Regression] |constexpr destructor |-Werror=3Duseless-cast with | |constexpr destructor Target Milestone|--- |10.4 Priority|P3 |P2 --- Comment #2 from Marek Polacek --- Started with r10-6527: commit aaa26bf496a646778ac861aed124d960b5bf549f Author: Jason Merrill Date: Sun Jan 26 22:58:32 2020 -0500 c++: Use constexpr to avoid wrong -Wsign-compare (PR90691). We would like to do constexpr evaluation to avoid false positives on warnings, but constexpr evaluation can involve function body copying th= at changes DECL_UID, which breaks -fcompare-debug. So let's remember that we need to avoid that. PR c++/90691 * expr.c (fold_for_warn): Call maybe_constant_value. * constexpr.c (struct constexpr_ctx): Add uid_sensitive field. (maybe_constant_value): Add uid_sensitive parm. (get_fundef_copy): Don't copy if it's true. (cxx_eval_call_expression): Don't instantiate if it's true. (cxx_eval_outermost_constant_expr): Likewise.=