10212fd71SDouglas Gregor // Line- and column-sensitive test; run lines follow.
20212fd71SDouglas Gregor 
30212fd71SDouglas Gregor class string {
40212fd71SDouglas Gregor  public:
50212fd71SDouglas Gregor   string();
60212fd71SDouglas Gregor   string(const char *);
70212fd71SDouglas Gregor   string(const char *, int n);
80212fd71SDouglas Gregor };
90212fd71SDouglas Gregor 
100212fd71SDouglas Gregor template<typename T>
110212fd71SDouglas Gregor class vector {
120212fd71SDouglas Gregor public:
130212fd71SDouglas Gregor   vector(const T &, unsigned n);
140212fd71SDouglas Gregor   template<typename InputIterator>
150212fd71SDouglas Gregor   vector(InputIterator first, InputIterator last);
162927c0c8SDouglas Gregor   void push_back(const T&);
170212fd71SDouglas Gregor };
push_back(const T &)182927c0c8SDouglas Gregor template<typename T> void vector<T>::push_back(const T&) { }
f()190212fd71SDouglas Gregor void f() {
200212fd71SDouglas Gregor 
210212fd71SDouglas Gregor }
220212fd71SDouglas Gregor 
239c1f1bfeSDouglas Gregor int foo();
249c1f1bfeSDouglas Gregor 
g()259c1f1bfeSDouglas Gregor void g() {
269c1f1bfeSDouglas Gregor   vector<int>(foo(), foo());
279c1f1bfeSDouglas Gregor }
289c1f1bfeSDouglas Gregor 
29dab63c14SDouglas Gregor struct X {
30dab63c14SDouglas Gregor   void f() const;
31dab63c14SDouglas Gregor };
32dab63c14SDouglas Gregor 
f() const33dab63c14SDouglas Gregor void X::f() const {
34dab63c14SDouglas Gregor 
35dab63c14SDouglas Gregor }
36dab63c14SDouglas Gregor 
3778254c88SDouglas Gregor namespace N {
3878254c88SDouglas Gregor   int x;
3978254c88SDouglas Gregor   class C {
4078254c88SDouglas Gregor     int member;
4178254c88SDouglas Gregor 
f(int param)4278254c88SDouglas Gregor     int f(int param) {
4378254c88SDouglas Gregor       return member;
4478254c88SDouglas Gregor     }
4578254c88SDouglas Gregor   };
4678254c88SDouglas Gregor }
4778254c88SDouglas Gregor 
484205feffSDouglas Gregor // RUN: c-index-test -code-completion-at=%s:20:2 %s -std=c++0x | FileCheck -check-prefix=CHECK-CC1 %s
494205feffSDouglas Gregor // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:20:2 -std=c++0x %s | FileCheck -check-prefix=CHECK-CC1 %s
50e5c79d5eSDouglas Gregor // CHECK-CC1: NotImplemented:{ResultType size_t}{TypedText alignof}{LeftParen (}{Placeholder type}{RightParen )} (40)
51e5c79d5eSDouglas Gregor // CHECK-CC1: NotImplemented:{ResultType bool}{TypedText noexcept}{LeftParen (}{Placeholder expression}{RightParen )} (40)
52e5c79d5eSDouglas Gregor // CHECK-CC1: NotImplemented:{ResultType std::nullptr_t}{TypedText nullptr} (40)
532927c0c8SDouglas Gregor // CHECK-CC1: NotImplemented:{TypedText operator} (40)
542927c0c8SDouglas Gregor // CHECK-CC1-NOT: push_back
550212fd71SDouglas Gregor // CHECK-CC1: ClassDecl:{TypedText string} (50)
560212fd71SDouglas Gregor // CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{RightParen )} (50)
570212fd71SDouglas Gregor // CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{Placeholder const char *}{RightParen )} (50)
580212fd71SDouglas Gregor // CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{Placeholder const char *}{Comma , }{Placeholder int n}{RightParen )} (50)
590212fd71SDouglas Gregor // CHECK-CC1: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)
60b0f2ea9eSDouglas Gregor // CHECK-CC1: CXXConstructor:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder const T &}{Comma , }{Placeholder unsigned int n}{RightParen )} (50)
61*63c59720SSam McCall // CHECK-CC1: FunctionTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder InputIterator first}{Comma , }{Placeholder InputIterator last}{RightParen )} (50)
620212fd71SDouglas Gregor 
630212fd71SDouglas Gregor // RUN: c-index-test -code-completion-at=%s:19:1 %s | FileCheck -check-prefix=CHECK-CC2 %s
640212fd71SDouglas Gregor // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:19:1 %s | FileCheck -check-prefix=CHECK-CC2 %s
650212fd71SDouglas Gregor // CHECK-CC2: ClassDecl:{TypedText string} (50)
660212fd71SDouglas Gregor // CHECK-CC2-NOT: CXXConstructor
670212fd71SDouglas Gregor // CHECK-CC2: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)
689c1f1bfeSDouglas Gregor 
699c1f1bfeSDouglas Gregor // RUN: c-index-test -code-completion-at=%s:26:15 %s | FileCheck -check-prefix=CHECK-CC3 %s
709c1f1bfeSDouglas Gregor // CHECK-CC3: NotImplemented:{TypedText float} (50)
719c1f1bfeSDouglas Gregor // CHECK-CC3: FunctionDecl:{ResultType int}{TypedText foo}{LeftParen (}{RightParen )} (50)
729c1f1bfeSDouglas Gregor // CHECK-CC3: FunctionDecl:{ResultType void}{TypedText g}{LeftParen (}{RightParen )} (50)
739c1f1bfeSDouglas Gregor // CHECK-CC3: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)
74b0f2ea9eSDouglas Gregor // CHECK-CC3: CXXConstructor:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder const T &}{Comma , }{Placeholder unsigned int n}{RightParen )} (50)
75*63c59720SSam McCall // CHECK-CC3: FunctionTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder InputIterator first}{Comma , }{Placeholder InputIterator last}{RightParen )} (50)
76e5c79d5eSDouglas Gregor 
77dab63c14SDouglas Gregor // RUN: c-index-test -code-completion-at=%s:34:1 %s -std=c++0x | FileCheck -check-prefix=CHECK-CC4 %s
78dab63c14SDouglas Gregor // CHECK-CC4: NotImplemented:{ResultType const X *}{TypedText this} (40)
7978254c88SDouglas Gregor 
8078254c88SDouglas Gregor // RUN: c-index-test -code-completion-at=%s:43:14 %s | FileCheck -check-prefix=CHECK-CC5 %s
819ae3956fSArgyrios Kyrtzidis // CHECK-CC5: FieldDecl:{ResultType int}{TypedText member} (8)
8278254c88SDouglas Gregor // CHECK-CC5: ParmDecl:{ResultType int}{TypedText param} (8)
839ae3956fSArgyrios Kyrtzidis // CHECK-CC5: StructDecl:{TypedText X} (50)
849ae3956fSArgyrios Kyrtzidis // CHECK-CC5: VarDecl:{ResultType int}{TypedText x} (12)
85