blob: 48fa8683af41523b39186e7eb191128cabc4f122 [file] [log] [blame]
Argyrios Kyrtzidis7d100872011-09-04 03:32:15 +00001class MyCls {
2 void in_foo() {
3 vec.x = 0;
4 }
5 void out_foo();
6
7 struct Vec { int x, y; };
8 Vec vec;
9};
10
11void MyCls::out_foo() {
12 vec.x = 0;
13}
14
Douglas Gregor3dd0f762011-11-02 23:39:56 +000015class OtherClass : public MyCls {
16public:
17 OtherClass(const OtherClass &other) : MyCls(other), value(value) { }
18
19private:
20 int value;
21 MyCls *object;
22};
23
Argyrios Kyrtzidis7d100872011-09-04 03:32:15 +000024// RUN: c-index-test -code-completion-at=%s:3:9 %s | FileCheck %s
25// RUN: c-index-test -code-completion-at=%s:12:7 %s | FileCheck %s
26// CHECK: CXXMethod:{ResultType MyCls::Vec &}{TypedText operator=}{LeftParen (}{Placeholder const MyCls::Vec &}{RightParen )} (34)
27// CHECK-NEXT: StructDecl:{TypedText Vec}{Text ::} (75)
28// CHECK-NEXT: FieldDecl:{ResultType int}{TypedText x} (35)
29// CHECK-NEXT: FieldDecl:{ResultType int}{TypedText y} (35)
30// CHECK-NEXT: CXXDestructor:{ResultType void}{TypedText ~Vec}{LeftParen (}{RightParen )} (34)
31// CHECK-NEXT: Completion contexts:
32// CHECK-NEXT: Dot member access
33// CHECK-NEXT: Container Kind: StructDecl
Douglas Gregor3dd0f762011-11-02 23:39:56 +000034
35// RUN: c-index-test -code-completion-at=%s:17:41 %s | FileCheck -check-prefix=CHECK-CTOR-INIT %s
36// CHECK-CTOR-INIT: NotImplemented:{TypedText MyCls}{LeftParen (}{Placeholder args}{RightParen )} (7)
37// CHECK-CTOR-INIT: MemberRef:{TypedText object}{LeftParen (}{Placeholder args}{RightParen )} (35)
38// CHECK-CTOR-INIT: MemberRef:{TypedText value}{LeftParen (}{Placeholder args}{RightParen )} (35)
39// RUN: c-index-test -code-completion-at=%s:17:55 %s | FileCheck -check-prefix=CHECK-CTOR-INIT-2 %s
40// CHECK-CTOR-INIT-2-NOT: NotImplemented:{TypedText MyCls}{LeftParen (}{Placeholder args}{RightParen )}
41// CHECK-CTOR-INIT-2: MemberRef:{TypedText object}{LeftParen (}{Placeholder args}{RightParen )} (35)
42// CHECK-CTOR-INIT-2: MemberRef:{TypedText value}{LeftParen (}{Placeholder args}{RightParen )} (7)