Skip to content

Commit 4fad019

Browse files
committed
Apply the specialization to all integer types
1 parent a9761ca commit 4fad019

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cpp2rust/converter/converter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3151,7 +3151,8 @@ bool Converter::VisitImplicitValueInitExpr(clang::ImplicitValueInitExpr *expr) {
31513151
if (auto arr_ty = clang::dyn_cast<clang::ArrayType>(
31523152
expr->getType()->getCanonicalTypeInternal().getTypePtr())) {
31533153
if (auto const_arr_ty = clang::dyn_cast<clang::ConstantArrayType>(arr_ty)) {
3154-
if (const_arr_ty->getElementType()->isCharType()) {
3154+
auto elem_ty = const_arr_ty->getElementType();
3155+
if (elem_ty->isIntegerType() && !elem_ty->isEnumeralType()) {
31553156
StrCat(std::format("[0; {}]", const_arr_ty->getSize().getZExtValue()));
31563157
return false;
31573158
}

0 commit comments

Comments
 (0)