Fix off-by-one error in worst-case number of offsets needed for an AST record.

llvm-svn: 266353
This commit is contained in:
Richard Smith 2016-04-14 18:32:54 +00:00
parent acc50e0a99
commit 9c4fb0a833
2 changed files with 7 additions and 1 deletions

View File

@ -704,7 +704,8 @@ class ASTRecordWriter {
/// declaration or type. /// declaration or type.
SmallVector<Stmt *, 16> StmtsToEmit; SmallVector<Stmt *, 16> StmtsToEmit;
static const int MaxOffsetIndices = 4; /// Worst case: bases, vbases, visible and lexical contents, local redecls.
static const int MaxOffsetIndices = 5;
/// \brief Indices of record elements that describe offsets within the /// \brief Indices of record elements that describe offsets within the
/// bitcode. These will be converted to offsets relative to the current /// bitcode. These will be converted to offsets relative to the current
/// record when emitted. /// record when emitted.

View File

@ -50,3 +50,8 @@ namespace Alias = Aliased;
struct InhCtorA { InhCtorA(int); }; struct InhCtorA { InhCtorA(int); };
struct InhCtorB : InhCtorA { using InhCtorA::InhCtorA; }; struct InhCtorB : InhCtorA { using InhCtorA::InhCtorA; };
struct ClassWithVBases : HasFriends, virtual HasNontrivialDefaultConstructor {
int n;
};
struct ClassWithVBases;