summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this2.C
blob: 56d6b0c8ab99d462734a01f33adb394b27179184 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/43856
// Test for implicit 'this' capture via rewriting.
// { dg-do compile { target c++11 } }

struct S1 {
  int operator()(int);
  int i;
  void g();
  void f() {
    [=]() { // { dg-warning "implicit capture" "" { target c++2a } }
      i;
      g();
      S1::g();
      operator()(42);
    };
  }
};