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