From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ABE1C3857BB8; Tue, 30 Jan 2024 18:24:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABE1C3857BB8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706639095; bh=zxj/khcv20OiP8bFAF7/AgVdwSO7f8EO0hgeXm++bks=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qiNuN8KqIizKiz3iTh3RQHFkyPoNzJifxp3IAJ03hfe0GtLgeLmEmMWFZNg19guGD kXvnguVbq0XmnXQ4TVqnz9St4d6L/xFPawTUI0EXUrnhiokCUahXsumkj7lLe5vpm9 ZCL3QjWXaYXX5BhbhVJOgyX0E6yqBqFppIap8XDM= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109640] Spurious Wdangling-reference for argument to temporary lambda cast to rvalue reference Date: Tue, 30 Jan 2024 18:24:54 +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: RESOLVED X-Bugzilla-Resolution: FIXED 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=3D109640 --- Comment #7 from GCC Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:f2061b2a9641c2228d4e2d86f19532ad7e93d627 commit r14-8636-gf2061b2a9641c2228d4e2d86f19532ad7e93d627 Author: Marek Polacek Date: Thu Jan 25 12:08:14 2024 -0500 c++: avoid -Wdangling-reference for std::span-like classes [PR110358] Real-world experience shows that -Wdangling-reference triggers for user-defined std::span-like classes a lot. We can easily avoid that by considering classes like template struct Span { T* data_; std::size len_; }; to be std::span-like, and not warning for them. Unlike the previous patch, this one considers a non-union class template that has a pointer data member and a trivial destructor as std::span-like. PR c++/110358 PR c++/109640 gcc/cp/ChangeLog: * call.cc (reference_like_class_p): Don't warn for std::span-li= ke classes. gcc/ChangeLog: * doc/invoke.texi: Update -Wdangling-reference description. gcc/testsuite/ChangeLog: * g++.dg/warn/Wdangling-reference18.C: New test. * g++.dg/warn/Wdangling-reference19.C: New test. * g++.dg/warn/Wdangling-reference20.C: New test.=