gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this11.C
raw| 1 | // PR c++/51494, c++/56222 |
| 2 | // Uses of static members and creating pointers to members aren't odr-uses |
| 3 | // of 'this'. |
| 4 | // { dg-do compile { target c++11 } } |
| 5 | |
| 6 | struct A |
| 7 | { |
| 8 | static void f() {} |
| 9 | static int i; |
| 10 | int j; |
| 11 | void f(int); |
| 12 | |
| 13 | void foo() |
| 14 | { |
| 15 | [] () { |
| 16 | ++i; |
| 17 | f(); |
| 18 | &A::j; |
| 19 | (void(*)())&A::f; |
| 20 | }; |
| 21 | } |
| 22 | }; |