From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9B6F63857346; Sat, 15 Apr 2023 02:19:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B6F63857346 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681525181; bh=JFzYUJdI7JMo/bamB15MRJOBQfH+DatHdkzrx8ctzGw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UPS/P7lm91ouqpw4SvSrI7cMwFunhhyu1oi0jVQGhKaSCAMa9JwSwZQmUTexr6LfK 6ScnbKpPiHa5kYZAYGfsPOCiVpe8YHLAaqKu2/SR4Cg3gvBvczwP73b9fbisjG8DeE Fk+Qaj+gvdBYsvUZDdHqRC9p6nwe0/p6ORDEADEs= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109514] [13 regression] -Werror=dangling-pointer false positive nn fheroes-1.0.3 (lambdas) Date: Sat, 15 Apr 2023 02:19: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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jason 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=3D109514 --- Comment #2 from CVS Commits --- The trunk branch has been updated by Jason Merrill : https://gcc.gnu.org/g:9964df74a9e99e850bf9b0b6ff5c47133f846db8 commit r13-7190-g9964df74a9e99e850bf9b0b6ff5c47133f846db8 Author: Jason Merrill Date: Fri Apr 14 13:37:16 2023 -0400 -Wdangling-pointer: fix MEM_REF handling [PR109514] Here we hit the MEM_REF case, with its arg an ADDR_EXPR, but had no handling for that and wrongly assumed it would be a reference to a local variabl= e. This patch overhauls the logic for deciding whether the target is somet= hing to warn about so that we only warn if we specifically recognize the tar= get as non-local. None of the existing tests regress as a result. PR c++/109514 gcc/ChangeLog: * gimple-ssa-warn-access.cc (pass_waccess::check_dangling_store= s): Overhaul lhs_ref.ref analysis. gcc/testsuite/ChangeLog: * g++.dg/warn/Wdangling-pointer-6.C: New test.=