From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7160E3858D28; Sun, 11 Jun 2023 16:42:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7160E3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686501757; bh=Dpct70LR942611uKWFB4JdKH38zE6YyUv7YLLNIWegk=; h=From:To:Subject:Date:From; b=oXwymS6RsxPEJXcb+v8+hvtlbG95bPNxKKb1C7emTUTUB7+/4vdSr0yC4r8Ph5wk6 4OnRlUTKOgNezy8d0fIf0krD97rxp3Bqd/JM2xYRlq1Ze62o0ApadZXn6qxTZaEsRf HwnSQqH0fdRVslxwP3r2M9wQsjOOXXO+BlbSIroM= From: "johelegp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110211] New: Local lambda treated as non-local Date: Sun, 11 Jun 2023 16:42:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: c++-lambda, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: johelegp at gmail dot com 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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=3D110211 Bug ID: 110211 Summary: Local lambda treated as non-local Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: c++-lambda, rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See . ```C++ template concept invocable =3D requires(F f, T x) { f(x);= }; static_assert(!invocable< decltype([](T) -> decltype([&](U x) requires requires { x.a= (); } {}(T())) {}), int>); ``` ```output :3:52: error: non-local lambda expression cannot have a capture-def= ault 3 | decltype([](T) -> decltype([&](U x) | ^ Compiler returned: 1 ``` According to , this sho= uld work. If the `static_assert` is in a function, it still fails: . It fails on GCC10: .=