1*67e74705SXin Li namespace { 2*67e74705SXin Li class MyCls { in_foo()3*67e74705SXin Li void in_foo() { 4*67e74705SXin Li vec.x = 0; 5*67e74705SXin Li } 6*67e74705SXin Li void out_foo(); 7*67e74705SXin Li 8*67e74705SXin Li struct Vec { int x, y; }; 9*67e74705SXin Li Vec vec; 10*67e74705SXin Li }; 11*67e74705SXin Li out_foo()12*67e74705SXin Livoid MyCls::out_foo() { 13*67e74705SXin Li vec.x = 0; 14*67e74705SXin Li } 15*67e74705SXin Li 16*67e74705SXin Li class OtherClass : public MyCls { 17*67e74705SXin Li public: OtherClass(const OtherClass & other)18*67e74705SXin Li OtherClass(const OtherClass &other) : MyCls(other), value(value) { } 19*67e74705SXin Li 20*67e74705SXin Li private: 21*67e74705SXin Li int value; 22*67e74705SXin Li MyCls *object; 23*67e74705SXin Li }; 24*67e74705SXin Li } 25*67e74705SXin Li 26*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:4:9 -std=c++98 %s | FileCheck %s 27*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:13:7 -std=c++98 %s | FileCheck %s 28*67e74705SXin Li // CHECK: CXXMethod:{ResultType MyCls::Vec &}{TypedText operator=}{LeftParen (}{Placeholder const MyCls::Vec &}{RightParen )} (34) 29*67e74705SXin Li // CHECK-NEXT: StructDecl:{TypedText Vec}{Text ::} (75) 30*67e74705SXin Li // CHECK-NEXT: FieldDecl:{ResultType int}{TypedText x} (35) 31*67e74705SXin Li // CHECK-NEXT: FieldDecl:{ResultType int}{TypedText y} (35) 32*67e74705SXin Li // CHECK-NEXT: CXXDestructor:{ResultType void}{TypedText ~Vec}{LeftParen (}{RightParen )} (34) 33*67e74705SXin Li // CHECK-NEXT: Completion contexts: 34*67e74705SXin Li // CHECK-NEXT: Dot member access 35*67e74705SXin Li // CHECK-NEXT: Container Kind: StructDecl 36*67e74705SXin Li 37*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:18:41 %s | FileCheck -check-prefix=CHECK-CTOR-INIT %s 38*67e74705SXin Li // CHECK-CTOR-INIT: NotImplemented:{TypedText MyCls}{LeftParen (}{Placeholder args}{RightParen )} (7) 39*67e74705SXin Li // CHECK-CTOR-INIT: MemberRef:{TypedText object}{LeftParen (}{Placeholder args}{RightParen )} (35) 40*67e74705SXin Li // CHECK-CTOR-INIT: MemberRef:{TypedText value}{LeftParen (}{Placeholder args}{RightParen )} (35) 41*67e74705SXin Li // RUN: c-index-test -code-completion-at=%s:18:55 %s | FileCheck -check-prefix=CHECK-CTOR-INIT-2 %s 42*67e74705SXin Li // CHECK-CTOR-INIT-2-NOT: NotImplemented:{TypedText MyCls}{LeftParen (}{Placeholder args}{RightParen )} 43*67e74705SXin Li // CHECK-CTOR-INIT-2: MemberRef:{TypedText object}{LeftParen (}{Placeholder args}{RightParen )} (35) 44*67e74705SXin Li // CHECK-CTOR-INIT-2: MemberRef:{TypedText value}{LeftParen (}{Placeholder args}{RightParen )} (7) 45