Skip to content

Commit c490814

Browse files
committed
[cxx-interop] Check the presence of copy constructor correctly
1 parent d7426e2 commit c490814

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7470,8 +7470,9 @@ static bool hasCopyTypeOperations(const clang::CXXRecordDecl *decl) {
74707470
}))
74717471
return false;
74727472

7473-
// TODO: this should probably check to make sure we actually have a copy ctor.
7474-
return true;
7473+
return llvm::any_of(decl->ctors(), [](clang::CXXConstructorDecl *ctor) {
7474+
return ctor->isCopyConstructor();
7475+
});
74757476
}
74767477

74777478
static bool hasMoveTypeOperations(const clang::CXXRecordDecl *decl) {

0 commit comments

Comments
 (0)