Douglas Gregor | 6f942b2 | 2010-09-21 16:06:22 +0000 | [diff] [blame^] | 1 | // Line- and column-sensitive test; run lines follow. |
| 2 | |
| 3 | class string { |
| 4 | public: |
| 5 | string(); |
| 6 | string(const char *); |
| 7 | string(const char *, int n); |
| 8 | }; |
| 9 | |
| 10 | template<typename T> |
| 11 | class vector { |
| 12 | public: |
| 13 | vector(const T &, unsigned n); |
| 14 | |
| 15 | template<typename InputIterator> |
| 16 | vector(InputIterator first, InputIterator last); |
| 17 | }; |
| 18 | |
| 19 | void f() { |
| 20 | |
| 21 | } |
| 22 | |
| 23 | // RUN: c-index-test -code-completion-at=%s:20:2 %s | FileCheck -check-prefix=CHECK-CC1 %s |
| 24 | // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:20:2 %s | FileCheck -check-prefix=CHECK-CC1 %s |
| 25 | // CHECK-CC1: ClassDecl:{TypedText string} (50) |
| 26 | // CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{RightParen )} (50) |
| 27 | // CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{Placeholder const char *}{RightParen )} (50) |
| 28 | // CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{Placeholder const char *}{Comma , }{Placeholder int n}{RightParen )} (50) |
| 29 | // CHECK-CC1: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50) |
| 30 | // CHECK-CC1: CXXConstructor:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder T const &}{Comma , }{Placeholder unsigned int n}{RightParen )} (50) |
| 31 | // CHECK-CC1: FunctionTemplate:{ResultType void}{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder InputIterator first}{Comma , }{Placeholder InputIterator last}{RightParen )} (50) |
| 32 | |
| 33 | // RUN: c-index-test -code-completion-at=%s:19:1 %s | FileCheck -check-prefix=CHECK-CC2 %s |
| 34 | // 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 |
| 35 | // CHECK-CC2: ClassDecl:{TypedText string} (50) |
| 36 | // CHECK-CC2-NOT: CXXConstructor |
| 37 | // CHECK-CC2: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50) |