diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index fe63b7043c50..cb4310836dd7 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1536,7 +1536,7 @@ TypeIndex CodeViewDebug::lowerTypeUnion(const DICompositeType *Ty) { } TypeIndex CodeViewDebug::lowerCompleteTypeUnion(const DICompositeType *Ty) { - ClassOptions CO = getCommonClassOptions(Ty); + ClassOptions CO = ClassOptions::Sealed | getCommonClassOptions(Ty); TypeIndex FieldTI; unsigned FieldCount; bool ContainsNestedClass; diff --git a/llvm/test/DebugInfo/COFF/types-data-members.ll b/llvm/test/DebugInfo/COFF/types-data-members.ll index 70a509714b69..759a5e546446 100644 --- a/llvm/test/DebugInfo/COFF/types-data-members.ll +++ b/llvm/test/DebugInfo/COFF/types-data-members.ll @@ -161,8 +161,9 @@ ; CHECK: Union (0x100B) { ; CHECK: TypeLeafKind: LF_UNION (0x1506) ; CHECK: MemberCount: 2 -; CHECK: Properties [ (0x200) +; CHECK: Properties [ (0x600) ; CHECK: HasUniqueName (0x200) +; CHECK: Sealed (0x400) ; CHECK: ] ; CHECK: FieldList: (0x100A) ; CHECK: SizeOf: 4