From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 235663858433; Tue, 2 May 2023 19:50:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 235663858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683057000; bh=GLeHSqC0rxSufVxxJ7LUsd8cvpOh5GM2f3ouzt2m+88=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UY0XlCfVb+HF8YqPu6V/xTyEiPTAPh/NQJjZxjD4bavoQzl0Y6w1XiIIEphkqaB+U dWXUhi8fZ3dE0Ti06yl+m+5mvPkD38x8MALGcwMFZqssmgizkoKYpAf7w+ggRF9/kP +I1mI2E41UtRxg7MRC2pK0tkCatFLR1LH1P2cgbs= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109642] False Positive -Wdangling-reference with std::span-like classes Date: Tue, 02 May 2023 19:49:59 +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=3D109642 --- Comment #7 from CVS Commits --- The releases/gcc-13 branch has been updated by Marek Polacek : https://gcc.gnu.org/g:6b927b1297e66e26e62e722bf15c921dcbbd25b9 commit r13-7276-g6b927b1297e66e26e62e722bf15c921dcbbd25b9 Author: Marek Polacek Date: Tue May 2 15:48:40 2023 -0400 c++: Move -Wdangling-reference to -Wextra [PR109642] Sadly, -Wdangling-reference generates false positives for std::span-like user classes, and it seems imprudent to attempt to improve the heuristic in GCC 13. Let's move the warning to -Wextra, that will hopefully reduce the number of false positives the users have been seeing with 13. I'm leaving the warning in -Wall in 14 where I think I can write code to detect std::span-like classes. PR c++/109642 PR c++/109640 PR c++/109671 gcc/c-family/ChangeLog: * c.opt (Wdangling-reference): Move from -Wall to -Wextra. gcc/ChangeLog: * doc/invoke.texi: Document that -Wdangling-reference is enabled by -Wextra.=