From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 17D6C3858D20; Thu, 27 Apr 2023 07:09:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17D6C3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682579353; bh=jLtsvlRh+2haxVufgOs5G52gBU1+9xec1iMf2H35qoU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kLxveaOClJe8QF8qBrSs4oRVMfr2UzJFh+pie0nFRQacwGa+SfJX6ww3kFSEC+ZYC zNALEQm5OuqEVqjzAEFNzt8gHJ7LZf0GlY3FfUgix7LntTiq/Lx+ddCP3D0G2F2n0z fsh8VsfWdxRnznFw55gylWuA5ALANu7pVP85Mv7o= From: "carlosgalvezp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109642] False Positive -Wdangling-reference with std::span-like classes Date: Thu, 27 Apr 2023 07:09:12 +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: carlosgalvezp at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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=3D109642 --- Comment #2 from Carlos Galvez --- Is there a way to tag classes to mark them for exclusion? Currently the war= ning is part of -Wall and leads to many false positives. The warning message also says "possibly" dangling reference. In my opinion "possibly" type of warnin= gs should not be part of -Wall due to the high FP rate. I also find it strange that it complains about const references, which anyw= ay extend the lifetime of the temporary, or?=