From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 09DC63858D39; Wed, 1 Feb 2023 18:04:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09DC63858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675274657; bh=gYLRhLrdhz3zxFhdNFw2B/Zw2QkjrqeYjpFZq+P7nvo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eBl5pXoI4C8svflb4r/UUhwnGz2/MxB5VK4suKpA2+IFypdn8NziI0FEko3zWBVp0 vbKiOjlByiFMIyY/jow+2XtEN56lUIg5p3qCe6/u4al9xKKtw4QZGxoB6HC59EDLpD 1DNHpzDRY8N/oztpIgxR7712ZCcq3mn7u3n163A0= From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108165] -Wdangling-reference false positive Date: Wed, 01 Feb 2023 18:04:16 +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: mpolacek at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D108165 --- Comment #5 from Marek Polacek --- Sorry, I'm not sure if the false positive in comment 0 can be fixed. I can= 't simply compare the type of the temporary argument and the return type, beca= use we may be returning a subobject of the temporary argument, which is still dangerous.=