https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121008
Bug ID: 121008
Summary: Error on 'this' inside noexcept specifier of lambda
capturing 'this' inside noexcept specifier
Product: gcc
Version: 16.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: ---
https://godbolt.org/z/PEfMv78fd
```
struct A {
void f() noexcept(noexcept([this]() noexcept(noexcept(this)) {})) {}
};
int main() {}
```
```
<source>:2:63: error: invalid use of 'this' at top level
2 | void f() noexcept(noexcept([this]() noexcept(noexcept(this))
{})) {}
| ^~~~
Compiler returned: 1
```
This works in 15.1