Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/lambda-this4.C

raw
1 // PR c++/94205
2 // { dg-do compile { target c++17 } }
3
4 struct S
5 {
6 int i;
7 int a = [this] { this->i = 5; return 6; } ();
8 };
9
10
11 constexpr S s = {};
12
13 static_assert (s.i == 5 && s.a == 6);