Skip to content

Commit 0584d10

Browse files
committed
Delete extra int cast in VisitParen
1 parent e84db5a commit 0584d10

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

cpp2rust/converter/converter.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,21 +2320,11 @@ bool Converter::VisitParenExpr(clang::ParenExpr *expr) {
23202320
}
23212321
}
23222322

2323-
// Add cast to avoid ambigous integers. Don't add cast if sub expression is a
2324-
// pointer dereference because we might want to mutate the dereferenced value.
2325-
bool should_add_integral_cast =
2326-
expr->getType()->isIntegralOrEnumerationType() && !isAddrOf() &&
2327-
!isVoid() && !clang::isa<clang::UnaryOperator>(expr->getSubExpr());
2328-
PushParen outer(*this, should_add_integral_cast);
2329-
23302323
{
23312324
PushParen inner(*this);
23322325
Convert(expr->getSubExpr());
23332326
}
23342327

2335-
if (should_add_integral_cast) {
2336-
ConvertCast(expr->getType());
2337-
}
23382328
return false;
23392329
}
23402330

0 commit comments

Comments
 (0)