From 8cebe37fe9e1f56deb7e47f5aefa647960cdd840 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 25 Feb 2015 22:20:13 +0000 Subject: [modules] Even if we already have a definition of a class, loading in another one can give us more lookup results (due to implicit special members). Be sure to complete the redecl chain for every kind of DeclContext before performing a lookup into it, rather than only doing so for NamespaceDecls. llvm-svn: 230558 --- clang/lib/Frontend/CompilerInstance.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'clang/lib/Frontend/CompilerInstance.cpp') diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index fc97981ba22..07812bdc839 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1288,8 +1288,11 @@ bool CompilerInstance::loadModuleFile(StringRef FileName) { bool needsImportVisitation() const override { return true; } void visitImport(StringRef FileName) override { - if (!CI.ExplicitlyLoadedModuleFiles.insert(FileName).second) + if (!CI.ExplicitlyLoadedModuleFiles.insert(FileName).second) { + if (ModuleFileStack.size() == 0) + TopFileIsModule = true; return; + } ModuleFileStack.push_back(FileName); if (ASTReader::readASTFileControlBlock(FileName, CI.getFileManager(), -- cgit v1.2.3