1 // Test without serialization:
2 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -fcxx-exceptions -std=gnu++17 -ast-dump %s \
3 // RUN: | FileCheck --strict-whitespace %s
5 // Test with serialization:
6 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -fcxx-exceptions -std=gnu++17 -emit-pch -o %t %s
7 // RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -Wno-unused-value -fcxx-exceptions -std=gnu++17 \
8 // RUN: -include-pch %t -ast-dump-all /dev/null \
9 // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
10 // RUN: | FileCheck --strict-whitespace %s
13 using size_t = decltype(sizeof(0));
18 bool operator==(const type_info
& rhs
) const noexcept
;
19 bool operator!=(const type_info
& rhs
) const noexcept
;
20 type_info(const type_info
& rhs
) = delete; // cannot be copied
21 type_info
& operator=(const type_info
& rhs
) = delete; // cannot be copied
26 bad_typeid() noexcept
;
27 bad_typeid(const bad_typeid
&) noexcept
;
28 virtual ~bad_typeid();
29 bad_typeid
& operator=(const bad_typeid
&) noexcept
;
30 const char* what() const noexcept
;
33 void *operator new(std::size_t, void *ptr
);
36 virtual ~S() = default;
39 template <typename Ty
>
52 // CHECK: CXXThrowExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:9> 'void'
53 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:9> 'int' 12
56 // CHECK: CXXThrowExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3> 'void'
59 void PointerToMember(S obj1
, S
*obj2
, int S::* data
, void (S::*call
)(int)) {
61 // CHECK: BinaryOperator 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:9> 'int' lvalue '.*'
62 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'obj1' 'S':'S'
63 // CHECK-NEXT: ImplicitCastExpr
64 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:9> 'int S::*' lvalue ParmVar 0x{{[^ ]*}} 'data' 'int S::*'
67 // CHECK: BinaryOperator 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:10> 'int' lvalue '->*'
68 // CHECK-NEXT: ImplicitCastExpr
69 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S *' lvalue ParmVar 0x{{[^ ]*}} 'obj2' 'S *'
70 // CHECK-NEXT: ImplicitCastExpr
71 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:10> 'int S::*' lvalue ParmVar 0x{{[^ ]*}} 'data' 'int S::*'
74 // CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:18> 'void'
75 // CHECK-NEXT: ParenExpr 0x{{[^ ]*}} <col:3, col:14> '<bound member function type>'
76 // CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} <col:4, col:10> '<bound member function type>' '.*'
77 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:4> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'obj1' 'S':'S'
78 // CHECK-NEXT: ImplicitCastExpr
79 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:10> 'void (S::*)(int)' lvalue ParmVar 0x{{[^ ]*}} 'call' 'void (S::*)(int)'
80 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:16> 'int' 12
83 // CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:19> 'void'
84 // CHECK-NEXT: ParenExpr 0x{{[^ ]*}} <col:3, col:15> '<bound member function type>'
85 // CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} <col:4, col:11> '<bound member function type>' '->*'
86 // CHECK-NEXT: ImplicitCastExpr
87 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:4> 'S *' lvalue ParmVar 0x{{[^ ]*}} 'obj2' 'S *'
88 // CHECK-NEXT: ImplicitCastExpr
89 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:11> 'void (S::*)(int)' lvalue ParmVar 0x{{[^ ]*}} 'call' 'void (S::*)(int)'
90 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:17> 'int' 12
93 void Casting(const S
*s
) {
95 // CHECK: CXXConstCastExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:20> 'S *' const_cast<S *> <NoOp>
96 // CHECK-NEXT: ImplicitCastExpr 0x{{[^ ]*}} <col:19> 'const S *' <LValueToRValue> part_of_explicit_cast
97 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:19> 'const S *' lvalue ParmVar 0x{{[^ ]*}} 's' 'const S *'
99 static_cast<const T
*>(s
);
100 // CHECK: CXXStaticCastExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:27> 'const T *' static_cast<const T *> <BaseToDerived (S)>
101 // CHECK-NEXT: ImplicitCastExpr 0x{{[^ ]*}} <col:26> 'const S *' <LValueToRValue> part_of_explicit_cast
102 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:26> 'const S *' lvalue ParmVar 0x{{[^ ]*}} 's' 'const S *'
104 dynamic_cast<const T
*>(s
);
105 // CHECK: CXXDynamicCastExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:28> 'const T *' dynamic_cast<const T *> <Dynamic>
106 // CHECK-NEXT: ImplicitCastExpr 0x{{[^ ]*}} <col:27> 'const S *' <LValueToRValue> part_of_explicit_cast
107 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:27> 'const S *' lvalue ParmVar 0x{{[^ ]*}} 's' 'const S *'
109 reinterpret_cast<const int *>(s
);
110 // CHECK: CXXReinterpretCastExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:34> 'const int *' reinterpret_cast<const int *> <BitCast>
111 // CHECK-NEXT: ImplicitCastExpr 0x{{[^ ]*}} <col:33> 'const S *' <LValueToRValue> part_of_explicit_cast
112 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:33> 'const S *' lvalue ParmVar 0x{{[^ ]*}} 's' 'const S *'
115 template <typename
... Ts
>
116 void UnaryExpressions(int *p
) {
118 // CHECK: SizeOfPackExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:15> 'unsigned long' 0x{{[^ ]*}} Ts
121 // CHECK: CXXNoexceptExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:17> 'bool'
122 // CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} <col:12, col:16> 'long' '-'
123 // CHECK-NEXT: ImplicitCastExpr
124 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:12> 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *'
125 // CHECK-NEXT: ImplicitCastExpr
126 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:16> 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *'
129 // CHECK: CXXNewExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:9> 'int *' global Function 0x{{[^ ]*}} 'operator new' 'void *(unsigned long)'
132 // CHECK: CXXNewExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:11> 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(unsigned long)'
135 // CHECK: CXXNewExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:13> 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(unsigned long)'
136 // CHECK-NEXT: InitListExpr 0x{{[^ ]*}} <col:10, col:13> 'int'
137 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:11> 'int' 12
140 // CHECK: CXXNewExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:12> 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(unsigned long)'
141 // CHECK-NEXT: ImplicitCastExpr
142 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:11> 'int' 2
145 // CHECK: CXXNewExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:18> 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(unsigned long)'
146 // CHECK-NEXT: ImplicitCastExpr
147 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:11> 'int' 2
148 // CHECK-NEXT: InitListExpr 0x{{[^ ]*}} <col:13, col:18> 'int[2]'
149 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:14> 'int' 1
150 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:17> 'int' 2
153 // CHECK: CXXNewExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:11> 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(std::size_t, void *)'
154 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'void *' <BitCast>
155 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' <LValueToRValue>
156 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:8> 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *'
159 // CHECK: CXXNewExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:17> 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(std::size_t, void *)'
160 // CHECK-NEXT: InitListExpr 0x{{[^ ]*}} <col:14, col:17> 'int'
161 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:15> 'int' 12
162 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'void *' <BitCast>
163 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' <LValueToRValue>
164 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:8> 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *'
167 // CHECK: CXXDeleteExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:12> 'void' global Function 0x{{[^ ]*}} 'operator delete' 'void (void *) noexcept'
168 // CHECK-NEXT: ImplicitCastExpr
169 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:12> 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *'
172 // CHECK: CXXDeleteExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:13> 'void' array Function 0x{{[^ ]*}} 'operator delete[]' 'void (void *) noexcept'
173 // CHECK-NEXT: ImplicitCastExpr
174 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:13> 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *'
177 void PostfixExpressions(S a
, S
*p
, U
<int> *r
) {
179 // CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:11> 'void'
180 // CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:5> '<bound member function type>' .func 0x{{[^ ]*}}
181 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S':'S'
182 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:10> 'int' 0
185 // CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:12> 'void'
186 // CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:6> '<bound member function type>' ->func 0x{{[^ ]*}}
187 // CHECK-NEXT: ImplicitCastExpr
188 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'S *'
189 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:11> 'int' 0
191 // FIXME: there is no mention that this used the template keyword.
192 p
->template foo
<int>();
193 // CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:24> 'int':'int'
194 // CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:22> '<bound member function type>' ->foo 0x{{[^ ]*}}
195 // CHECK-NEXT: ImplicitCastExpr
196 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'S *'
198 // FIXME: there is no mention that this used the template keyword.
199 a
.template foo
<float>();
200 // CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:25> 'float':'float'
201 // CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:23> '<bound member function type>' .foo 0x{{[^ ]*}}
202 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S':'S'
205 // CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:9> 'void'
206 // CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:7> '<bound member function type>' ->~S 0x{{[^ ]*}}
207 // CHECK-NEXT: ImplicitCastExpr
208 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'S *'
211 // CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:8> 'void'
212 // CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:6> '<bound member function type>' .~S 0x{{[^ ]*}}
213 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S':'S'
215 // FIXME: there seems to be no way to distinguish the construct below from
216 // the construct above.
218 // CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:18> 'void'
219 // CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:5> '<bound member function type>' .~S 0x{{[^ ]*}}
220 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S':'S'
222 // FIXME: similarly, there is no way to distinguish the construct below from
225 // CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:14> 'void'
226 // CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:12> '<bound member function type>' ->~S 0x{{[^ ]*}}
227 // CHECK-NEXT: ImplicitCastExpr
228 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'S *'
230 // FIXME: there is no mention that this used the template keyword.
231 r
->template U
<int>::~U();
232 // CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:26> 'void'
233 // CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:24> '<bound member function type>' ->~U 0x{{[^ ]*}}
234 // CHECK-NEXT: ImplicitCastExpr
235 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'U<int> *' lvalue ParmVar 0x{{[^ ]*}} 'r' 'U<int> *'
238 // CHECK: CXXTypeidExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:11> 'const std::type_info' lvalue
239 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:10> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S':'S'
241 // FIXME: no type information is printed for the argument.
243 // CHECK: CXXTypeidExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:11> 'const std::type_info' lvalue
246 template <typename
... Ts
>
247 void PrimaryExpressions(Ts
... a
) {
251 // CHECK: CXXThisExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:7> 'V *' this
253 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:7, col:14>
254 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:7> col:7 implicit class definition
255 // CHECK-NEXT: DefinitionData lambda
256 // CHECK-NEXT: DefaultConstructor
257 // CHECK-NEXT: CopyConstructor
258 // CHECK-NEXT: MoveConstructor
259 // CHECK-NEXT: CopyAssignment
260 // CHECK-NEXT: MoveAssignment
261 // CHECK-NEXT: Destructor
262 // CHECK-NEXT: CXXMethodDecl
263 // CHECK-NEXT: CompoundStmt
264 // CHECK-NEXT: FieldDecl 0x{{[^ ]*}} <col:8> col:8 implicit 'V *'
265 // CHECK-NEXT: ParenListExpr
266 // CHECK-NEXT: CXXThisExpr 0x{{[^ ]*}} <col:8> 'V *' this
269 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:7, col:15>
270 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:7> col:7 implicit class definition
271 // CHECK-NEXT: DefinitionData lambda
272 // CHECK-NEXT: DefaultConstructor
273 // CHECK-NEXT: CopyConstructor
274 // CHECK-NEXT: MoveConstructor
275 // CHECK-NEXT: CopyAssignment
276 // CHECK-NEXT: MoveAssignment
277 // CHECK-NEXT: Destructor
278 // CHECK-NEXT: CXXMethodDecl
279 // CHECK-NEXT: CompoundStmt
280 // CHECK-NEXT: FieldDecl 0x{{[^ ]*}} <col:8> col:8 implicit 'V'
281 // CHECK-NEXT: ParenListExpr 0x{{[^ ]*}} <col:8> 'NULL TYPE'
282 // CHECK-NEXT: UnaryOperator 0x{{[^ ]*}} <col:8> '<dependent type>' prefix '*' cannot overflow
283 // CHECK-NEXT: CXXThisExpr 0x{{[^ ]*}} <col:8> 'V *' this
290 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:8> '(lambda at {{.*}}:[[@LINE-1]]:3)'
291 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
292 // CHECK-NEXT: DefinitionData lambda
293 // CHECK-NEXT: DefaultConstructor
294 // CHECK-NEXT: CopyConstructor
295 // CHECK-NEXT: MoveConstructor
296 // CHECK-NEXT: CopyAssignment
297 // CHECK-NEXT: MoveAssignment
298 // CHECK-NEXT: Destructor
299 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:6, col:8> col:3 operator() 'auto () const' inline
300 // CHECK-NEXT: CompoundStmt
301 // CHECK-NEXT: CXXConversionDecl 0x{{[^ ]*}} <col:3, col:8> col:3 implicit constexpr operator auto (*)() 'auto (*() const noexcept)()' inline
302 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:3, col:8> col:3 implicit __invoke 'auto ()' static inline
303 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:7, col:8>
306 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:18> '(lambda at {{.*}}:[[@LINE-1]]:3)'
307 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
308 // CHECK-NEXT: DefinitionData lambda
309 // CHECK-NEXT: DefaultConstructor
310 // CHECK-NEXT: CopyConstructor
311 // CHECK-NEXT: MoveConstructor
312 // CHECK-NEXT: CopyAssignment
313 // CHECK-NEXT: MoveAssignment
314 // CHECK-NEXT: Destructor
315 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:16, col:18> col:3 operator() 'auto (int, ...) const' inline
316 // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} <col:6, col:10> col:10 a 'int'
317 // CHECK-NEXT: CompoundStmt
318 // CHECK-NEXT: CXXConversionDecl 0x{{[^ ]*}} <col:3, col:18> col:3 implicit constexpr operator auto (*)(int, ...) 'auto (*() const noexcept)(int, ...)' inline
319 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:3, col:18> col:3 implicit __invoke 'auto (int, ...)' static inline
320 // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} <col:6, col:10> col:10 a 'int'
321 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:17, col:18>
324 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:10> '(lambda at {{.*}}:[[@LINE-1]]:3)'
325 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
326 // CHECK-NEXT: DefinitionData lambda
327 // CHECK-NEXT: DefaultConstructor
328 // CHECK-NEXT: CopyConstructor
329 // CHECK-NEXT: MoveConstructor
330 // CHECK-NEXT: CopyAssignment
331 // CHECK-NEXT: MoveAssignment
332 // CHECK-NEXT: Destructor
333 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:8, col:10> col:3 operator() 'auto () const -> auto' inline
334 // CHECK-NEXT: CompoundStmt
335 // CHECK-NEXT: FieldDecl 0x{{[^ ]*}} <col:4> col:4 implicit 'Ts...'
336 // CHECK-NEXT: ParenListExpr 0x{{[^ ]*}} <col:4> 'NULL TYPE'
337 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:4> 'Ts' lvalue ParmVar 0x{{[^ ]*}} 'a' 'Ts...'
338 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:9, col:10>
341 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:7> '(lambda at {{.*}}:[[@LINE-1]]:3)'
342 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
343 // CHECK-NEXT: DefinitionData lambda
344 // CHECK-NEXT: DefaultConstructor
345 // CHECK-NEXT: CopyConstructor
346 // CHECK-NEXT: MoveConstructor
347 // CHECK-NEXT: CopyAssignment
348 // CHECK-NEXT: MoveAssignment
349 // CHECK-NEXT: Destructor
350 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:5, col:7> col:3 operator() 'auto () const -> auto' inline
351 // CHECK-NEXT: CompoundStmt
352 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:6, col:7>
355 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:19> '(lambda at {{.*}}:[[@LINE-1]]:3)'
356 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
357 // CHECK-NEXT: DefinitionData lambda
358 // CHECK-NEXT: DefaultConstructor
359 // CHECK-NEXT: CopyConstructor
360 // CHECK-NEXT: MoveConstructor
361 // CHECK-NEXT: CopyAssignment
362 // CHECK-NEXT: MoveAssignment
363 // CHECK-NEXT: Destructor
364 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:5, col:19> col:3 operator() 'auto () const -> auto' inline
365 // CHECK-NEXT: CompoundStmt
366 // CHECK-NEXT: ReturnStmt 0x{{[^ ]*}} <col:9, col:16>
367 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:16> 'const int' lvalue Var 0x{{[^ ]*}} 'b' 'int'
368 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:7, col:19>
369 // CHECK-NEXT: ReturnStmt 0x{{[^ ]*}} <col:9, col:16>
370 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:16> 'const int' lvalue Var 0x{{[^ ]*}} 'b' 'int'
373 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:7> '(lambda at {{.*}}:[[@LINE-1]]:3)'
374 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
375 // CHECK-NEXT: DefinitionData lambda
376 // CHECK-NEXT: DefaultConstructor
377 // CHECK-NEXT: CopyConstructor
378 // CHECK-NEXT: MoveConstructor
379 // CHECK-NEXT: CopyAssignment
380 // CHECK-NEXT: MoveAssignment
381 // CHECK-NEXT: Destructor
382 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:5, col:7> col:3 operator() 'auto () const -> auto' inline
383 // CHECK-NEXT: CompoundStmt
384 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:6, col:7>
387 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:19> '(lambda at {{.*}}:[[@LINE-1]]:3)'
388 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
389 // CHECK-NEXT: DefinitionData lambda
390 // CHECK-NEXT: DefaultConstructor
391 // CHECK-NEXT: CopyConstructor
392 // CHECK-NEXT: MoveConstructor
393 // CHECK-NEXT: CopyAssignment
394 // CHECK-NEXT: MoveAssignment
395 // CHECK-NEXT: Destructor
396 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:5, col:19> col:3 operator() 'auto () const -> auto' inline
397 // CHECK-NEXT: CompoundStmt
398 // CHECK-NEXT: ReturnStmt 0x{{[^ ]*}} <col:9, col:16>
399 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:16> 'int' lvalue Var 0x{{[^ ]*}} 'c' 'int'
400 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:7, col:19>
401 // CHECK-NEXT: ReturnStmt 0x{{[^ ]*}} <col:9, col:16>
402 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:16> 'int' lvalue Var 0x{{[^ ]*}} 'c' 'int'
404 [b
, &c
]{ return b
+ c
; };
405 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:26> '(lambda at {{.*}}:[[@LINE-1]]:3)'
406 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
407 // CHECK-NEXT: DefinitionData lambda
408 // CHECK-NEXT: DefaultConstructor
409 // CHECK-NEXT: CopyConstructor
410 // CHECK-NEXT: MoveConstructor
411 // CHECK-NEXT: CopyAssignment
412 // CHECK-NEXT: MoveAssignment
413 // CHECK-NEXT: Destructor
414 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:9, col:26> col:3 operator() 'auto () const -> auto' inline
415 // CHECK-NEXT: CompoundStmt
416 // CHECK-NEXT: ReturnStmt 0x{{[^ ]*}} <col:12, col:23>
417 // CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} <col:19, col:23> 'int' '+'
418 // CHECK-NEXT: ImplicitCastExpr
419 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:19> 'const int' lvalue Var 0x{{[^ ]*}} 'b' 'int'
420 // CHECK-NEXT: ImplicitCastExpr
421 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:23> 'int' lvalue Var 0x{{[^ ]*}} 'c' 'int'
422 // CHECK-NEXT: FieldDecl 0x{{[^ ]*}} <col:4> col:4 implicit 'int'
423 // CHECK-NEXT: FieldDecl 0x{{[^ ]*}} <col:8> col:8 implicit 'int &'
424 // CHECK-NEXT: ImplicitCastExpr
425 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:4> 'int' lvalue Var 0x{{[^ ]*}} 'b' 'int'
426 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:8> 'int' lvalue Var 0x{{[^ ]*}} 'c' 'int'
427 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:10, col:26>
428 // CHECK-NEXT: ReturnStmt 0x{{[^ ]*}} <col:12, col:23>
429 // CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} <col:19, col:23> 'int' '+'
430 // CHECK-NEXT: ImplicitCastExpr
431 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:19> 'const int' lvalue Var 0x{{[^ ]*}} 'b' 'int'
432 // CHECK-NEXT: ImplicitCastExpr
433 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:23> 'int' lvalue Var 0x{{[^ ]*}} 'c' 'int'
436 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:18> '(lambda at {{.*}}:[[@LINE-1]]:3)'
437 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
438 // CHECK-NEXT: DefinitionData lambda
439 // CHECK-NEXT: DefaultConstructor
440 // CHECK-NEXT: CopyConstructor
441 // CHECK-NEXT: MoveConstructor
442 // CHECK-NEXT: CopyAssignment
443 // CHECK-NEXT: MoveAssignment
444 // CHECK-NEXT: Destructor
445 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:16, col:18> col:3 operator() 'auto () const -> auto' inline
446 // CHECK-NEXT: CompoundStmt
447 // CHECK-NEXT: FieldDecl 0x{{[^ ]*}} <col:4> col:4 implicit 'Ts...'
448 // CHECK-NEXT: FieldDecl 0x{{[^ ]*}} <col:10> col:10 implicit 'int':'int'
449 // CHECK-NEXT: ParenListExpr 0x{{[^ ]*}} <col:4> 'NULL TYPE'
450 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:4> 'Ts' lvalue ParmVar 0x{{[^ ]*}} 'a' 'Ts...'
451 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:14> 'int' 12
452 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:17, col:18>
455 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:19> '(lambda at {{.*}}:[[@LINE-1]]:3)'
456 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
457 // CHECK-NEXT: DefinitionData lambda
458 // CHECK-NEXT: DefaultConstructor
459 // CHECK-NEXT: CopyConstructor
460 // CHECK-NEXT: MoveConstructor
461 // CHECK-NEXT: CopyAssignment
462 // CHECK-NEXT: MoveAssignment
463 // CHECK-NEXT: Destructor
464 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:8, col:19> col:3 constexpr operator() 'auto () const' inline
465 // CHECK-NEXT: CompoundStmt
466 // CHECK-NEXT: CXXConversionDecl 0x{{[^ ]*}} <col:3, col:19> col:3 implicit constexpr operator auto (*)() 'auto (*() const noexcept)()' inline
467 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:3, col:19> col:3 implicit __invoke 'auto ()' static inline
468 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:18, col:19>
471 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:17> '(lambda at {{.*}}:[[@LINE-1]]:3)'
472 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
473 // CHECK-NEXT: DefinitionData lambda
474 // CHECK-NEXT: DefaultConstructor
475 // CHECK-NEXT: CopyConstructor
476 // CHECK-NEXT: MoveConstructor
477 // CHECK-NEXT: CopyAssignment
478 // CHECK-NEXT: MoveAssignment
479 // CHECK-NEXT: Destructor
480 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:8, col:17> col:3 operator() 'auto ()' inline
481 // CHECK-NEXT: CompoundStmt
482 // CHECK-NEXT: CXXConversionDecl 0x{{[^ ]*}} <col:3, col:17> col:3 implicit constexpr operator auto (*)() 'auto (*() const noexcept)()' inline
483 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:3, col:17> col:3 implicit __invoke 'auto ()' static inline
484 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:16, col:17>
487 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:18> '(lambda at {{.*}}:[[@LINE-1]]:3)'
488 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
489 // CHECK-NEXT: DefinitionData lambda
490 // CHECK-NEXT: DefaultConstructor
491 // CHECK-NEXT: CopyConstructor
492 // CHECK-NEXT: MoveConstructor
493 // CHECK-NEXT: CopyAssignment
494 // CHECK-NEXT: MoveAssignment
495 // CHECK-NEXT: Destructor
496 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:8, col:18> col:3 operator() 'auto () const noexcept' inline
497 // CHECK-NEXT: CompoundStmt
498 // CHECK-NEXT: CXXConversionDecl 0x{{[^ ]*}} <col:3, col:18> col:3 implicit constexpr operator auto (*)() noexcept 'auto (*() const noexcept)() noexcept' inline
499 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:3, col:18> col:3 implicit __invoke 'auto () noexcept' static inline
500 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:17, col:18>
502 []() -> int { return 0; };
503 // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:27> '(lambda at {{.*}}:[[@LINE-1]]:3)'
504 // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
505 // CHECK-NEXT: DefinitionData lambda
506 // CHECK-NEXT: DefaultConstructor
507 // CHECK-NEXT: CopyConstructor
508 // CHECK-NEXT: MoveConstructor
509 // CHECK-NEXT: CopyAssignment
510 // CHECK-NEXT: MoveAssignment
511 // CHECK-NEXT: Destructor
512 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:11, col:27> col:3 operator() 'auto () const -> int' inline
513 // CHECK-NEXT: CompoundStmt
514 // CHECK-NEXT: ReturnStmt 0x{{[^ ]*}} <col:17, col:24>
515 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:24> 'int' 0
516 // CHECK-NEXT: CXXConversionDecl 0x{{[^ ]*}} <col:3, col:27> col:3 implicit constexpr operator int (*)() 'auto (*() const noexcept)() -> int' inline
517 // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:3, col:27> col:3 implicit __invoke 'auto () -> int' static inline
518 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:15, col:27>
519 // CHECK-NEXT: ReturnStmt 0x{{[^ ]*}} <col:17, col:24>
520 // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:24> 'int' 0
523 // CHECK: CXXFoldExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:11> '<dependent type>'
524 // CHECK-NEXT: <<<NULL>>>
525 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:4> 'Ts' lvalue ParmVar 0x{{[^ ]*}} 'a' 'Ts...'
526 // CHECK-NEXT: <<<NULL>>>
529 // CHECK: CXXFoldExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:11> '<dependent type>'
530 // CHECK-NEXT: <<<NULL>>>
531 // CHECK-NEXT: <<<NULL>>>
532 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:10> 'Ts' lvalue ParmVar 0x{{[^ ]*}} 'a' 'Ts...'
535 // CHECK: CXXFoldExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:15> '<dependent type>'
536 // CHECK-NEXT: <<<NULL>>>
537 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:4> 'Ts' lvalue ParmVar 0x{{[^ ]*}} 'a' 'Ts...'
538 // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:14> 'int' lvalue Var 0x{{[^ ]*}} 'b' 'int'
548 // CHECK-LABEL: FunctionDecl 0x{{[^ ]*}} {{.*}}ADLCall 'void ()'
551 // CHECK: CallExpr 0x{{[^ ]*}} <line:[[@LINE+1]]:{{[^>]+}}> 'void' adl{{$}}
553 // CHECK: CallExpr 0x{{[^ ]*}} <line:[[@LINE+1]]:{{[^>]+}}> 'void' adl{{$}}
557 // CHECK-LABEL: FunctionDecl 0x{{[^ ]*}} {{.*}}NonADLCall 'void ()'
560 // CHECK: CallExpr 0x{{[^ ]*}} <line:[[@LINE+1]]:{{[^>]+}}> 'void'{{$}}
564 // CHECK-LABEL: FunctionDecl 0x{{[^ ]*}} {{.*}}NonADLCall2 'void ()'
568 // CHECK: CallExpr 0x{{[^ ]*}} <line:[[@LINE+1]]:{{[^>]+}}> 'void'{{$}}
570 // CHECK: CallExpr 0x{{[^ ]*}} <line:[[@LINE+1]]:{{[^>]+}}> 'void' adl{{$}}
574 namespace test_adl_call_three
{
576 // CHECK-LABEL: FunctionDecl 0x{{[^ ]*}} {{.*}}NonADLCall3 'void ()'
579 // CHECK: CallExpr 0x{{[^ ]*}} <line:[[@LINE+1]]:{{[^>]+}}> 'void'{{$}}
582 } // namespace test_adl_call_three