From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C3EE03857350; Tue, 16 May 2023 19:40:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3EE03857350 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684266041; bh=zau3JQYncuY1TN7ouid+hUDXjdJc/FS2gCYRnZ3nMHc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QECGOp8HjRY0I3TTvgdtxgBdIiznUmIK2cj2taOIrK+/5lYgEABm2Wp3+z8pEaH57 DpvCyKl2a5eCQwM+3E1hyQ/oHRS8XWEQbSV0bCnT7JgcOSVZEtSFT3zAzHZu03JJhs jd6q126ihh2r2bNW2kACoMLNetceb0cD/RaEfxKY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109774] template function causes Spurious dangling reference warning while non-template does not Date: Tue, 16 May 2023 19:40:41 +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.1.0 X-Bugzilla-Keywords: diagnostic 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: mpolacek 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=3D109774 --- Comment #3 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:f25d2de17663a0132f9fe090dee39d3b1132067b commit r14-919-gf25d2de17663a0132f9fe090dee39d3b1132067b Author: Marek Polacek Date: Tue May 16 14:12:06 2023 -0400 c++: -Wdangling-reference not suppressed in template [PR109774] In check_return_expr, we suppress the -Wdangling-reference warning when we're sure it would be a false positive. It wasn't working in a template, though, because the suppress_warning call was never reached. PR c++/109774 gcc/cp/ChangeLog: * typeck.cc (check_return_expr): In a template, return only aft= er suppressing -Wdangling-reference. gcc/testsuite/ChangeLog: * g++.dg/warn/Wdangling-reference13.C: New test.=