annotate clang/test/Index/complete-functor-call.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // Note: the run lines follow their respective tests, since line/column
anatofuz
parents:
diff changeset
2 // matter in this test.
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 template<class V>
anatofuz
parents:
diff changeset
5 struct S {
anatofuz
parents:
diff changeset
6 void operator()(int) const {}
anatofuz
parents:
diff changeset
7 template<class T> void operator()(T) const {}
anatofuz
parents:
diff changeset
8 template<class T> void operator()(V, T, T) const {}
anatofuz
parents:
diff changeset
9 template<class T> const S<T> *operator()(const S<T> &s) const { return &s; }
anatofuz
parents:
diff changeset
10 };
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 void foo(S<void *> &s) { s(42); }
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 int main() {
anatofuz
parents:
diff changeset
15 S<void *> s;
anatofuz
parents:
diff changeset
16 s(42);
anatofuz
parents:
diff changeset
17 s(s);
anatofuz
parents:
diff changeset
18 s(0, s, s);
anatofuz
parents:
diff changeset
19 (*S<void *>()(S<int>()))(42, 42, 42);
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 s(42,);
anatofuz
parents:
diff changeset
22 s(s,);
anatofuz
parents:
diff changeset
23 s(0, 42, 42,);
anatofuz
parents:
diff changeset
24 }
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 // RUN: c-index-test -code-completion-at=%s:16:5 %s | FileCheck -check-prefix=CHECK-CC1 %s
anatofuz
parents:
diff changeset
27 // CHECK-CC1: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
anatofuz
parents:
diff changeset
28 // CHECK-CC1: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
anatofuz
parents:
diff changeset
29 // CHECK-CC1: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter void *}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
anatofuz
parents:
diff changeset
30 // CHECK-CC1: Completion contexts:
anatofuz
parents:
diff changeset
31 // CHECK-CC1-NEXT: Any type
anatofuz
parents:
diff changeset
32 // CHECK-CC1-NEXT: Any value
anatofuz
parents:
diff changeset
33 // CHECK-CC1-NEXT: Enum tag
anatofuz
parents:
diff changeset
34 // CHECK-CC1-NEXT: Union tag
anatofuz
parents:
diff changeset
35 // CHECK-CC1-NEXT: Struct tag
anatofuz
parents:
diff changeset
36 // CHECK-CC1-NEXT: Class name
anatofuz
parents:
diff changeset
37 // CHECK-CC1-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
38 // CHECK-CC1-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 // RUN: c-index-test -code-completion-at=%s:17:5 %s | FileCheck -check-prefix=CHECK-CC2 %s
anatofuz
parents:
diff changeset
41 // CHECK-CC2: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
anatofuz
parents:
diff changeset
42 // CHECK-CC2: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
anatofuz
parents:
diff changeset
43 // CHECK-CC2: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter void *}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
anatofuz
parents:
diff changeset
44 // CHECK-CC2: Completion contexts:
anatofuz
parents:
diff changeset
45 // CHECK-CC2-NEXT: Any type
anatofuz
parents:
diff changeset
46 // CHECK-CC2-NEXT: Any value
anatofuz
parents:
diff changeset
47 // CHECK-CC2-NEXT: Enum tag
anatofuz
parents:
diff changeset
48 // CHECK-CC2-NEXT: Union tag
anatofuz
parents:
diff changeset
49 // CHECK-CC2-NEXT: Struct tag
anatofuz
parents:
diff changeset
50 // CHECK-CC2-NEXT: Class name
anatofuz
parents:
diff changeset
51 // CHECK-CC2-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
52 // CHECK-CC2-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
53
anatofuz
parents:
diff changeset
54 // RUN: c-index-test -code-completion-at=%s:18:5 %s | FileCheck -check-prefix=CHECK-CC3 %s
anatofuz
parents:
diff changeset
55 // CHECK-CC3: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
anatofuz
parents:
diff changeset
56 // CHECK-CC3: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
anatofuz
parents:
diff changeset
57 // CHECK-CC3: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter void *}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
anatofuz
parents:
diff changeset
58 // CHECK-CC3: Completion contexts:
anatofuz
parents:
diff changeset
59 // CHECK-CC3-NEXT: Any type
anatofuz
parents:
diff changeset
60 // CHECK-CC3-NEXT: Any value
anatofuz
parents:
diff changeset
61 // CHECK-CC3-NEXT: Enum tag
anatofuz
parents:
diff changeset
62 // CHECK-CC3-NEXT: Union tag
anatofuz
parents:
diff changeset
63 // CHECK-CC3-NEXT: Struct tag
anatofuz
parents:
diff changeset
64 // CHECK-CC3-NEXT: Class name
anatofuz
parents:
diff changeset
65 // CHECK-CC3-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
66 // CHECK-CC3-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
67
anatofuz
parents:
diff changeset
68 // RUN: c-index-test -code-completion-at=%s:18:7 %s | FileCheck -check-prefix=CHECK-CC4 %s
anatofuz
parents:
diff changeset
69 // CHECK-CC4: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{Placeholder void *}{Comma , }{CurrentParameter T}{Comma , }{Placeholder T}{RightParen )} (1)
anatofuz
parents:
diff changeset
70 // CHECK-CC4: Completion contexts:
anatofuz
parents:
diff changeset
71 // CHECK-CC4-NEXT: Any type
anatofuz
parents:
diff changeset
72 // CHECK-CC4-NEXT: Any value
anatofuz
parents:
diff changeset
73 // CHECK-CC4-NEXT: Enum tag
anatofuz
parents:
diff changeset
74 // CHECK-CC4-NEXT: Union tag
anatofuz
parents:
diff changeset
75 // CHECK-CC4-NEXT: Struct tag
anatofuz
parents:
diff changeset
76 // CHECK-CC4-NEXT: Class name
anatofuz
parents:
diff changeset
77 // CHECK-CC4-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
78 // CHECK-CC4-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
79
anatofuz
parents:
diff changeset
80 // RUN: c-index-test -code-completion-at=%s:18:10 %s | FileCheck -check-prefix=CHECK-CC5 %s
anatofuz
parents:
diff changeset
81 // CHECK-CC5: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{Placeholder void *}{Comma , }{Placeholder S<void *>}{Comma , }{CurrentParameter S<void *>}{RightParen )} (1)
anatofuz
parents:
diff changeset
82 // CHECK-CC5: Completion contexts:
anatofuz
parents:
diff changeset
83 // CHECK-CC5-NEXT: Any type
anatofuz
parents:
diff changeset
84 // CHECK-CC5-NEXT: Any value
anatofuz
parents:
diff changeset
85 // CHECK-CC5-NEXT: Enum tag
anatofuz
parents:
diff changeset
86 // CHECK-CC5-NEXT: Union tag
anatofuz
parents:
diff changeset
87 // CHECK-CC5-NEXT: Struct tag
anatofuz
parents:
diff changeset
88 // CHECK-CC5-NEXT: Class name
anatofuz
parents:
diff changeset
89 // CHECK-CC5-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
90 // CHECK-CC5-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
91
anatofuz
parents:
diff changeset
92 // RUN: c-index-test -code-completion-at=%s:19:17 %s | FileCheck -check-prefix=CHECK-CC6 %s
anatofuz
parents:
diff changeset
93 // CHECK-CC6: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
anatofuz
parents:
diff changeset
94 // CHECK-CC6: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
anatofuz
parents:
diff changeset
95 // CHECK-CC6: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter void *}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
anatofuz
parents:
diff changeset
96 // CHECK-CC6: OverloadCandidate:{ResultType const S<T> *}{Text operator()}{LeftParen (}{CurrentParameter const S<T> &s}{RightParen )} (1)
anatofuz
parents:
diff changeset
97 // CHECK-CC6: Completion contexts:
anatofuz
parents:
diff changeset
98 // CHECK-CC6-NEXT: Any type
anatofuz
parents:
diff changeset
99 // CHECK-CC6-NEXT: Any value
anatofuz
parents:
diff changeset
100 // CHECK-CC6-NEXT: Enum tag
anatofuz
parents:
diff changeset
101 // CHECK-CC6-NEXT: Union tag
anatofuz
parents:
diff changeset
102 // CHECK-CC6-NEXT: Struct tag
anatofuz
parents:
diff changeset
103 // CHECK-CC6-NEXT: Class name
anatofuz
parents:
diff changeset
104 // CHECK-CC6-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
105 // CHECK-CC6-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
106
anatofuz
parents:
diff changeset
107 // RUN: c-index-test -code-completion-at=%s:19:28 %s | FileCheck -check-prefix=CHECK-CC7 %s
anatofuz
parents:
diff changeset
108 // CHECK-CC7: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
anatofuz
parents:
diff changeset
109 // CHECK-CC7: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
anatofuz
parents:
diff changeset
110 // CHECK-CC7: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
anatofuz
parents:
diff changeset
111 // CHECK-CC7: OverloadCandidate:{ResultType const S<T> *}{Text operator()}{LeftParen (}{CurrentParameter const S<T> &s}{RightParen )} (1)
anatofuz
parents:
diff changeset
112 // CHECK-CC7: Completion contexts:
anatofuz
parents:
diff changeset
113 // CHECK-CC7-NEXT: Any type
anatofuz
parents:
diff changeset
114 // CHECK-CC7-NEXT: Any value
anatofuz
parents:
diff changeset
115 // CHECK-CC7-NEXT: Enum tag
anatofuz
parents:
diff changeset
116 // CHECK-CC7-NEXT: Union tag
anatofuz
parents:
diff changeset
117 // CHECK-CC7-NEXT: Struct tag
anatofuz
parents:
diff changeset
118 // CHECK-CC7-NEXT: Class name
anatofuz
parents:
diff changeset
119 // CHECK-CC7-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
120 // CHECK-CC7-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
121
anatofuz
parents:
diff changeset
122 // RUN: c-index-test -code-completion-at=%s:19:31 %s | FileCheck -check-prefix=CHECK-CC8 %s
anatofuz
parents:
diff changeset
123 // CHECK-CC8: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter T}{Comma , }{Placeholder T}{RightParen )} (1)
anatofuz
parents:
diff changeset
124 // CHECK-CC8: Completion contexts:
anatofuz
parents:
diff changeset
125 // CHECK-CC8-NEXT: Any type
anatofuz
parents:
diff changeset
126 // CHECK-CC8-NEXT: Any value
anatofuz
parents:
diff changeset
127 // CHECK-CC8-NEXT: Enum tag
anatofuz
parents:
diff changeset
128 // CHECK-CC8-NEXT: Union tag
anatofuz
parents:
diff changeset
129 // CHECK-CC8-NEXT: Struct tag
anatofuz
parents:
diff changeset
130 // CHECK-CC8-NEXT: Class name
anatofuz
parents:
diff changeset
131 // CHECK-CC8-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
132 // CHECK-CC8-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
133
anatofuz
parents:
diff changeset
134 // RUN: c-index-test -code-completion-at=%s:19:35 %s | FileCheck -check-prefix=CHECK-CC9 %s
anatofuz
parents:
diff changeset
135 // CHECK-CC9: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
anatofuz
parents:
diff changeset
136 // CHECK-CC9: Completion contexts:
anatofuz
parents:
diff changeset
137 // CHECK-CC9-NEXT: Any type
anatofuz
parents:
diff changeset
138 // CHECK-CC9-NEXT: Any value
anatofuz
parents:
diff changeset
139 // CHECK-CC9-NEXT: Enum tag
anatofuz
parents:
diff changeset
140 // CHECK-CC9-NEXT: Union tag
anatofuz
parents:
diff changeset
141 // CHECK-CC9-NEXT: Struct tag
anatofuz
parents:
diff changeset
142 // CHECK-CC9-NEXT: Class name
anatofuz
parents:
diff changeset
143 // CHECK-CC9-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
144 // CHECK-CC9-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
145
anatofuz
parents:
diff changeset
146 // RUN: c-index-test -code-completion-at=%s:21:8 %s | FileCheck -check-prefix=CHECK-CC10 %s
anatofuz
parents:
diff changeset
147 // CHECK-CC10: Completion contexts:
anatofuz
parents:
diff changeset
148 // CHECK-CC10-NEXT: Any type
anatofuz
parents:
diff changeset
149 // CHECK-CC10-NEXT: Any value
anatofuz
parents:
diff changeset
150 // CHECK-CC10-NEXT: Enum tag
anatofuz
parents:
diff changeset
151 // CHECK-CC10-NEXT: Union tag
anatofuz
parents:
diff changeset
152 // CHECK-CC10-NEXT: Struct tag
anatofuz
parents:
diff changeset
153 // CHECK-CC10-NEXT: Class name
anatofuz
parents:
diff changeset
154 // CHECK-CC10-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
155 // CHECK-CC10-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
156
anatofuz
parents:
diff changeset
157 // RUN: c-index-test -code-completion-at=%s:22:7 %s | FileCheck -check-prefix=CHECK-CC11 %s
anatofuz
parents:
diff changeset
158 // CHECK-CC11: Completion contexts:
anatofuz
parents:
diff changeset
159 // CHECK-CC11-NEXT: Any type
anatofuz
parents:
diff changeset
160 // CHECK-CC11-NEXT: Any value
anatofuz
parents:
diff changeset
161 // CHECK-CC11-NEXT: Enum tag
anatofuz
parents:
diff changeset
162 // CHECK-CC11-NEXT: Union tag
anatofuz
parents:
diff changeset
163 // CHECK-CC11-NEXT: Struct tag
anatofuz
parents:
diff changeset
164 // CHECK-CC11-NEXT: Class name
anatofuz
parents:
diff changeset
165 // CHECK-CC11-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
166 // CHECK-CC11-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
167
anatofuz
parents:
diff changeset
168 // RUN: c-index-test -code-completion-at=%s:23:15 %s | FileCheck -check-prefix=CHECK-CC12 %s
anatofuz
parents:
diff changeset
169 // CHECK-CC12: Completion contexts:
anatofuz
parents:
diff changeset
170 // CHECK-CC12-NEXT: Any type
anatofuz
parents:
diff changeset
171 // CHECK-CC12-NEXT: Any value
anatofuz
parents:
diff changeset
172 // CHECK-CC12-NEXT: Enum tag
anatofuz
parents:
diff changeset
173 // CHECK-CC12-NEXT: Union tag
anatofuz
parents:
diff changeset
174 // CHECK-CC12-NEXT: Struct tag
anatofuz
parents:
diff changeset
175 // CHECK-CC12-NEXT: Class name
anatofuz
parents:
diff changeset
176 // CHECK-CC12-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
177 // CHECK-CC12-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
178
anatofuz
parents:
diff changeset
179 // RUN: c-index-test -code-completion-at=%s:12:28 %s | FileCheck -check-prefix=CHECK-CC13 %s
anatofuz
parents:
diff changeset
180 // CHECK-CC13: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
anatofuz
parents:
diff changeset
181 // CHECK-CC13: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
anatofuz
parents:
diff changeset
182 // CHECK-CC13: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter void *}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
anatofuz
parents:
diff changeset
183 // CHECK-CC13: Completion contexts:
anatofuz
parents:
diff changeset
184 // CHECK-CC13-NEXT: Any type
anatofuz
parents:
diff changeset
185 // CHECK-CC13-NEXT: Any value
anatofuz
parents:
diff changeset
186 // CHECK-CC13-NEXT: Enum tag
anatofuz
parents:
diff changeset
187 // CHECK-CC13-NEXT: Union tag
anatofuz
parents:
diff changeset
188 // CHECK-CC13-NEXT: Struct tag
anatofuz
parents:
diff changeset
189 // CHECK-CC13-NEXT: Class name
anatofuz
parents:
diff changeset
190 // CHECK-CC13-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
191 // CHECK-CC13-NEXT: Objective-C interface