When printing a qualified type, look through a substituted template
[clang.git] / test / Index / complete-exprs.cpp
bloba8100653b2aaa3e43021799e0c21c5afe45e2fbd
1 // Line- and column-sensitive test; run lines follow.
3 class string {
4 public:
5 string();
6 string(const char *);
7 string(const char *, int n);
8 };
10 template<typename T>
11 class vector {
12 public:
13 vector(const T &, unsigned n);
14 template<typename InputIterator>
15 vector(InputIterator first, InputIterator last);
16 void push_back(const T&);
18 template<typename T> void vector<T>::push_back(const T&) { }
19 void f() {
23 int foo();
25 void g() {
26 vector<int>(foo(), foo());
29 // RUN: c-index-test -code-completion-at=%s:20:2 %s | FileCheck -check-prefix=CHECK-CC1 %s
30 // 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
31 // CHECK-CC1: NotImplemented:{TypedText operator} (40)
32 // CHECK-CC1-NOT: push_back
33 // CHECK-CC1: ClassDecl:{TypedText string} (50)
34 // CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{RightParen )} (50)
35 // CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{Placeholder const char *}{RightParen )} (50)
36 // CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{Placeholder const char *}{Comma , }{Placeholder int n}{RightParen )} (50)
37 // CHECK-CC1: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)
38 // CHECK-CC1: CXXConstructor:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder const T &}{Comma , }{Placeholder unsigned int n}{RightParen )} (50)
39 // CHECK-CC1: FunctionTemplate:{ResultType void}{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder InputIterator first}{Comma , }{Placeholder InputIterator last}{RightParen )} (50)
41 // RUN: c-index-test -code-completion-at=%s:19:1 %s | FileCheck -check-prefix=CHECK-CC2 %s
42 // 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
43 // CHECK-CC2: ClassDecl:{TypedText string} (50)
44 // CHECK-CC2-NOT: CXXConstructor
45 // CHECK-CC2: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)
47 // RUN: c-index-test -code-completion-at=%s:26:15 %s | FileCheck -check-prefix=CHECK-CC3 %s
48 // CHECK-CC3: NotImplemented:{TypedText float} (50)
49 // CHECK-CC3: FunctionDecl:{ResultType int}{TypedText foo}{LeftParen (}{RightParen )} (50)
50 // CHECK-CC3: FunctionDecl:{ResultType void}{TypedText g}{LeftParen (}{RightParen )} (50)
51 // CHECK-CC3: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)
52 // CHECK-CC3: CXXConstructor:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder const T &}{Comma , }{Placeholder unsigned int n}{RightParen )} (50)
53 // CHECK-CC3: FunctionTemplate:{ResultType void}{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder InputIterator first}{Comma , }{Placeholder InputIterator last}{RightParen )} (50)