Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const4.C

raw
1 // PR c++/63207
2 // { dg-do run { target c++11 } }
3
4 template <typename T>
5 struct Base {
6 T value;
7 };
8
9 template <typename T>
10 struct Test : Base<T> {
11 T test() {
12 const int x = this->value;
13 return ([&]{ return x; })();
14 }
15 };
16
17 int main() {
18 Test<int> t;
19 t.value = 0;
20 return t.test();
21 }