summaryrefslogtreecommitdiff
path: root/kythe/cxx/indexer/cxx/testdata/function/function_lambda_implicit_this.cc
blob: 9e14514a57a2e55ba522c7e59dfec04032b1c77c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// We index lambdas which implicitly capture this via either `=` or `&`.

//- @S defines/binding StructS
struct S {
  void f() const {
    [&] {
      //- @g ref MethodG
      //- @m ref FieldM
      //- !{ @g ref StructS }
      g() + m;
    };
    [=] {
      //- @g ref MethodG
      //- @m ref FieldM
      //- !{ @g ref StructS }
      g() + m;
    };
  }

  //- @g defines/binding MethodG
  int g() const;

  //- @m defines/binding FieldM
  int m;
};