Skip to content

Commit 3b24d92

Browse files
authored
simplify
Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>
1 parent 3f03664 commit 3b24d92

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎cpp2rust/converter/models/converter_refcount.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,16 +1240,16 @@ bool ConverterRefCount::VisitImplicitCastExpr(clang::ImplicitCastExpr *expr) {
12401240
}
12411241

12421242
if (expr->getCastKind() == clang::CastKind::CK_NoOp) {
1243+
Convert(sub_expr);
1244+
12431245
if (expr->getType()->isPointerType() && sub_expr->getType()->isPointerType()) {
12441246
auto dest_type = ConvertPointeeType(expr->getType());
12451247
if (dest_type != ConvertPointeeType(sub_expr->getType())) {
1246-
Convert(sub_expr);
12471248
StrCat(std::format(".reinterpret_cast::<{}>()", dest_type));
12481249
computed_expr_type_ = ComputedExprType::FreshPointer;
12491250
return false;
12501251
}
12511252
}
1252-
Convert(sub_expr);
12531253
return false;
12541254
}
12551255

0 commit comments

Comments
 (0)