459 lines · cpp
1// Test without serialization:2// RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++17 -ast-dump %s \3// RUN: | FileCheck -strict-whitespace %s4//5// Test with serialization:6// RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++17 -emit-pch -o %t %s7// 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 %s10 11// FIXME: exists12 13struct TrivialDefaultConstructor {14 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <{{.*}}:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct TrivialDefaultConstructor definition15 // CHECK: DefaultConstructor {{.*}} trivial{{.*}}16 TrivialDefaultConstructor() = default;17};18 19struct NontrivialDefaultConstructor {20 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialDefaultConstructor definition21 // CHECK: DefaultConstructor {{.*}}non_trivial{{.*}}22 NontrivialDefaultConstructor() {}23};24 25struct UserProvidedDefaultConstructor {26 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserProvidedDefaultConstructor definition27 // CHECK: DefaultConstructor {{.*}}user_provided{{.*}}28 UserProvidedDefaultConstructor() {}29};30 31struct NonUserProvidedDefaultConstructor {32 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NonUserProvidedDefaultConstructor definition33 // CHECK-NOT: DefaultConstructor {{.*}}user_provided{{.*}}34};35 36struct HasConstexprDefaultConstructor {37 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct HasConstexprDefaultConstructor definition38 // CHECK: DefaultConstructor {{.*}}constexpr{{.*}}39 constexpr HasConstexprDefaultConstructor() {}40};41 42struct DoesNotHaveConstexprDefaultConstructor {43 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotHaveConstexprDefaultConstructor definition44 // CHECK-NOT: DefaultConstructor {{.*}} constexpr{{.*}}45 DoesNotHaveConstexprDefaultConstructor() {}46};47 48struct NeedsImplicitDefaultConstructor {49 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NeedsImplicitDefaultConstructor definition50 // CHECK: DefaultConstructor {{.*}}needs_implicit{{.*}}51 int i = 12;52};53 54struct DoesNotNeedImplicitDefaultConstructor {55 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitDefaultConstructor definition56 // CHECK-NOT: DefaultConstructor {{.*}}needs_implicit{{.*}}57 DoesNotNeedImplicitDefaultConstructor() {}58};59 60struct DefaultedDefaultConstructorIsConstexpr {61 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DefaultedDefaultConstructorIsConstexpr definition62 // CHECK: DefaultConstructor {{.*}}defaulted_is_constexpr{{.*}}63 DefaultedDefaultConstructorIsConstexpr() = default;64};65 66struct DefaultedDefaultConstructorIsNotConstexpr {67 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+6]]:1> line:[[@LINE-1]]:8 struct DefaultedDefaultConstructorIsNotConstexpr definition68 // CHECK-NOT: DefaultConstructor {{.*}}defaulted_is_constexpr{{.*}}69 DefaultedDefaultConstructorIsNotConstexpr() = default;70 union {71 int i;72 };73};74 75struct SimpleCopyConstructor {76 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct SimpleCopyConstructor definition77 // CHECK: CopyConstructor {{.*}}simple{{.*}}78 int i = 12;79};80 81struct NotSimpleCopyConstructor {82 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NotSimpleCopyConstructor definition83 // CHECK-NOT: CopyConstructor {{.*}}simple{{.*}}84 NotSimpleCopyConstructor(const NotSimpleCopyConstructor&) = delete;85};86 87struct TrivialCopyConstructor {88 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct TrivialCopyConstructor definition89 // CHECK: CopyConstructor {{.*}} trivial{{.*}}90 TrivialCopyConstructor() = default;91};92 93struct NontrivialCopyConstructor {94 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialCopyConstructor definition95 // CHECK: CopyConstructor {{.*}}non_trivial{{.*}}96 NontrivialCopyConstructor(const NontrivialCopyConstructor&) {}97};98 99struct UserDeclaredCopyConstructor {100 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserDeclaredCopyConstructor definition101 // CHECK: CopyConstructor {{.*}}user_declared{{.*}}102 UserDeclaredCopyConstructor(const UserDeclaredCopyConstructor&) {}103};104 105struct NonUserDeclaredCopyConstructor {106 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NonUserDeclaredCopyConstructor definition107 // CHECK-NOT: CopyConstructor {{.*}}user_declared{{.*}}108};109 110struct CopyConstructorHasConstParam {111 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct CopyConstructorHasConstParam definition112 // CHECK: CopyConstructor {{.*}}has_const_param{{.*}}113 CopyConstructorHasConstParam(const CopyConstructorHasConstParam&) {}114};115 116struct CopyConstructorDoesNotHaveConstParam {117 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct CopyConstructorDoesNotHaveConstParam definition118 // CHECK-NOT: CopyConstructor {{.*}} has_const_param{{.*}}119 CopyConstructorDoesNotHaveConstParam(CopyConstructorDoesNotHaveConstParam&) {}120};121 122struct NeedsImplicitCopyConstructor {123 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NeedsImplicitCopyConstructor definition124 // CHECK: CopyConstructor {{.*}}needs_implicit{{.*}}125 int i = 12;126};127 128struct DoesNotNeedImplicitCopyConstructor {129 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitCopyConstructor definition130 // CHECK-NOT: CopyConstructor {{.*}}needs_implicit{{.*}}131 DoesNotNeedImplicitCopyConstructor(const DoesNotNeedImplicitCopyConstructor&) {}132};133 134struct DeletedDestructor {135private:136 ~DeletedDestructor() = delete;137};138 139struct CopyConstructorNeedsOverloadResolution : virtual DeletedDestructor {140 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct CopyConstructorNeedsOverloadResolution definition141 // CHECK: CopyConstructor {{.*}}needs_overload_resolution{{.*}}142};143 144struct CopyConstructorDoesNotNeedOverloadResolution {145 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct CopyConstructorDoesNotNeedOverloadResolution definition146 // CHECK-NOT: CopyConstructor {{.*}}needs_overload_resolution{{.*}}147};148 149struct DefaultedCopyConstructorIsDeleted {150 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+4]]:1> line:[[@LINE-1]]:8 struct DefaultedCopyConstructorIsDeleted definition151 // CHECK: CopyConstructor {{.*}}defaulted_is_deleted{{.*}}152 int &&i;153 DefaultedCopyConstructorIsDeleted(const DefaultedCopyConstructorIsDeleted&) = default;154};155 156struct DefaultedCopyConstructorIsNotDeleted {157 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+4]]:1> line:[[@LINE-1]]:8 struct DefaultedCopyConstructorIsNotDeleted definition158 // CHECK-NOT: CopyConstructor {{.*}}defaulted_is_deleted{{.*}}159 int i;160 DefaultedCopyConstructorIsNotDeleted(const DefaultedCopyConstructorIsNotDeleted&) = default;161};162 163struct BaseWithoutCopyConstructorConstParam {164 BaseWithoutCopyConstructorConstParam(BaseWithoutCopyConstructorConstParam&);165};166 167struct ImplicitCopyConstructorHasConstParam {168 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct ImplicitCopyConstructorHasConstParam definition169 // CHECK: CopyConstructor {{.*}}implicit_has_const_param{{.*}}170};171 172struct ImplicitCopyConstructorDoesNotHaveConstParam : BaseWithoutCopyConstructorConstParam {173 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct ImplicitCopyConstructorDoesNotHaveConstParam definition174 // CHECK-NOT: CopyConstructor {{.*}}implicit_has_const_param{{.*}}175};176 177struct MoveConstructorExists {178 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct MoveConstructorExists definition179 // CHECK: MoveConstructor {{.*}}exists{{.*}}180};181 182struct MoveConstructorDoesNotExist {183 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct MoveConstructorDoesNotExist definition184 // CHECK-NOT: MoveConstructor {{.*}}exists{{.*}}185 MoveConstructorDoesNotExist(const MoveConstructorDoesNotExist&);186};187 188struct SimpleMoveConstructor {189 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct SimpleMoveConstructor definition190 // CHECK: MoveConstructor {{.*}}simple{{.*}}191 int i = 12;192};193 194struct NotSimpleMoveConstructor {195 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NotSimpleMoveConstructor definition196 // CHECK-NOT: MoveConstructor {{.*}}simple{{.*}}197 NotSimpleMoveConstructor(NotSimpleMoveConstructor&&) = delete;198};199 200struct TrivialMoveConstructor {201 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct TrivialMoveConstructor definition202 // CHECK: MoveConstructor {{.*}} trivial{{.*}}203 TrivialMoveConstructor() = default;204};205 206struct NontrivialMoveConstructor {207 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialMoveConstructor definition208 // CHECK: MoveConstructor {{.*}}non_trivial{{.*}}209 NontrivialMoveConstructor(NontrivialMoveConstructor&&) {}210};211 212struct UserDeclaredMoveConstructor {213 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserDeclaredMoveConstructor definition214 // CHECK: MoveConstructor {{.*}}user_declared{{.*}}215 UserDeclaredMoveConstructor(UserDeclaredMoveConstructor&&) {}216};217 218struct NonUserDeclaredMoveConstructor {219 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NonUserDeclaredMoveConstructor definition220 // CHECK-NOT: MoveConstructor {{.*}}user_declared{{.*}}221};222 223struct NeedsImplicitMoveConstructor {224 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NeedsImplicitMoveConstructor definition225 // CHECK: MoveConstructor {{.*}}needs_implicit{{.*}}226 int i = 12;227};228 229struct DoesNotNeedImplicitMoveConstructor {230 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitMoveConstructor definition231 // CHECK-NOT: MoveConstructor {{.*}}needs_implicit{{.*}}232 DoesNotNeedImplicitMoveConstructor(DoesNotNeedImplicitMoveConstructor&&) {}233};234 235struct MoveConstructorNeedsOverloadResolution : virtual DeletedDestructor {236 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct MoveConstructorNeedsOverloadResolution definition237 // CHECK: MoveConstructor {{.*}}needs_overload_resolution{{.*}}238};239 240struct MoveConstructorDoesNotNeedOverloadResolution {241 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct MoveConstructorDoesNotNeedOverloadResolution definition242 // CHECK-NOT: MoveConstructor {{.*}}needs_overload_resolution{{.*}}243};244 245// FIXME: defaulted_is_deleted246 247struct TrivialCopyAssignment {248 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct TrivialCopyAssignment definition249 // CHECK: CopyAssignment {{.*}} trivial{{.*}}250 TrivialCopyAssignment& operator=(const TrivialCopyAssignment&) = default;251};252 253struct NontrivialCopyAssignment {254 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialCopyAssignment definition255 // CHECK: CopyAssignment {{.*}}non_trivial{{.*}}256 NontrivialCopyAssignment& operator=(const NontrivialCopyAssignment&) { return *this; }257};258 259struct CopyAssignmentHasConstParam {260 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct CopyAssignmentHasConstParam definition261 // CHECK: CopyAssignment {{.*}}has_const_param{{.*}}262 CopyAssignmentHasConstParam& operator=(const CopyAssignmentHasConstParam&) { return *this; }263};264 265struct CopyAssignmentDoesNotHaveConstParam {266 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct CopyAssignmentDoesNotHaveConstParam definition267 // CHECK-NOT: CopyAssignment {{.*}} has_const_param{{.*}}268 CopyAssignmentDoesNotHaveConstParam& operator=(CopyAssignmentDoesNotHaveConstParam&) { return *this; }269};270 271struct UserDeclaredCopyAssignment {272 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserDeclaredCopyAssignment definition273 // CHECK: CopyAssignment {{.*}}user_declared{{.*}}274 UserDeclaredCopyAssignment& operator=(const UserDeclaredCopyAssignment&) { return *this; }275};276 277struct NonUserDeclaredCopyAssignment {278 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NonUserDeclaredCopyAssignment definition279 // CHECK-NOT: CopyAssignment {{.*}}user_declared{{.*}}280};281 282struct NeedsImplicitCopyAssignment {283 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NeedsImplicitCopyAssignment definition284 // CHECK: CopyAssignment {{.*}}needs_implicit{{.*}}285 int i = 12;286};287 288struct DoesNotNeedImplicitCopyAssignment {289 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitCopyAssignment definition290 // CHECK-NOT: CopyAssignment {{.*}}needs_implicit{{.*}}291 DoesNotNeedImplicitCopyAssignment& operator=(const DoesNotNeedImplicitCopyAssignment&) { return *this; }292};293 294struct DeclaresCopyAssignment {295 DeclaresCopyAssignment &operator=(const DeclaresCopyAssignment&) &;296};297 298struct CopyAssignmentNeedsOverloadResolution {299 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct CopyAssignmentNeedsOverloadResolution definition300 // CHECK: CopyAssignment {{.*}}needs_overload_resolution{{.*}}301 DeclaresCopyAssignment i;302};303 304struct CopyAssignmentDoesNotNeedOverloadResolution {305 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct CopyAssignmentDoesNotNeedOverloadResolution definition306 // CHECK-NOT: CopyAssignment {{.*}}needs_overload_resolution{{.*}}307};308 309struct BaseWithoutCopyAssignmentConstParam {310 BaseWithoutCopyAssignmentConstParam& operator=(BaseWithoutCopyAssignmentConstParam&);311};312 313struct ImplicitCopyAssignmentHasConstParam {314 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct ImplicitCopyAssignmentHasConstParam definition315 // CHECK: CopyAssignment {{.*}}implicit_has_const_param{{.*}}316};317 318struct ImplicitCopyAssignmentDoesNotHaveConstParam : BaseWithoutCopyAssignmentConstParam {319 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct ImplicitCopyAssignmentDoesNotHaveConstParam definition320 // CHECK-NOT: CopyAssignment {{.*}}implicit_has_const_param{{.*}}321};322 323struct MoveAssignmentExists {324 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct MoveAssignmentExists definition325 // CHECK: MoveAssignment {{.*}}exists{{.*}}326};327 328struct MoveAssignmentDoesNotExist {329 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct MoveAssignmentDoesNotExist definition330 // CHECK-NOT: MoveAssignment {{.*}}exists{{.*}}331 MoveAssignmentDoesNotExist& operator=(const MoveAssignmentDoesNotExist&);332};333 334struct SimpleMoveAssignment {335 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct SimpleMoveAssignment definition336 // CHECK: MoveAssignment {{.*}}simple{{.*}}337 int i = 12;338};339 340struct NotSimpleMoveAssignment {341 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NotSimpleMoveAssignment definition342 // CHECK-NOT: MoveAssignment {{.*}}simple{{.*}}343 NotSimpleMoveAssignment& operator=(NotSimpleMoveAssignment&&) = delete;344};345 346struct TrivialMoveAssignment {347 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct TrivialMoveAssignment definition348 // CHECK: MoveAssignment {{.*}} trivial{{.*}}349 TrivialMoveAssignment() = default;350};351 352struct NontrivialMoveAssignment {353 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialMoveAssignment definition354 // CHECK: MoveAssignment {{.*}}non_trivial{{.*}}355 NontrivialMoveAssignment& operator=(NontrivialMoveAssignment&&) { return *this; }356};357 358struct UserDeclaredMoveAssignment {359 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserDeclaredMoveAssignment definition360 // CHECK: MoveAssignment {{.*}}user_declared{{.*}}361 UserDeclaredMoveAssignment& operator=(UserDeclaredMoveAssignment&&) { return *this; }362};363 364struct NonUserDeclaredMoveAssignment {365 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NonUserDeclaredMoveAssignment definition366 // CHECK-NOT: MoveAssignment {{.*}}user_declared{{.*}}367};368 369struct NeedsImplicitMoveAssignment {370 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NeedsImplicitMoveAssignment definition371 // CHECK: MoveAssignment {{.*}}needs_implicit{{.*}}372 int i = 12;373};374 375struct DoesNotNeedImplicitMoveAssignment {376 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitMoveAssignment definition377 // CHECK-NOT: MoveAssignment {{.*}}needs_implicit{{.*}}378 DoesNotNeedImplicitMoveAssignment& operator=(DoesNotNeedImplicitMoveAssignment&&) { return *this; }379};380 381struct MoveAssignmentNeedsOverloadResolution : virtual DeletedDestructor {382 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct MoveAssignmentNeedsOverloadResolution definition383 // CHECK: MoveAssignment {{.*}}needs_overload_resolution{{.*}}384};385 386struct MoveAssignmentDoesNotNeedOverloadResolution {387 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct MoveAssignmentDoesNotNeedOverloadResolution definition388 // CHECK-NOT: MoveAssignment {{.*}}needs_overload_resolution{{.*}}389};390 391struct SimpleDestructor {392 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct SimpleDestructor definition393 // CHECK: Destructor {{.*}}simple{{.*}}394};395 396struct NotSimpleDestructor : DeletedDestructor {397 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NotSimpleDestructor definition398 // CHECK-NOT: Destructor {{.*}}simple{{.*}}399};400 401struct IrrelevantDestructor {402 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct IrrelevantDestructor definition403 // CHECK: Destructor {{.*}}irrelevant{{.*}}404};405 406struct RelevantDestructor {407 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct RelevantDestructor definition408 // CHECK-NOT: Destructor {{.*}}irrelevant{{.*}}409 ~RelevantDestructor() {}410};411 412struct TrivialDestructor {413 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct TrivialDestructor definition414 // CHECK: Destructor {{.*}} trivial{{.*}}415 ~TrivialDestructor() = default;416};417 418struct NontrivialDestructor {419 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialDestructor definition420 // CHECK: Destructor {{.*}}non_trivial{{.*}}421 ~NontrivialDestructor() {}422};423 424struct UserDeclaredDestructor {425 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserDeclaredDestructor definition426 // CHECK: Destructor {{.*}}user_declared{{.*}}427 ~UserDeclaredDestructor() {}428};429 430struct NonUserDeclaredDestructor {431 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct NonUserDeclaredDestructor definition432 // CHECK-NOT: Destructor {{.*}}user_declared{{.*}}433};434 435struct NeedsImplicitDestructor {436 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NeedsImplicitDestructor definition437 // CHECK: Destructor {{.*}}needs_implicit{{.*}}438 int i = 12;439};440 441struct DoesNotNeedImplicitDestructor {442 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitDestructor definition443 // CHECK-NOT: Destructor {{.*}}needs_implicit{{.*}}444 ~DoesNotNeedImplicitDestructor() {}445};446 447struct DestructorNeedsOverloadResolution : virtual DeletedDestructor {448 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DestructorNeedsOverloadResolution definition449 // CHECK: Destructor {{.*}}needs_overload_resolution{{.*}}450 ~DestructorNeedsOverloadResolution();451};452 453struct DestructorDoesNotNeedOverloadResolution {454 // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:8 struct DestructorDoesNotNeedOverloadResolution definition455 // CHECK-NOT: Destructor {{.*}}needs_overload_resolution{{.*}}456};457 458// FIXME: defaulted_is_deleted459