From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0ADC13858409; Fri, 10 Mar 2023 17:17:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0ADC13858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678468646; bh=Sv7mjR1EOT5PaVBNbJPdYk+rdYCu5vBID8hqwOucckA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dA1bdP2fQ//E3xv8tCQLfqZFHsebgMsdABh80g5eZTPIDGKomGlDR+NG5E3u+hk2B FQ3nDyypjVByeuosZfCcBFAnWxjeE1JGjxtcez1V99Ye7Wir2S66Gsk5YBfw9dSz18 ipHKBphxpNGJHDVdrBQEWi0tFg51e30S6hjlotBw= From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107532] [13 Regression] -Werror=dangling-reference false positives in libcamera-0.0.1 Date: Fri, 10 Mar 2023 17:17:25 +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: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D107532 --- Comment #18 from Marek Polacek --- (In reply to Jonathan Wakely from comment #16) > Span is a view, so it is like reference-wrapper. The lifetime of the > underlying data is not tied to the lifetime of the Span. Aha, I could add a check for std::span but that wouldn't help, because here it's a custom-made Span. And I don't think there's a pattern I could look = for that would tell us "this is a std::span-like class". :/ (In reply to Barnab=C3=A1s P=C5=91cze from comment #17) > The simple test case with std::span still triggers the warning: > https://gcc.godbolt.org/z/43cKxdqr3. I feel that without deeper code > analysis such a warning will generate too many false positives and people > will simply turn it off. There really haven't been that many, except this and one with range-based f= or loops.=