From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5D75A3857738; Wed, 26 Apr 2023 23:40:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D75A3857738 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682552409; bh=tkqbTiJIvPDD/8t3K9so6i44HJsAqNg8Tfp5u+XZU0k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cpynxAkcdcUwi/ggRNQL3inZhS7plLOX/khIerPsBvnLoX1cA6at1b13pr5ykCrZ3 ACBKKS6rMbS6v9H1Ijf4ox7pXM8aLvblGdggj2OLWFSOguJp2MauOOzHjKq44DOm8m ZIBGhLDIdrAOcj4L5HW5mISGP9ohV+HikqB6SEoI= From: "pinskia 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: Wed, 26 Apr 2023 23:40:09 +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: pinskia at gcc dot gnu.org 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: keywords 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 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic --- Comment #1 from Andrew Pinski --- Reduced testcase: ``` struct f{}; int &&ffa(const f&, int &r) { return static_cast(r); } void b() { int a; int&& i =3D ffa(f{}, a); i =3D 1; } ``` Should see f{} is an empty struct which is exactly the same as the lambda h= ere.=