https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117061
Bug ID: 117061 Summary: Error on use of parameter in lambda outside function body Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eczbek.void at gmail dot com Target Milestone: --- This code causes an error: https://godbolt.org/z/3EdfzMqr9 ``` void foo(int x) noexcept(noexcept([&x] { x; })) {} int main() { foo(3); } ``` <source>: In lambda function: <source>:1:43: error: use of parameter outside function body before ';' token 1 | void foo(int x) noexcept(noexcept([&x] { x; })) {} | ^ Compiler returned: 1