From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 01A0B3858C2D; Fri, 3 Feb 2023 18:23:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01A0B3858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675448590; bh=rjsglLugw7ZPgTVBJlj4L+jeqS3mlDcyQaalt8vhMnE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SimgQokkEXzz0+rzmXbghvIMx267ROc7use/FFOwBLWAZeUuKKZp4cic00Lh7UWHP 3fY6rjLe49wRdmTXFQ4XUV+Kt/c7OwfCzgr4QtkBdgXRsB4gqP4JnRU0GJmVlZP4C0 DvilyFTUSD2RyvmlqSaWRoIo5IzLCtQTuOgw+s5o= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108242] [10/11/12/13 Regression] '__FUNCTION__' was not declared when used inside a generic (templated) lambda declared inside a template function Date: Fri, 03 Feb 2023 18:23: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: 12.0 X-Bugzilla-Keywords: c++-lambda, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 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=3D108242 --- Comment #7 from Jakub Jelinek --- Sorry, above doesn't compile, but template void my_fun() { auto fun =3D [&](auto res) { static constexpr char const* fun_name =3D __PRETTY_FUNCTION__; struct { constexpr const char* operator()() const { constexpr char const* fun_name2 =3D __PRETTY_FUNCTION__; return fun_name; }; } t; t(); }; fun(12); } int main() { my_fun(); } ICEs and compiles fine with G++ 11.x.=