From 41dc6ff524b3902d6a35b45acc41761b62bf37dd Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 17 Jan 2012 18:13:45 +0000 Subject: 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 --- clang/lib/Serialization/ASTReaderDecl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index 7fc54bbba41..1f908e76512 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -2131,7 +2131,10 @@ namespace { llvm::SmallPtrSet &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) -- cgit v1.2.3