From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9704F3857349; Tue, 16 May 2023 19:54:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9704F3857349 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684266845; bh=Cwy/0cxvW+GVO1nPLxHpZabQPXLxmYnU6d4oK44GtSY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HOSYZjcEu/c8JJrHplV+A3uc9HsOST+QtA9lPOMqiy7H1J1oED9xFjE4j81O4dJPK Jw4+qQCfWWRZcpfmdLveqUGISuWBgQSASZ+Jf6HGxREo24CFETGNomdADyEoNUSawV Uki5zmnALqpFmb4Siis/JKStRFQFtkidpQkppS1g= 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:54:05 +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 #4 from CVS Commits --- The releases/gcc-13 branch has been updated by Marek Polacek : https://gcc.gnu.org/g:22741a09a8cbf8a360e99e530b016233dd705ce4 commit r13-7337-g22741a09a8cbf8a360e99e530b016233dd705ce4 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. (cherry picked from commit f25d2de17663a0132f9fe090dee39d3b1132067b)=