Skip to content

Commit 3051af8

Browse files
committed
Use default for template member with null in-class initializer
1 parent f4566a0 commit 3051af8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎cpp2rust/converter/converter.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4727,8 +4727,8 @@ void Converter::EmitDefaultStructLiteral(const clang::RecordDecl *decl) {
47274727
PushBrace brace(*this);
47284728
for (auto *field : decl->fields()) {
47294729
StrCat(GetNamedDeclAsString(field), token::kColon);
4730-
if (field->hasInClassInitializer()) {
4731-
ConvertVarInit(field->getType(), field->getInClassInitializer());
4730+
if (auto *init = field->getInClassInitializer()) {
4731+
ConvertVarInit(field->getType(), init);
47324732
} else {
47334733
StrCat(GetDefaultAsString(field->getType()));
47344734
}

0 commit comments

Comments
 (0)