Skip to content

Commit cdff909

Browse files
committed
Fix new[n][n]
1 parent bc4f12b commit cdff909

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎cpp2rust/converter/models/converter_refcount.cpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2187,7 +2187,9 @@ bool ConverterRefCount::VisitCXXNewExpr(clang::CXXNewExpr *expr) {
21872187
} else {
21882188
auto array_size_as_string = ToString(*expr->getArraySize());
21892189
auto alloc_type = expr->getAllocatedType();
2190-
PushConversionKind push(*this, ConversionKind::Unboxed);
2190+
PushConversionKind push(*this, alloc_type->isArrayType()
2191+
? ConversionKind::Pointee
2192+
: ConversionKind::Unboxed);
21912193
auto alloc_type_as_string = ToString(alloc_type);
21922194
auto default_alloc_type_as_string = GetDefaultAsString(alloc_type);
21932195

0 commit comments

Comments
 (0)