1 // Test without serialization:
2 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -std=gnu++17 \
3 // RUN: 					 -ast-dump %s -ast-dump-filter test \
4 // RUN: | FileCheck -strict-whitespace --match-full-lines %s
5 
6 // Test with serialization:
7 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -std=gnu++17 \
8 // RUN:            -emit-pch -o %t %s
9 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -std=gnu++17 \
10 // RUN:            -x c++ -include-pch %t -ast-dump-all -ast-dump-filter test /dev/null \
11 // RUN: | FileCheck -strict-whitespace --match-full-lines %s
12 
13 
14 
test(Ts...a)15 template <typename... Ts> void test(Ts... a) {
16   struct V {
17     void f() {
18       [this] {};
19       [*this] {};
20     }
21   };
22   int b, c;
23   []() {};
24   [](int a, ...) {};
25   [a...] {};
26   [=] {};
27   [=] { return b; };
28   [&] {};
29   [&] { return c; };
30   [b, &c] { return b + c; };
31   [a..., x = 12] {};
32   []() constexpr {};
33   []() mutable {};
34   []() noexcept {};
35   []() -> int { return 0; };
36 }
37 // CHECK:Dumping test:
38 // CHECK-NEXT:FunctionTemplateDecl {{.*}} <{{.*}}ast-dump-lambda.cpp:15:1, line:36:1> line:15:32{{( imported)?}} test
39 // CHECK-NEXT:|-TemplateTypeParmDecl {{.*}} <col:11, col:23> col:23{{( imported)?}} referenced typename depth 0 index 0 ... Ts
40 // CHECK-NEXT:`-FunctionDecl {{.*}} <col:27, line:36:1> line:15:32{{( imported)?}} test 'void (Ts...)'
41 // CHECK-NEXT:  |-ParmVarDecl {{.*}} <col:37, col:43> col:43{{( imported)?}} referenced a 'Ts...' pack
42 // CHECK-NEXT:  `-CompoundStmt {{.*}} <col:46, line:36:1>
43 // CHECK-NEXT:    |-DeclStmt {{.*}} <line:16:3, line:21:4>
44 // CHECK-NEXT:    | `-CXXRecordDecl {{.*}} <line:16:3, line:21:3> line:16:10{{( imported)?}}{{( <undeserialized declarations>)?}} struct V definition
45 // CHECK-NEXT:    |   |-DefinitionData empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_move_ctor can_const_default_init
46 // CHECK-NEXT:    |   | |-DefaultConstructor exists trivial constexpr needs_implicit defaulted_is_constexpr
47 // CHECK-NEXT:    |   | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
48 // CHECK-NEXT:    |   | |-MoveConstructor exists simple trivial needs_implicit
49 // CHECK-NEXT:    |   | |-CopyAssignment simple trivial has_const_param needs_implicit implicit_has_const_param
50 // CHECK-NEXT:    |   | |-MoveAssignment exists simple trivial needs_implicit
51 // CHECK-NEXT:    |   | `-Destructor simple irrelevant trivial needs_implicit
52 // CHECK-NEXT:    |   |-CXXRecordDecl {{.*}} <col:3, col:10> col:10{{( imported)?}} implicit struct V
53 // CHECK-NEXT:    |   `-CXXMethodDecl {{.*}} <line:17:5, line:20:5> line:17:10{{( imported)?}} f 'void ()'
54 // CHECK-NEXT:    |     `-CompoundStmt {{.*}} <col:14, line:20:5>
55 // CHECK-NEXT:    |       |-LambdaExpr {{.*}} <line:18:7, col:15> '(lambda at {{.*}}ast-dump-lambda.cpp:18:7)'
56 // CHECK-NEXT:    |       | |-CXXRecordDecl {{.*}} <col:7> col:7{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
57 // CHECK-NEXT:    |       | | |-DefinitionData lambda standard_layout trivially_copyable can_const_default_init
58 // CHECK-NEXT:    |       | | | |-DefaultConstructor
59 // CHECK-NEXT:    |       | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
60 // CHECK-NEXT:    |       | | | |-MoveConstructor exists simple trivial needs_implicit
61 // CHECK-NEXT:    |       | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
62 // CHECK-NEXT:    |       | | | |-MoveAssignment
63 // CHECK-NEXT:    |       | | | `-Destructor simple irrelevant trivial needs_implicit
64 // CHECK-NEXT:    |       | | |-CXXMethodDecl {{.*}} <col:12, col:15> col:7{{( imported)?}} operator() 'auto () const -> auto' inline
65 // CHECK-NEXT:    |       | | | `-CompoundStmt {{.*}} <col:14, col:15>
66 // CHECK-NEXT:    |       | | `-FieldDecl {{.*}} <col:8> col:8{{( imported)?}} implicit 'V *'
67 // CHECK-NEXT:    |       | |-ParenListExpr {{.*}} <col:8> 'NULL TYPE'
68 // CHECK-NEXT:    |       | | `-CXXThisExpr {{.*}} <col:8> 'V *' this
69 // CHECK-NEXT:    |       | `-CompoundStmt {{.*}} <col:14, col:15>
70 // CHECK-NEXT:    |       `-LambdaExpr {{.*}} <line:19:7, col:16> '(lambda at {{.*}}ast-dump-lambda.cpp:19:7)'
71 // CHECK-NEXT:    |         |-CXXRecordDecl {{.*}} <col:7> col:7{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
72 // CHECK-NEXT:    |         | |-DefinitionData lambda standard_layout trivially_copyable can_const_default_init
73 // CHECK-NEXT:    |         | | |-DefaultConstructor defaulted_is_constexpr
74 // CHECK-NEXT:    |         | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
75 // CHECK-NEXT:    |         | | |-MoveConstructor exists simple trivial needs_implicit
76 // CHECK-NEXT:    |         | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
77 // CHECK-NEXT:    |         | | |-MoveAssignment
78 // CHECK-NEXT:    |         | | `-Destructor simple irrelevant trivial needs_implicit
79 // CHECK-NEXT:    |         | |-CXXMethodDecl {{.*}} <col:13, col:16> col:7{{( imported)?}} operator() 'auto () const -> auto' inline
80 // CHECK-NEXT:    |         | | `-CompoundStmt {{.*}} <col:15, col:16>
81 // CHECK-NEXT:    |         | `-FieldDecl {{.*}} <col:8> col:8{{( imported)?}} implicit 'V'
82 // CHECK-NEXT:    |         |-ParenListExpr {{.*}} <col:8> 'NULL TYPE'
83 // CHECK-NEXT:    |         | `-UnaryOperator {{.*}} <col:8> '<dependent type>' prefix '*' cannot overflow
84 // CHECK-NEXT:    |         |   `-CXXThisExpr {{.*}} <col:8> 'V *' this
85 // CHECK-NEXT:    |         `-CompoundStmt {{.*}} <col:15, col:16>
86 // CHECK-NEXT:    |-DeclStmt {{.*}} <line:22:3, col:11>
87 // CHECK-NEXT:    | |-VarDecl {{.*}} <col:3, col:7> col:7{{( imported)?}} referenced b 'int'
88 // CHECK-NEXT:    | `-VarDecl {{.*}} <col:3, col:10> col:10{{( imported)?}} referenced c 'int'
89 // CHECK-NEXT:    |-LambdaExpr {{.*}} <line:23:3, col:9> '(lambda at {{.*}}ast-dump-lambda.cpp:23:3)'
90 // CHECK-NEXT:    | |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
91 // CHECK-NEXT:    | | |-DefinitionData lambda empty standard_layout trivially_copyable literal can_const_default_init
92 // CHECK-NEXT:    | | | |-DefaultConstructor defaulted_is_constexpr
93 // CHECK-NEXT:    | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
94 // CHECK-NEXT:    | | | |-MoveConstructor exists simple trivial needs_implicit
95 // CHECK-NEXT:    | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
96 // CHECK-NEXT:    | | | |-MoveAssignment
97 // CHECK-NEXT:    | | | `-Destructor simple irrelevant trivial needs_implicit
98 // CHECK-NEXT:    | | |-CXXMethodDecl {{.*}} <col:6, col:9> col:3{{( imported)?}} operator() 'auto () const' inline
99 // CHECK-NEXT:    | | | `-CompoundStmt {{.*}} <col:8, col:9>
100 // CHECK-NEXT:    | | |-CXXConversionDecl {{.*}} <col:3, col:9> col:3{{( imported)?}} implicit constexpr operator auto (*)() 'auto (*() const noexcept)()' inline
101 // CHECK-NEXT:    | | `-CXXMethodDecl {{.*}} <col:3, col:9> col:3{{( imported)?}} implicit __invoke 'auto ()' static inline
102 // CHECK-NEXT:    | `-CompoundStmt {{.*}} <col:8, col:9>
103 // CHECK-NEXT:    |-LambdaExpr {{.*}} <line:24:3, col:19> '(lambda at {{.*}}ast-dump-lambda.cpp:24:3)'
104 // CHECK-NEXT:    | |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
105 // CHECK-NEXT:    | | |-DefinitionData lambda empty standard_layout trivially_copyable literal can_const_default_init
106 // CHECK-NEXT:    | | | |-DefaultConstructor defaulted_is_constexpr
107 // CHECK-NEXT:    | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
108 // CHECK-NEXT:    | | | |-MoveConstructor exists simple trivial needs_implicit
109 // CHECK-NEXT:    | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
110 // CHECK-NEXT:    | | | |-MoveAssignment
111 // CHECK-NEXT:    | | | `-Destructor simple irrelevant trivial needs_implicit
112 // CHECK-NEXT:    | | |-CXXMethodDecl {{.*}} <col:16, col:19> col:3{{( imported)?}} operator() 'auto (int, ...) const' inline
113 // CHECK-NEXT:    | | | |-ParmVarDecl {{.*}} <col:6, col:10> col:10{{( imported)?}} a 'int'
114 // CHECK-NEXT:    | | | `-CompoundStmt {{.*}} <col:18, col:19>
115 // CHECK-NEXT:    | | |-CXXConversionDecl {{.*}} <col:3, col:19> col:3{{( imported)?}} implicit constexpr operator auto (*)(int, ...) 'auto (*() const noexcept)(int, ...)' inline
116 // CHECK-NEXT:    | | `-CXXMethodDecl {{.*}} <col:3, col:19> col:3{{( imported)?}} implicit __invoke 'auto (int, ...)' static inline
117 // CHECK-NEXT:    | |   `-ParmVarDecl {{.*}} <col:6, col:10> col:10{{( imported)?}} a 'int'
118 // CHECK-NEXT:    | `-CompoundStmt {{.*}} <col:18, col:19>
119 // CHECK-NEXT:    |-LambdaExpr {{.*}} <line:25:3, col:11> '(lambda at {{.*}}ast-dump-lambda.cpp:25:3)'
120 // CHECK-NEXT:    | |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
121 // CHECK-NEXT:    | | |-DefinitionData lambda standard_layout trivially_copyable can_const_default_init
122 // CHECK-NEXT:    | | | |-DefaultConstructor
123 // CHECK-NEXT:    | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
124 // CHECK-NEXT:    | | | |-MoveConstructor exists simple trivial needs_implicit
125 // CHECK-NEXT:    | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
126 // CHECK-NEXT:    | | | |-MoveAssignment
127 // CHECK-NEXT:    | | | `-Destructor simple irrelevant trivial needs_implicit
128 // CHECK-NEXT:    | | |-CXXMethodDecl {{.*}} <col:8, col:11> col:3{{( imported)?}} operator() 'auto () const -> auto' inline
129 // CHECK-NEXT:    | | | `-CompoundStmt {{.*}} <col:10, col:11>
130 // CHECK-NEXT:    | | `-FieldDecl {{.*}} <col:4> col:4{{( imported)?}} implicit 'Ts...'
131 // CHECK-NEXT:    | |-ParenListExpr {{.*}} <col:4> 'NULL TYPE'
132 // CHECK-NEXT:    | | `-DeclRefExpr {{.*}} <col:4> 'Ts' lvalue ParmVar {{.*}} 'a' 'Ts...'
133 // CHECK-NEXT:    | `-CompoundStmt {{.*}} <col:10, col:11>
134 // CHECK-NEXT:    |-LambdaExpr {{.*}} <line:26:3, col:8> '(lambda at {{.*}}ast-dump-lambda.cpp:26:3)'
135 // CHECK-NEXT:    | |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
136 // CHECK-NEXT:    | | |-DefinitionData lambda empty standard_layout trivially_copyable literal can_const_default_init
137 // CHECK-NEXT:    | | | |-DefaultConstructor defaulted_is_constexpr
138 // CHECK-NEXT:    | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
139 // CHECK-NEXT:    | | | |-MoveConstructor exists simple trivial needs_implicit
140 // CHECK-NEXT:    | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
141 // CHECK-NEXT:    | | | |-MoveAssignment
142 // CHECK-NEXT:    | | | `-Destructor simple irrelevant trivial needs_implicit
143 // CHECK-NEXT:    | | `-CXXMethodDecl {{.*}} <col:5, col:8> col:3{{( imported)?}} operator() 'auto () const -> auto' inline
144 // CHECK-NEXT:    | |   `-CompoundStmt {{.*}} <col:7, col:8>
145 // CHECK-NEXT:    | `-CompoundStmt {{.*}} <col:7, col:8>
146 // CHECK-NEXT:    |-LambdaExpr {{.*}} <line:27:3, col:19> '(lambda at {{.*}}ast-dump-lambda.cpp:27:3)'
147 // CHECK-NEXT:    | |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
148 // CHECK-NEXT:    | | |-DefinitionData lambda empty standard_layout trivially_copyable literal can_const_default_init
149 // CHECK-NEXT:    | | | |-DefaultConstructor defaulted_is_constexpr
150 // CHECK-NEXT:    | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
151 // CHECK-NEXT:    | | | |-MoveConstructor exists simple trivial needs_implicit
152 // CHECK-NEXT:    | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
153 // CHECK-NEXT:    | | | |-MoveAssignment
154 // CHECK-NEXT:    | | | `-Destructor simple irrelevant trivial needs_implicit
155 // CHECK-NEXT:    | | `-CXXMethodDecl {{.*}} <col:5, col:19> col:3{{( imported)?}} operator() 'auto () const -> auto' inline
156 // CHECK-NEXT:    | |   `-CompoundStmt {{.*}} <col:7, col:19>
157 // CHECK-NEXT:    | |     `-ReturnStmt {{.*}} <col:9, col:16>
158 // CHECK-NEXT:    | |       `-DeclRefExpr {{.*}} <col:16> 'const int' lvalue Var {{.*}} 'b' 'int'
159 // CHECK-NEXT:    | `-CompoundStmt {{.*}} <col:7, col:19>
160 // CHECK-NEXT:    |   `-ReturnStmt {{.*}} <col:9, col:16>
161 // CHECK-NEXT:    |     `-DeclRefExpr {{.*}} <col:16> 'const int' lvalue Var {{.*}} 'b' 'int'
162 // CHECK-NEXT:    |-LambdaExpr {{.*}} <line:28:3, col:8> '(lambda at {{.*}}ast-dump-lambda.cpp:28:3)'
163 // CHECK-NEXT:    | |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
164 // CHECK-NEXT:    | | |-DefinitionData lambda empty standard_layout trivially_copyable literal can_const_default_init
165 // CHECK-NEXT:    | | | |-DefaultConstructor defaulted_is_constexpr
166 // CHECK-NEXT:    | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
167 // CHECK-NEXT:    | | | |-MoveConstructor exists simple trivial needs_implicit
168 // CHECK-NEXT:    | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
169 // CHECK-NEXT:    | | | |-MoveAssignment
170 // CHECK-NEXT:    | | | `-Destructor simple irrelevant trivial needs_implicit
171 // CHECK-NEXT:    | | `-CXXMethodDecl {{.*}} <col:5, col:8> col:3{{( imported)?}} operator() 'auto () const -> auto' inline
172 // CHECK-NEXT:    | |   `-CompoundStmt {{.*}} <col:7, col:8>
173 // CHECK-NEXT:    | `-CompoundStmt {{.*}} <col:7, col:8>
174 // CHECK-NEXT:    |-LambdaExpr {{.*}} <line:29:3, col:19> '(lambda at {{.*}}ast-dump-lambda.cpp:29:3)'
175 // CHECK-NEXT:    | |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
176 // CHECK-NEXT:    | | |-DefinitionData lambda empty standard_layout trivially_copyable literal can_const_default_init
177 // CHECK-NEXT:    | | | |-DefaultConstructor defaulted_is_constexpr
178 // CHECK-NEXT:    | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
179 // CHECK-NEXT:    | | | |-MoveConstructor exists simple trivial needs_implicit
180 // CHECK-NEXT:    | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
181 // CHECK-NEXT:    | | | |-MoveAssignment
182 // CHECK-NEXT:    | | | `-Destructor simple irrelevant trivial needs_implicit
183 // CHECK-NEXT:    | | `-CXXMethodDecl {{.*}} <col:5, col:19> col:3{{( imported)?}} operator() 'auto () const -> auto' inline
184 // CHECK-NEXT:    | |   `-CompoundStmt {{.*}} <col:7, col:19>
185 // CHECK-NEXT:    | |     `-ReturnStmt {{.*}} <col:9, col:16>
186 // CHECK-NEXT:    | |       `-DeclRefExpr {{.*}} <col:16> 'int' lvalue Var {{.*}} 'c' 'int'
187 // CHECK-NEXT:    | `-CompoundStmt {{.*}} <col:7, col:19>
188 // CHECK-NEXT:    |   `-ReturnStmt {{.*}} <col:9, col:16>
189 // CHECK-NEXT:    |     `-DeclRefExpr {{.*}} <col:16> 'int' lvalue Var {{.*}} 'c' 'int'
190 // CHECK-NEXT:    |-LambdaExpr {{.*}} <line:30:3, col:27> '(lambda at {{.*}}ast-dump-lambda.cpp:30:3)'
191 // CHECK-NEXT:    | |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
192 // CHECK-NEXT:    | | |-DefinitionData lambda trivially_copyable literal can_const_default_init
193 // CHECK-NEXT:    | | | |-DefaultConstructor
194 // CHECK-NEXT:    | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
195 // CHECK-NEXT:    | | | |-MoveConstructor exists simple trivial needs_implicit
196 // CHECK-NEXT:    | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
197 // CHECK-NEXT:    | | | |-MoveAssignment
198 // CHECK-NEXT:    | | | `-Destructor simple irrelevant trivial needs_implicit
199 // CHECK-NEXT:    | | |-CXXMethodDecl {{.*}} <col:9, col:27> col:3{{( imported)?}} operator() 'auto () const -> auto' inline
200 // CHECK-NEXT:    | | | `-CompoundStmt {{.*}} <col:11, col:27>
201 // CHECK-NEXT:    | | |   `-ReturnStmt {{.*}} <col:13, col:24>
202 // CHECK-NEXT:    | | |     `-BinaryOperator {{.*}} <col:20, col:24> 'int' '+'
203 // CHECK-NEXT:    | | |       |-ImplicitCastExpr {{.*}} <col:20> 'int' <LValueToRValue>
204 // CHECK-NEXT:    | | |       | `-DeclRefExpr {{.*}} <col:20> 'const int' lvalue Var {{.*}} 'b' 'int'
205 // CHECK-NEXT:    | | |       `-ImplicitCastExpr {{.*}} <col:24> 'int' <LValueToRValue>
206 // CHECK-NEXT:    | | |         `-DeclRefExpr {{.*}} <col:24> 'int' lvalue Var {{.*}} 'c' 'int'
207 // CHECK-NEXT:    | | |-FieldDecl {{.*}} <col:4> col:4{{( imported)?}} implicit 'int'
208 // CHECK-NEXT:    | | `-FieldDecl {{.*}} <col:8> col:8{{( imported)?}} implicit 'int &'
209 // CHECK-NEXT:    | |-ImplicitCastExpr {{.*}} <col:4> 'int' <LValueToRValue>
210 // CHECK-NEXT:    | | `-DeclRefExpr {{.*}} <col:4> 'int' lvalue Var {{.*}} 'b' 'int'
211 // CHECK-NEXT:    | |-DeclRefExpr {{.*}} <col:8> 'int' lvalue Var {{.*}} 'c' 'int'
212 // CHECK-NEXT:    | `-CompoundStmt {{.*}} <col:11, col:27>
213 // CHECK-NEXT:    |   `-ReturnStmt {{.*}} <col:13, col:24>
214 // CHECK-NEXT:    |     `-BinaryOperator {{.*}} <col:20, col:24> 'int' '+'
215 // CHECK-NEXT:    |       |-ImplicitCastExpr {{.*}} <col:20> 'int' <LValueToRValue>
216 // CHECK-NEXT:    |       | `-DeclRefExpr {{.*}} <col:20> 'const int' lvalue Var {{.*}} 'b' 'int'
217 // CHECK-NEXT:    |       `-ImplicitCastExpr {{.*}} <col:24> 'int' <LValueToRValue>
218 // CHECK-NEXT:    |         `-DeclRefExpr {{.*}} <col:24> 'int' lvalue Var {{.*}} 'c' 'int'
219 // CHECK-NEXT:    |-LambdaExpr {{.*}} <line:31:3, col:19> '(lambda at {{.*}}ast-dump-lambda.cpp:31:3)'
220 // CHECK-NEXT:    | |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
221 // CHECK-NEXT:    | | |-DefinitionData lambda standard_layout trivially_copyable can_const_default_init
222 // CHECK-NEXT:    | | | |-DefaultConstructor
223 // CHECK-NEXT:    | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
224 // CHECK-NEXT:    | | | |-MoveConstructor exists simple trivial needs_implicit
225 // CHECK-NEXT:    | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
226 // CHECK-NEXT:    | | | |-MoveAssignment
227 // CHECK-NEXT:    | | | `-Destructor simple irrelevant trivial needs_implicit
228 // CHECK-NEXT:    | | |-CXXMethodDecl {{.*}} <col:16, col:19> col:3{{( imported)?}} operator() 'auto () const -> auto' inline
229 // CHECK-NEXT:    | | | `-CompoundStmt {{.*}} <col:18, col:19>
230 // CHECK-NEXT:    | | |-FieldDecl {{.*}} <col:4> col:4{{( imported)?}} implicit 'Ts...'
231 // CHECK-NEXT:    | | `-FieldDecl {{.*}} <col:10> col:10{{( imported)?}} implicit 'int':'int'
232 // CHECK-NEXT:    | |-ParenListExpr {{.*}} <col:4> 'NULL TYPE'
233 // CHECK-NEXT:    | | `-DeclRefExpr {{.*}} <col:4> 'Ts' lvalue ParmVar {{.*}} 'a' 'Ts...'
234 // CHECK-NEXT:    | |-IntegerLiteral {{.*}} <col:14> 'int' 12
235 // CHECK-NEXT:    | `-CompoundStmt {{.*}} <col:18, col:19>
236 // CHECK-NEXT:    |-LambdaExpr {{.*}} <line:32:3, col:19> '(lambda at {{.*}}ast-dump-lambda.cpp:32:3)'
237 // CHECK-NEXT:    | |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
238 // CHECK-NEXT:    | | |-DefinitionData lambda empty standard_layout trivially_copyable literal can_const_default_init
239 // CHECK-NEXT:    | | | |-DefaultConstructor defaulted_is_constexpr
240 // CHECK-NEXT:    | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
241 // CHECK-NEXT:    | | | |-MoveConstructor exists simple trivial needs_implicit
242 // CHECK-NEXT:    | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
243 // CHECK-NEXT:    | | | |-MoveAssignment
244 // CHECK-NEXT:    | | | `-Destructor simple irrelevant trivial needs_implicit
245 // CHECK-NEXT:    | | |-CXXMethodDecl {{.*}} <col:8, col:19> col:3{{( imported)?}} constexpr operator() 'auto () const' inline
246 // CHECK-NEXT:    | | | `-CompoundStmt {{.*}} <col:18, col:19>
247 // CHECK-NEXT:    | | |-CXXConversionDecl {{.*}} <col:3, col:19> col:3{{( imported)?}} implicit constexpr operator auto (*)() 'auto (*() const noexcept)()' inline
248 // CHECK-NEXT:    | | `-CXXMethodDecl {{.*}} <col:3, col:19> col:3{{( imported)?}} implicit __invoke 'auto ()' static inline
249 // CHECK-NEXT:    | `-CompoundStmt {{.*}} <col:18, col:19>
250 // CHECK-NEXT:    |-LambdaExpr {{.*}} <line:33:3, col:17> '(lambda at {{.*}}ast-dump-lambda.cpp:33:3)'
251 // CHECK-NEXT:    | |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
252 // CHECK-NEXT:    | | |-DefinitionData lambda empty standard_layout trivially_copyable literal can_const_default_init
253 // CHECK-NEXT:    | | | |-DefaultConstructor defaulted_is_constexpr
254 // CHECK-NEXT:    | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
255 // CHECK-NEXT:    | | | |-MoveConstructor exists simple trivial needs_implicit
256 // CHECK-NEXT:    | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
257 // CHECK-NEXT:    | | | |-MoveAssignment
258 // CHECK-NEXT:    | | | `-Destructor simple irrelevant trivial needs_implicit
259 // CHECK-NEXT:    | | |-CXXMethodDecl {{.*}} <col:8, col:17> col:3{{( imported)?}} operator() 'auto ()' inline
260 // CHECK-NEXT:    | | | `-CompoundStmt {{.*}} <col:16, col:17>
261 // CHECK-NEXT:    | | |-CXXConversionDecl {{.*}} <col:3, col:17> col:3{{( imported)?}} implicit constexpr operator auto (*)() 'auto (*() const noexcept)()' inline
262 // CHECK-NEXT:    | | `-CXXMethodDecl {{.*}} <col:3, col:17> col:3{{( imported)?}} implicit __invoke 'auto ()' static inline
263 // CHECK-NEXT:    | `-CompoundStmt {{.*}} <col:16, col:17>
264 // CHECK-NEXT:    |-LambdaExpr {{.*}} <line:34:3, col:18> '(lambda at {{.*}}ast-dump-lambda.cpp:34:3)'
265 // CHECK-NEXT:    | |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
266 // CHECK-NEXT:    | | |-DefinitionData lambda empty standard_layout trivially_copyable literal can_const_default_init
267 // CHECK-NEXT:    | | | |-DefaultConstructor defaulted_is_constexpr
268 // CHECK-NEXT:    | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
269 // CHECK-NEXT:    | | | |-MoveConstructor exists simple trivial needs_implicit
270 // CHECK-NEXT:    | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
271 // CHECK-NEXT:    | | | |-MoveAssignment
272 // CHECK-NEXT:    | | | `-Destructor simple irrelevant trivial needs_implicit
273 // CHECK-NEXT:    | | |-CXXMethodDecl {{.*}} <col:8, col:18> col:3{{( imported)?}} operator() 'auto () const noexcept' inline
274 // CHECK-NEXT:    | | | `-CompoundStmt {{.*}} <col:17, col:18>
275 // CHECK-NEXT:    | | |-CXXConversionDecl {{.*}} <col:3, col:18> col:3{{( imported)?}} implicit constexpr operator auto (*)() noexcept 'auto (*() const noexcept)() noexcept' inline
276 // CHECK-NEXT:    | | `-CXXMethodDecl {{.*}} <col:3, col:18> col:3{{( imported)?}} implicit __invoke 'auto () noexcept' static inline
277 // CHECK-NEXT:    | `-CompoundStmt {{.*}} <col:17, col:18>
278 // CHECK-NEXT:    `-LambdaExpr {{.*}} <line:35:3, col:27> '(lambda at {{.*}}ast-dump-lambda.cpp:35:3)'
279 // CHECK-NEXT:      |-CXXRecordDecl {{.*}} <col:3> col:3{{( imported)?}} implicit{{( <undeserialized declarations>)?}} class definition
280 // CHECK-NEXT:      | |-DefinitionData lambda empty standard_layout trivially_copyable literal can_const_default_init
281 // CHECK-NEXT:      | | |-DefaultConstructor defaulted_is_constexpr
282 // CHECK-NEXT:      | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
283 // CHECK-NEXT:      | | |-MoveConstructor exists simple trivial needs_implicit
284 // CHECK-NEXT:      | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
285 // CHECK-NEXT:      | | |-MoveAssignment
286 // CHECK-NEXT:      | | `-Destructor simple irrelevant trivial needs_implicit
287 // CHECK-NEXT:      | |-CXXMethodDecl {{.*}} <col:11, col:27> col:3{{( imported)?}} operator() 'auto () const -> int' inline
288 // CHECK-NEXT:      | | `-CompoundStmt {{.*}} <col:15, col:27>
289 // CHECK-NEXT:      | |   `-ReturnStmt {{.*}} <col:17, col:24>
290 // CHECK-NEXT:      | |     `-IntegerLiteral {{.*}} <col:24> 'int' 0
291 // CHECK-NEXT:      | |-CXXConversionDecl {{.*}} <col:3, col:27> col:3{{( imported)?}} implicit constexpr operator int (*)() 'auto (*() const noexcept)() -> int' inline
292 // CHECK-NEXT:      | `-CXXMethodDecl {{.*}} <col:3, col:27> col:3{{( imported)?}} implicit __invoke 'auto () -> int' static inline
293 // CHECK-NEXT:      `-CompoundStmt {{.*}} <col:15, col:27>
294 // CHECK-NEXT:        `-ReturnStmt {{.*}} <col:17, col:24>
295 // CHECK-NEXT:          `-IntegerLiteral {{.*}} <col:24> 'int' 0
296