From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 36F953857BB7; Fri, 23 Sep 2022 15:10:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36F953857BB7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663945855; bh=nnX66yN6RfrL2Ehz/Y1tSyOYRES3VIEbMhhMU2f8x60=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wSzBdvkM8bBE14RChUFAXo+OUVYJAjNy+P4Dvg0SOkZhoi3o0+50DqL0cyeEw+ZzX waa3sXBiHZHM3KW+rBKSu+Gn+opwqz4S/fcBIPOe9Upri+/BmKtn5v8y8IFfjYomxx zbwyhQbodqG/SoYXRNobfvrjqzXiVluRzq6t9zaY= From: "mario at klebsch dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107019] -Wunused-but-set-variable false positive for static variable in lambda with boost Date: Fri, 23 Sep 2022 15:10:55 +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.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mario at klebsch dot de 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: cc attachments.created 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=3D107019 Mario Klebsch changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mario at klebsch dot de --- Comment #1 from Mario Klebsch --- Created attachment 53619 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53619&action=3Dedit Sample demonstrating the bug Needs boost-1.80.0 compile with g++ -Wall -c -I boost_1_80_0 bug2.cpp > ~/tmp $ g++ -Wall -c -I boost_1_80_0 bug2.cpp > bug2.cpp: In function =E2=80=98int main(int, char**)=E2=80=99: > bug2.cpp:17:28: warning: variable =E2=80=98func=E2=80=99 set but not used= [-Wunused-but-set-variable] > 17 | static const char *func =3D __FUNCTION__; > | ^~~~ > ~/tmp $=