Skip to content

Commit cad14d1

Browse files
committed
Translate unions in C++
1 parent 5907a12 commit cad14d1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cpp2rust/converter/converter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,11 @@ bool Converter::VisitCXXRecordDecl(clang::CXXRecordDecl *decl) {
891891
}
892892
}
893893

894+
EmitRustStructOrUnion(decl);
895+
} else if (decl->isUnion()) {
896+
if (!record_decls_.MarkDefined(GetRecordName(decl))) {
897+
return false;
898+
}
894899
EmitRustStructOrUnion(decl);
895900
} else {
896901
// FIXME: improve error handling

0 commit comments

Comments
 (0)