File tree Expand file tree Collapse file tree
cpp2rust/converter/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1047,9 +1047,12 @@ bool ConverterRefCount::VisitImplicitCastExpr(clang::ImplicitCastExpr *expr) {
10471047 }
10481048 }
10491049
1050- if (expr->getCastKind () == clang::CastKind::CK_NullToPointer &&
1051- expr->getType ()->isFunctionPointerType ()) {
1052- StrCat (" FnPtr::null()" );
1050+ if (expr->getCastKind () == clang::CastKind::CK_NullToPointer) {
1051+ if (expr->getType ()->isFunctionPointerType ()) {
1052+ StrCat (" FnPtr::null()" );
1053+ } else {
1054+ StrCat (" Default::default()" );
1055+ }
10531056 computed_expr_type_ = ComputedExprType::FreshPointer;
10541057 return false ;
10551058 }
@@ -1138,6 +1141,11 @@ bool ConverterRefCount::VisitExplicitCastExpr(clang::ExplicitCastExpr *expr) {
11381141 }
11391142 return false ;
11401143 }
1144+ if (expr->getCastKind () == clang::CK_NullToPointer) {
1145+ StrCat (" Default::default()" );
1146+ computed_expr_type_ = ComputedExprType::FreshPointer;
1147+ return false ;
1148+ }
11411149 switch (expr->getStmtClass ()) {
11421150 case clang::Stmt::CXXReinterpretCastExprClass:
11431151 assert (expr->getType ()->isPointerType () &&
You can’t perform that action at this time.
0 commit comments