When collecting all of the redeclarations of a declaration loaded from

a module file, be sure to also add the first (potentially canonical)
declarations to the chain. This isn't guaranteed to occur because the
first declaration is not listed in the stored redeclaration chain.

llvm-svn: 148314
This commit is contained in:
Douglas Gregor 2012-01-17 18:13:45 +00:00
parent d53ae83516
commit 41dc6ff524
1 changed files with 4 additions and 1 deletions

View File

@ -2131,7 +2131,10 @@ namespace {
llvm::SmallPtrSet<Decl *, 16> &Deserialized,
GlobalDeclID CanonID)
: Reader(Reader), SearchDecls(SearchDecls), Deserialized(Deserialized),
CanonID(CanonID) { }
CanonID(CanonID) {
for (unsigned I = 0, N = SearchDecls.size(); I != N; ++I)
addToChain(Reader.GetDecl(SearchDecls[I]));
}
static bool visit(ModuleFile &M, bool Preorder, void *UserData) {
if (Preorder)