File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -2610,13 +2610,12 @@ namespace {
2610
2610
}
2611
2611
clang::CXXConstructorDecl *copyCtor = nullptr ;
2612
2612
clang::CXXConstructorDecl *moveCtor = nullptr ;
2613
- if (decl->needsImplicitMoveConstructor ()) {
2614
- moveCtor = clangSema.DeclareImplicitMoveConstructor (
2615
- const_cast <clang::CXXRecordDecl *>(decl));
2616
- }
2617
2613
if (decl->needsImplicitCopyConstructor ()) {
2618
2614
copyCtor = clangSema.DeclareImplicitCopyConstructor (
2619
2615
const_cast <clang::CXXRecordDecl *>(decl));
2616
+ } else if (decl->needsImplicitMoveConstructor ()) {
2617
+ moveCtor = clangSema.DeclareImplicitMoveConstructor (
2618
+ const_cast <clang::CXXRecordDecl *>(decl));
2620
2619
} else {
2621
2620
// We may have a defaulted copy constructor that needs to be defined.
2622
2621
// Try to find it.
Original file line number Diff line number Diff line change @@ -556,7 +556,10 @@ namespace {
556
556
return nullptr ;
557
557
for (auto method : cxxRecordDecl->methods ()) {
558
558
if (auto ctor = dyn_cast<clang::CXXConstructorDecl>(method)) {
559
- if (ctor->isCopyConstructor ())
559
+ if (ctor->isCopyConstructor () &&
560
+ ctor->getAccess () == clang::AS_public &&
561
+ ctor->doesThisDeclarationHaveABody () &&
562
+ !ctor->isDeleted ())
560
563
return ctor;
561
564
}
562
565
}
@@ -570,7 +573,10 @@ namespace {
570
573
return nullptr ;
571
574
for (auto method : cxxRecordDecl->methods ()) {
572
575
if (auto ctor = dyn_cast<clang::CXXConstructorDecl>(method)) {
573
- if (ctor->isMoveConstructor ())
576
+ if (ctor->isMoveConstructor () &&
577
+ ctor->getAccess () == clang::AS_public &&
578
+ ctor->doesThisDeclarationHaveABody () &&
579
+ !ctor->isDeleted ())
574
580
return ctor;
575
581
}
576
582
}
You can’t perform that action at this time.
0 commit comments