Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / AST / ast-dump-special-member-functions.cpp
blobb98c90f6760434bd1e656219e8529d3b7ad0b336
1 // Test without serialization:
2 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++17 -ast-dump %s \
3 // RUN: | FileCheck -strict-whitespace %s
4 //
5 // Test with serialization:
6 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++17 -emit-pch -o %t %s
7 // RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -std=c++17 -include-pch %t -ast-dump-all /dev/null \
8 // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
9 // RUN: | FileCheck -strict-whitespace %s
11 // FIXME: exists
13 struct TrivialDefaultConstructor {
14 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <{{.*}}:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct TrivialDefaultConstructor definition
15 // CHECK: DefaultConstructor {{.*}} trivial{{.*}}
16 TrivialDefaultConstructor() = default;
19 struct NontrivialDefaultConstructor {
20 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialDefaultConstructor definition
21 // CHECK: DefaultConstructor {{.*}}non_trivial{{.*}}
22 NontrivialDefaultConstructor() {}
25 struct UserProvidedDefaultConstructor {
26 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserProvidedDefaultConstructor definition
27 // CHECK: DefaultConstructor {{.*}}user_provided{{.*}}
28 UserProvidedDefaultConstructor() {}
31 struct NonUserProvidedDefaultConstructor {
32 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NonUserProvidedDefaultConstructor definition
33 // CHECK-NOT: DefaultConstructor {{.*}}user_provided{{.*}}
36 struct HasConstexprDefaultConstructor {
37 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct HasConstexprDefaultConstructor definition
38 // CHECK: DefaultConstructor {{.*}}constexpr{{.*}}
39 constexpr HasConstexprDefaultConstructor() {}
42 struct DoesNotHaveConstexprDefaultConstructor {
43 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotHaveConstexprDefaultConstructor definition
44 // CHECK-NOT: DefaultConstructor {{.*}} constexpr{{.*}}
45 DoesNotHaveConstexprDefaultConstructor() {}
48 struct NeedsImplicitDefaultConstructor {
49 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NeedsImplicitDefaultConstructor definition
50 // CHECK: DefaultConstructor {{.*}}needs_implicit{{.*}}
51 int i = 12;
54 struct DoesNotNeedImplicitDefaultConstructor {
55 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitDefaultConstructor definition
56 // CHECK-NOT: DefaultConstructor {{.*}}needs_implicit{{.*}}
57 DoesNotNeedImplicitDefaultConstructor() {}
60 struct DefaultedDefaultConstructorIsConstexpr {
61 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DefaultedDefaultConstructorIsConstexpr definition
62 // CHECK: DefaultConstructor {{.*}}defaulted_is_constexpr{{.*}}
63 DefaultedDefaultConstructorIsConstexpr() = default;
66 struct DefaultedDefaultConstructorIsNotConstexpr {
67 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+6]]:1> line:[[@LINE-1]]:8 struct DefaultedDefaultConstructorIsNotConstexpr definition
68 // CHECK-NOT: DefaultConstructor {{.*}}defaulted_is_constexpr{{.*}}
69 DefaultedDefaultConstructorIsNotConstexpr() = default;
70 union {
71 int i;
75 struct SimpleCopyConstructor {
76 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct SimpleCopyConstructor definition
77 // CHECK: CopyConstructor {{.*}}simple{{.*}}
78 int i = 12;
81 struct NotSimpleCopyConstructor {
82 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NotSimpleCopyConstructor definition
83 // CHECK-NOT: CopyConstructor {{.*}}simple{{.*}}
84 NotSimpleCopyConstructor(const NotSimpleCopyConstructor&) = delete;
87 struct TrivialCopyConstructor {
88 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct TrivialCopyConstructor definition
89 // CHECK: CopyConstructor {{.*}} trivial{{.*}}
90 TrivialCopyConstructor() = default;
93 struct NontrivialCopyConstructor {
94 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialCopyConstructor definition
95 // CHECK: CopyConstructor {{.*}}non_trivial{{.*}}
96 NontrivialCopyConstructor(const NontrivialCopyConstructor&) {}
99 struct UserDeclaredCopyConstructor {
100 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserDeclaredCopyConstructor definition
101 // CHECK: CopyConstructor {{.*}}user_declared{{.*}}
102 UserDeclaredCopyConstructor(const UserDeclaredCopyConstructor&) {}
105 struct NonUserDeclaredCopyConstructor {
106 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NonUserDeclaredCopyConstructor definition
107 // CHECK-NOT: CopyConstructor {{.*}}user_declared{{.*}}
110 struct CopyConstructorHasConstParam {
111 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct CopyConstructorHasConstParam definition
112 // CHECK: CopyConstructor {{.*}}has_const_param{{.*}}
113 CopyConstructorHasConstParam(const CopyConstructorHasConstParam&) {}
116 struct CopyConstructorDoesNotHaveConstParam {
117 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct CopyConstructorDoesNotHaveConstParam definition
118 // CHECK-NOT: CopyConstructor {{.*}} has_const_param{{.*}}
119 CopyConstructorDoesNotHaveConstParam(CopyConstructorDoesNotHaveConstParam&) {}
122 struct NeedsImplicitCopyConstructor {
123 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NeedsImplicitCopyConstructor definition
124 // CHECK: CopyConstructor {{.*}}needs_implicit{{.*}}
125 int i = 12;
128 struct DoesNotNeedImplicitCopyConstructor {
129 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitCopyConstructor definition
130 // CHECK-NOT: CopyConstructor {{.*}}needs_implicit{{.*}}
131 DoesNotNeedImplicitCopyConstructor(const DoesNotNeedImplicitCopyConstructor&) {}
134 struct DeletedDestructor {
135 private:
136 ~DeletedDestructor() = delete;
139 struct CopyConstructorNeedsOverloadResolution : virtual DeletedDestructor {
140 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct CopyConstructorNeedsOverloadResolution definition
141 // CHECK: CopyConstructor {{.*}}needs_overload_resolution{{.*}}
144 struct CopyConstructorDoesNotNeedOverloadResolution {
145 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct CopyConstructorDoesNotNeedOverloadResolution definition
146 // CHECK-NOT: CopyConstructor {{.*}}needs_overload_resolution{{.*}}
149 struct DefaultedCopyConstructorIsDeleted {
150 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+4]]:1> line:[[@LINE-1]]:8 struct DefaultedCopyConstructorIsDeleted definition
151 // CHECK: CopyConstructor {{.*}}defaulted_is_deleted{{.*}}
152 int &&i;
153 DefaultedCopyConstructorIsDeleted(const DefaultedCopyConstructorIsDeleted&) = default;
156 struct DefaultedCopyConstructorIsNotDeleted {
157 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+4]]:1> line:[[@LINE-1]]:8 struct DefaultedCopyConstructorIsNotDeleted definition
158 // CHECK-NOT: CopyConstructor {{.*}}defaulted_is_deleted{{.*}}
159 int i;
160 DefaultedCopyConstructorIsNotDeleted(const DefaultedCopyConstructorIsNotDeleted&) = default;
163 struct BaseWithoutCopyConstructorConstParam {
164 BaseWithoutCopyConstructorConstParam(BaseWithoutCopyConstructorConstParam&);
167 struct ImplicitCopyConstructorHasConstParam {
168 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct ImplicitCopyConstructorHasConstParam definition
169 // CHECK: CopyConstructor {{.*}}implicit_has_const_param{{.*}}
172 struct ImplicitCopyConstructorDoesNotHaveConstParam : BaseWithoutCopyConstructorConstParam {
173 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct ImplicitCopyConstructorDoesNotHaveConstParam definition
174 // CHECK-NOT: CopyConstructor {{.*}}implicit_has_const_param{{.*}}
177 struct MoveConstructorExists {
178 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct MoveConstructorExists definition
179 // CHECK: MoveConstructor {{.*}}exists{{.*}}
182 struct MoveConstructorDoesNotExist {
183 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct MoveConstructorDoesNotExist definition
184 // CHECK-NOT: MoveConstructor {{.*}}exists{{.*}}
185 MoveConstructorDoesNotExist(const MoveConstructorDoesNotExist&);
188 struct SimpleMoveConstructor {
189 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct SimpleMoveConstructor definition
190 // CHECK: MoveConstructor {{.*}}simple{{.*}}
191 int i = 12;
194 struct NotSimpleMoveConstructor {
195 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NotSimpleMoveConstructor definition
196 // CHECK-NOT: MoveConstructor {{.*}}simple{{.*}}
197 NotSimpleMoveConstructor(NotSimpleMoveConstructor&&) = delete;
200 struct TrivialMoveConstructor {
201 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct TrivialMoveConstructor definition
202 // CHECK: MoveConstructor {{.*}} trivial{{.*}}
203 TrivialMoveConstructor() = default;
206 struct NontrivialMoveConstructor {
207 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialMoveConstructor definition
208 // CHECK: MoveConstructor {{.*}}non_trivial{{.*}}
209 NontrivialMoveConstructor(NontrivialMoveConstructor&&) {}
212 struct UserDeclaredMoveConstructor {
213 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserDeclaredMoveConstructor definition
214 // CHECK: MoveConstructor {{.*}}user_declared{{.*}}
215 UserDeclaredMoveConstructor(UserDeclaredMoveConstructor&&) {}
218 struct NonUserDeclaredMoveConstructor {
219 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NonUserDeclaredMoveConstructor definition
220 // CHECK-NOT: MoveConstructor {{.*}}user_declared{{.*}}
223 struct NeedsImplicitMoveConstructor {
224 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NeedsImplicitMoveConstructor definition
225 // CHECK: MoveConstructor {{.*}}needs_implicit{{.*}}
226 int i = 12;
229 struct DoesNotNeedImplicitMoveConstructor {
230 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitMoveConstructor definition
231 // CHECK-NOT: MoveConstructor {{.*}}needs_implicit{{.*}}
232 DoesNotNeedImplicitMoveConstructor(DoesNotNeedImplicitMoveConstructor&&) {}
235 struct MoveConstructorNeedsOverloadResolution : virtual DeletedDestructor {
236 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct MoveConstructorNeedsOverloadResolution definition
237 // CHECK: MoveConstructor {{.*}}needs_overload_resolution{{.*}}
240 struct MoveConstructorDoesNotNeedOverloadResolution {
241 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct MoveConstructorDoesNotNeedOverloadResolution definition
242 // CHECK-NOT: MoveConstructor {{.*}}needs_overload_resolution{{.*}}
245 // FIXME: defaulted_is_deleted
247 struct TrivialCopyAssignment {
248 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct TrivialCopyAssignment definition
249 // CHECK: CopyAssignment {{.*}} trivial{{.*}}
250 TrivialCopyAssignment& operator=(const TrivialCopyAssignment&) = default;
253 struct NontrivialCopyAssignment {
254 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialCopyAssignment definition
255 // CHECK: CopyAssignment {{.*}}non_trivial{{.*}}
256 NontrivialCopyAssignment& operator=(const NontrivialCopyAssignment&) {}
259 struct CopyAssignmentHasConstParam {
260 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct CopyAssignmentHasConstParam definition
261 // CHECK: CopyAssignment {{.*}}has_const_param{{.*}}
262 CopyAssignmentHasConstParam& operator=(const CopyAssignmentHasConstParam&) {}
265 struct CopyAssignmentDoesNotHaveConstParam {
266 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct CopyAssignmentDoesNotHaveConstParam definition
267 // CHECK-NOT: CopyAssignment {{.*}} has_const_param{{.*}}
268 CopyAssignmentDoesNotHaveConstParam& operator=(CopyAssignmentDoesNotHaveConstParam&) {}
271 struct UserDeclaredCopyAssignment {
272 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserDeclaredCopyAssignment definition
273 // CHECK: CopyAssignment {{.*}}user_declared{{.*}}
274 UserDeclaredCopyAssignment& operator=(const UserDeclaredCopyAssignment&) {}
277 struct NonUserDeclaredCopyAssignment {
278 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NonUserDeclaredCopyAssignment definition
279 // CHECK-NOT: CopyAssignment {{.*}}user_declared{{.*}}
282 struct NeedsImplicitCopyAssignment {
283 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NeedsImplicitCopyAssignment definition
284 // CHECK: CopyAssignment {{.*}}needs_implicit{{.*}}
285 int i = 12;
288 struct DoesNotNeedImplicitCopyAssignment {
289 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitCopyAssignment definition
290 // CHECK-NOT: CopyAssignment {{.*}}needs_implicit{{.*}}
291 DoesNotNeedImplicitCopyAssignment& operator=(const DoesNotNeedImplicitCopyAssignment&) {}
294 struct DeclaresCopyAssignment {
295 DeclaresCopyAssignment &operator=(const DeclaresCopyAssignment&) &;
298 struct CopyAssignmentNeedsOverloadResolution {
299 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct CopyAssignmentNeedsOverloadResolution definition
300 // CHECK: CopyAssignment {{.*}}needs_overload_resolution{{.*}}
301 DeclaresCopyAssignment i;
304 struct CopyAssignmentDoesNotNeedOverloadResolution {
305 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct CopyAssignmentDoesNotNeedOverloadResolution definition
306 // CHECK-NOT: CopyAssignment {{.*}}needs_overload_resolution{{.*}}
309 struct BaseWithoutCopyAssignmentConstParam {
310 BaseWithoutCopyAssignmentConstParam& operator=(BaseWithoutCopyAssignmentConstParam&);
313 struct ImplicitCopyAssignmentHasConstParam {
314 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct ImplicitCopyAssignmentHasConstParam definition
315 // CHECK: CopyAssignment {{.*}}implicit_has_const_param{{.*}}
318 struct ImplicitCopyAssignmentDoesNotHaveConstParam : BaseWithoutCopyAssignmentConstParam {
319 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct ImplicitCopyAssignmentDoesNotHaveConstParam definition
320 // CHECK-NOT: CopyAssignment {{.*}}implicit_has_const_param{{.*}}
323 struct MoveAssignmentExists {
324 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct MoveAssignmentExists definition
325 // CHECK: MoveAssignment {{.*}}exists{{.*}}
328 struct MoveAssignmentDoesNotExist {
329 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct MoveAssignmentDoesNotExist definition
330 // CHECK-NOT: MoveAssignment {{.*}}exists{{.*}}
331 MoveAssignmentDoesNotExist& operator=(const MoveAssignmentDoesNotExist&);
334 struct SimpleMoveAssignment {
335 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct SimpleMoveAssignment definition
336 // CHECK: MoveAssignment {{.*}}simple{{.*}}
337 int i = 12;
340 struct NotSimpleMoveAssignment {
341 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NotSimpleMoveAssignment definition
342 // CHECK-NOT: MoveAssignment {{.*}}simple{{.*}}
343 NotSimpleMoveAssignment& operator=(NotSimpleMoveAssignment&&) = delete;
346 struct TrivialMoveAssignment {
347 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct TrivialMoveAssignment definition
348 // CHECK: MoveAssignment {{.*}} trivial{{.*}}
349 TrivialMoveAssignment() = default;
352 struct NontrivialMoveAssignment {
353 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialMoveAssignment definition
354 // CHECK: MoveAssignment {{.*}}non_trivial{{.*}}
355 NontrivialMoveAssignment& operator=(NontrivialMoveAssignment&&) {}
358 struct UserDeclaredMoveAssignment {
359 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserDeclaredMoveAssignment definition
360 // CHECK: MoveAssignment {{.*}}user_declared{{.*}}
361 UserDeclaredMoveAssignment& operator=(UserDeclaredMoveAssignment&&) {}
364 struct NonUserDeclaredMoveAssignment {
365 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NonUserDeclaredMoveAssignment definition
366 // CHECK-NOT: MoveAssignment {{.*}}user_declared{{.*}}
369 struct NeedsImplicitMoveAssignment {
370 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NeedsImplicitMoveAssignment definition
371 // CHECK: MoveAssignment {{.*}}needs_implicit{{.*}}
372 int i = 12;
375 struct DoesNotNeedImplicitMoveAssignment {
376 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitMoveAssignment definition
377 // CHECK-NOT: MoveAssignment {{.*}}needs_implicit{{.*}}
378 DoesNotNeedImplicitMoveAssignment& operator=(DoesNotNeedImplicitMoveAssignment&&) {}
381 struct MoveAssignmentNeedsOverloadResolution : virtual DeletedDestructor {
382 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct MoveAssignmentNeedsOverloadResolution definition
383 // CHECK: MoveAssignment {{.*}}needs_overload_resolution{{.*}}
386 struct MoveAssignmentDoesNotNeedOverloadResolution {
387 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct MoveAssignmentDoesNotNeedOverloadResolution definition
388 // CHECK-NOT: MoveAssignment {{.*}}needs_overload_resolution{{.*}}
391 struct SimpleDestructor {
392 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct SimpleDestructor definition
393 // CHECK: Destructor {{.*}}simple{{.*}}
396 struct NotSimpleDestructor : DeletedDestructor {
397 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NotSimpleDestructor definition
398 // CHECK-NOT: Destructor {{.*}}simple{{.*}}
401 struct IrrelevantDestructor {
402 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct IrrelevantDestructor definition
403 // CHECK: Destructor {{.*}}irrelevant{{.*}}
406 struct RelevantDestructor {
407 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct RelevantDestructor definition
408 // CHECK-NOT: Destructor {{.*}}irrelevant{{.*}}
409 ~RelevantDestructor() {}
412 struct TrivialDestructor {
413 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct TrivialDestructor definition
414 // CHECK: Destructor {{.*}} trivial{{.*}}
415 ~TrivialDestructor() = default;
418 struct NontrivialDestructor {
419 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialDestructor definition
420 // CHECK: Destructor {{.*}}non_trivial{{.*}}
421 ~NontrivialDestructor() {}
424 struct UserDeclaredDestructor {
425 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserDeclaredDestructor definition
426 // CHECK: Destructor {{.*}}user_declared{{.*}}
427 ~UserDeclaredDestructor() {}
430 struct NonUserDeclaredDestructor {
431 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NonUserDeclaredDestructor definition
432 // CHECK-NOT: Destructor {{.*}}user_declared{{.*}}
435 struct NeedsImplicitDestructor {
436 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NeedsImplicitDestructor definition
437 // CHECK: Destructor {{.*}}needs_implicit{{.*}}
438 int i = 12;
441 struct DoesNotNeedImplicitDestructor {
442 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitDestructor definition
443 // CHECK-NOT: Destructor {{.*}}needs_implicit{{.*}}
444 ~DoesNotNeedImplicitDestructor() {}
447 struct DestructorNeedsOverloadResolution : virtual DeletedDestructor {
448 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DestructorNeedsOverloadResolution definition
449 // CHECK: Destructor {{.*}}needs_overload_resolution{{.*}}
450 ~DestructorNeedsOverloadResolution();
453 struct DestructorDoesNotNeedOverloadResolution {
454 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct DestructorDoesNotNeedOverloadResolution definition
455 // CHECK-NOT: Destructor {{.*}}needs_overload_resolution{{.*}}
458 // FIXME: defaulted_is_deleted