gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this2.C
raw| 1 | // PR c++/43856 |
| 2 | // Test for implicit 'this' capture via rewriting. |
| 3 | // { dg-do compile { target c++11 } } |
| 4 | |
| 5 | struct S1 { |
| 6 | int operator()(int); |
| 7 | int i; |
| 8 | void g(); |
| 9 | void f() { |
| 10 | [=]() { // { dg-warning "implicit capture" "" { target c++2a } } |
| 11 | i; |
| 12 | g(); |
| 13 | S1::g(); |
| 14 | operator()(42); |
| 15 | }; |
| 16 | } |
| 17 | }; |