diff --git a/cpp2rust/converter/models/converter_refcount.cpp b/cpp2rust/converter/models/converter_refcount.cpp index 72f8f143..0da17bc5 100644 --- a/cpp2rust/converter/models/converter_refcount.cpp +++ b/cpp2rust/converter/models/converter_refcount.cpp @@ -1310,9 +1310,9 @@ bool ConverterRefCount::VisitExplicitCastExpr(clang::ExplicitCastExpr *expr) { } else if (expr->getSubExpr()->getType()->isPointerType() && !expr->getSubExpr()->isNullPointerConstant( ctx_, clang::Expr::NPC_ValueDependentIsNull)) { - StrCat(std::format("({}.to_strong().as_pointer() as {})", + StrCat(std::format("{}.reinterpret_cast::<{}>()", ToString(expr->getSubExpr()), - ToString(expr->getType()))); + ConvertPointeeType(expr->getType()))); return false; } return Converter::VisitExplicitCastExpr(expr);