diff options
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 31749e4..30341b0 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -5031,6 +5031,7 @@ RecordDecl::RecordDecl(Kind DK, TagKind TK, const ASTContext &C, setHasNonTrivialToPrimitiveDefaultInitializeCUnion(false); setHasNonTrivialToPrimitiveDestructCUnion(false); setHasNonTrivialToPrimitiveCopyCUnion(false); + setHasUninitializedExplicitInitFields(false); setParamDestroyedInCallee(false); setArgPassingRestrictions(RecordArgPassingKind::CanPassInRegs); setIsRandomized(false); @@ -5231,9 +5232,10 @@ unsigned RecordDecl::getODRHash() { // Only calculate hash on first call of getODRHash per record. ODRHash Hash; Hash.AddRecordDecl(this); - // For RecordDecl the ODRHash is stored in the remaining 26 - // bit of RecordDeclBits, adjust the hash to accomodate. - setODRHash(Hash.CalculateHash() >> 6); + // For RecordDecl the ODRHash is stored in the remaining + // bits of RecordDeclBits, adjust the hash to accommodate. + static_assert(sizeof(Hash.CalculateHash()) * CHAR_BIT == 32); + setODRHash(Hash.CalculateHash() >> (32 - NumOdrHashBits)); return RecordDeclBits.ODRHash; } |