Skip to content

Commit 2dea857

Browse files
committed
Do not clone records whose implicit copy constructor was deleted
1 parent e41261e commit 2dea857

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎cpp2rust/converter/converter_lib.cpp‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,10 @@ bool HasCallableCopyConstructor(const clang::RecordDecl *decl) {
692692
ctor->getDefinition();
693693
});
694694
}
695-
if (cxx->defaultedCopyConstructorIsDeleted()) {
695+
if (cxx->defaultedCopyConstructorIsDeleted() ||
696+
std::ranges::any_of(cxx->ctors(), [](const auto *ctor) {
697+
return ctor->isCopyConstructor() && ctor->isDeleted();
698+
})) {
696699
return false;
697700
}
698701
auto &ctx = cxx->getASTContext();

0 commit comments

Comments
 (0)