aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-02-25 22:20:13 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-02-25 22:20:13 +0000
commit8cebe37fe9e1f56deb7e47f5aefa647960cdd840 (patch)
tree6675477db77032f69e1a6eb4b0ead08acaf63a0e /clang/lib/Frontend/CompilerInstance.cpp
parente9401f61c26689c3029090dd4c4d8469c61d598e (diff)
downloadllvm-8cebe37fe9e1f56deb7e47f5aefa647960cdd840.zip
llvm-8cebe37fe9e1f56deb7e47f5aefa647960cdd840.tar.gz
llvm-8cebe37fe9e1f56deb7e47f5aefa647960cdd840.tar.bz2
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index fc97981..07812bd 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(),