We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eddc30e commit 913f25fCopy full SHA for 913f25f
1 file changed
cpp2rust/converter/models/converter_refcount.cpp
@@ -1149,7 +1149,8 @@ bool ConverterRefCount::VisitExplicitCastExpr(clang::ExplicitCastExpr *expr) {
1149
case clang::Stmt::CXXStaticCastExprClass:
1150
if (!VisitFunctionPointerCast(expr)) {
1151
return false;
1152
- } else if (expr->getSubExpr()->getType()->isVoidPointerType()) {
+ } else if (expr->getSubExpr()->getType()->isVoidPointerType() &&
1153
+ expr->getType()->isPointerType()) {
1154
Convert(expr->getSubExpr());
1155
PushConversionKind push(*this, ConversionKind::Unboxed);
1156
StrCat(std::format(".cast::<{}>().expect(\"ub:wrong type\")",
0 commit comments