@@ -263,24 +263,21 @@ bool IsUserDefinedCopyConstructor(const clang::CXXConstructorDecl *ctor) {
263263 IsUserDefinedDecl (ctor);
264264}
265265
266- bool IsUserDefinedCopyOrMoveConstructor (const clang::CXXConstructorDecl *ctor) {
267- return ctor->isCopyOrMoveConstructor () && ctor->isUserProvided () &&
266+ bool IsUserDefinedMoveConstructor (const clang::CXXConstructorDecl *ctor) {
267+ return ctor->isMoveConstructor () && ctor->isUserProvided () &&
268268 IsUserDefinedDecl (ctor);
269269}
270270
271+ bool IsUserDefinedCopyOrMoveConstructor (const clang::CXXConstructorDecl *ctor) {
272+ return IsUserDefinedCopyConstructor (ctor) ||
273+ IsUserDefinedMoveConstructor (ctor);
274+ }
275+
271276bool IsDefaultedMoveConstructor (const clang::CXXConstructorDecl *ctor) {
272277 return ctor->isMoveConstructor () && !ctor->isUserProvided () &&
273278 IsUserDefinedDecl (ctor->getParent ());
274279}
275280
276- bool IsCopyOrMoveAssignmentOrCtor (const clang::CXXMethodDecl *method) {
277- if (const auto *ctor = clang::dyn_cast<clang::CXXConstructorDecl>(method)) {
278- return ctor->isCopyOrMoveConstructor ();
279- }
280- return method->isCopyAssignmentOperator () ||
281- method->isMoveAssignmentOperator ();
282- }
283-
284281clang::CXXConstructorDecl *
285282GetUserDefinedCopyConstructor (const clang::RecordDecl *decl) {
286283 auto *cxx = clang::dyn_cast<clang::CXXRecordDecl>(decl);
@@ -308,7 +305,7 @@ bool HasDefaultedCopyConstructor(const clang::RecordDecl *decl) {
308305 return !cxx->defaultedCopyConstructorIsDeleted ();
309306}
310307
311- bool IsCopyConstructible (const clang::RecordDecl *decl) {
308+ bool HasCallableCopyConstructor (const clang::RecordDecl *decl) {
312309 auto *cxx = clang::dyn_cast<clang::CXXRecordDecl>(decl);
313310 if (!cxx) {
314311 return true ;
@@ -341,10 +338,13 @@ bool IsConvertibleCXXRecordDecl(const clang::CXXRecordDecl *decl) {
341338 return decl->isThisDeclarationADefinition () &&
342339 std::all_of (
343340 decl->method_begin (), decl->method_end (), [](auto *method) {
341+ auto *ctor = clang::dyn_cast<clang::CXXConstructorDecl>(method);
344342 return method->getDefinition () || method->isPureVirtual () ||
345343 method->getTemplateInstantiationPattern () ||
346344 method->getDescribedFunctionTemplate () ||
347- IsCopyOrMoveAssignmentOrCtor (method);
345+ (ctor ? ctor->isCopyOrMoveConstructor ()
346+ : method->isCopyAssignmentOperator () ||
347+ method->isMoveAssignmentOperator ());
348348 });
349349}
350350
0 commit comments