From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D0FB383A0D9; Sun, 11 Dec 2022 01:51:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D0FB383A0D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670723475; bh=RVnp5RwyDL/KCbzl5ry8jrzIXDwnAstZ3PabAoMi7z4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kWVTzZi47SYHuA5hQA/6z3IMkaM6ppIHWp2mv8j2alnKQj3taJ2j5+Ex4Py7CdZW4 yXbCuDLlkQGHwfI3QJiz3PMiB5RxREiilX/AOkMHGsMH8X9Kgp4yU4dqJJrne0Tph2 yOmfWfQ85B3D76Q6mxtwMHj9yXHTJrTFhbfS6b+Y= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106508] Extra warnings with lambda captures Date: Sun, 11 Dec 2022 01:51:13 +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: 11.2.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: 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=3D106508 --- Comment #1 from Andrew Pinski --- The first case you use default capturing as reference, therefor this will be captured just fine. The second case is similar to: struct f1{int *a;}; struct f1 f(int t) { struct f1 t1 =3D {&t}; return t1; } Which I thought we warned about but it looks like I was wrong.=