Skip to content

Commit 7b0bef4

Browse files
committed
Check against array and basic_string
1 parent c540520 commit 7b0bef4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎cpp2rust/converter/converter.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,11 @@ bool Converter::TypeDerivesDefault(clang::QualType qual_type) {
739739
return false;
740740
}
741741

742+
auto *cxx_record = qual_type->getAsCXXRecordDecl();
743+
if (IsStdDecl(cxx_record, "array") || IsStdDecl(cxx_record, "basic_string")) {
744+
return false;
745+
}
746+
742747
// libc types do not implement Default
743748
if (auto record = qual_type->getAsRecordDecl()) {
744749
if (ctx_.getSourceManager().isInSystemHeader(record->getLocation()) &&

0 commit comments

Comments
 (0)