xref: /minix3/external/bsd/llvm/dist/clang/test/Index/complete-lambdas.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // This test is line- and column-sensitive. See below for run lines.
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc int global;
4*f4a2713aSLionel Sambuc 
5*f4a2713aSLionel Sambuc struct X {
6*f4a2713aSLionel Sambuc   static int member;
fX7*f4a2713aSLionel Sambuc   void f(int zed) {
8*f4a2713aSLionel Sambuc     int local;
9*f4a2713aSLionel Sambuc     static int local_static;
10*f4a2713aSLionel Sambuc     [=] {
11*f4a2713aSLionel Sambuc       int inner_local;
12*f4a2713aSLionel Sambuc       [local, this, inner_local] {
13*f4a2713aSLionel Sambuc       }
14*f4a2713aSLionel Sambuc     }();
15*f4a2713aSLionel Sambuc   }
16*f4a2713aSLionel Sambuc };
17*f4a2713aSLionel Sambuc 
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc // RUN: c-index-test -code-completion-at=%s:12:8 -std=c++11 %s | FileCheck -check-prefix=CHECK-CC1 %s
20*f4a2713aSLionel Sambuc // CHECK-CC1: VarDecl:{ResultType int}{TypedText inner_local} (34)
21*f4a2713aSLionel Sambuc // CHECK-CC1-NEXT: VarDecl:{ResultType int}{TypedText local} (34)
22*f4a2713aSLionel Sambuc // CHECK-CC1-NEXT: NotImplemented:{ResultType X *}{TypedText this} (40)
23*f4a2713aSLionel Sambuc // CHECK-CC1-NEXT: ParmDecl:{ResultType int}{TypedText zed} (34)
24*f4a2713aSLionel Sambuc 
25*f4a2713aSLionel Sambuc // RUN: c-index-test -code-completion-at=%s:12:15 -std=c++11 %s | FileCheck -check-prefix=CHECK-CC2 %s
26*f4a2713aSLionel Sambuc // CHECK-CC2: VarDecl:{ResultType int}{TypedText inner_local} (34)
27*f4a2713aSLionel Sambuc // CHECK-CC2-NEXT: NotImplemented:{ResultType X *}{TypedText this} (40)
28*f4a2713aSLionel Sambuc // CHECK-CC2-NEXT: ParmDecl:{ResultType int}{TypedText zed} (34)
29*f4a2713aSLionel Sambuc 
30*f4a2713aSLionel Sambuc // RUN: c-index-test -code-completion-at=%s:12:21 -std=c++11 %s | FileCheck -check-prefix=CHECK-CC3 %s
31*f4a2713aSLionel Sambuc // CHECK-CC3: VarDecl:{ResultType int}{TypedText inner_local} (34)
32*f4a2713aSLionel Sambuc // CHECK-CC3-NEXT: ParmDecl:{ResultType int}{TypedText zed} (34)
33*f4a2713aSLionel Sambuc 
34*f4a2713aSLionel Sambuc // RUN: c-index-test -code-completion-at=%s:12:8 -x objective-c++ -std=c++11 %s | FileCheck -check-prefix=CHECK-CC4 %s
35*f4a2713aSLionel Sambuc // CHECK-CC4: TypedefDecl:{TypedText Class} (50)
36*f4a2713aSLionel Sambuc // CHECK-CC4: TypedefDecl:{TypedText id} (50)
37*f4a2713aSLionel Sambuc // CHECK-CC4: VarDecl:{ResultType int}{TypedText inner_local} (34)
38*f4a2713aSLionel Sambuc // CHECK-CC4: VarDecl:{ResultType int}{TypedText local} (34)
39*f4a2713aSLionel Sambuc // CHECK-CC4: NotImplemented:{ResultType X *}{TypedText this} (40)
40*f4a2713aSLionel Sambuc // CHECK-CC4: ParmDecl:{ResultType int}{TypedText zed} (34)
41*f4a2713aSLionel Sambuc 
42*f4a2713aSLionel Sambuc // RUN: c-index-test -code-completion-at=%s:12:15 -x objective-c++ -std=c++11 %s | FileCheck -check-prefix=CHECK-CC2 %s
43*f4a2713aSLionel Sambuc // RUN: c-index-test -code-completion-at=%s:12:21 -x objective-c++ -std=c++11 %s | FileCheck -check-prefix=CHECK-CC3 %s
44