From: Richard Smith Date: Tue, 12 Apr 2016 20:20:33 +0000 (+0000) Subject: [modules] Extend r266113 to cope with submodules. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47bc7ec72ef69769b6fa693d574e1f9159b0d6e6;p=clang [modules] Extend r266113 to cope with submodules. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266116 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 4312c89d0a..59ea27c586 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -1678,7 +1678,9 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, // FIXME: Remove this; loadModule does the same check (but produces // slightly worse diagnostics). if (!SuggestedModule.getModule()->isAvailable() && - !SuggestedModule.getModule()->HasIncompatibleModuleFile) { + !SuggestedModule.getModule() + ->getTopLevelModule() + ->HasIncompatibleModuleFile) { clang::Module::Requirement Requirement; clang::Module::UnresolvedHeaderDirective MissingHeader; Module *M = SuggestedModule.getModule(); diff --git a/test/Modules/explicit-build-missing-files.cpp b/test/Modules/explicit-build-missing-files.cpp index ebe08fb40e..e36b5051e8 100644 --- a/test/Modules/explicit-build-missing-files.cpp +++ b/test/Modules/explicit-build-missing-files.cpp @@ -3,7 +3,7 @@ // RUN: echo 'extern int a; template int a2 = T::error;' > %t/a.h // RUN: echo 'extern int b;' > %t/b.h // RUN: echo 'extern int c = 0;' > %t/c.h -// RUN: echo 'module a { header "a.h" header "b.h" header "c.h" }' > %t/modulemap +// RUN: echo 'module a { module aa { header "a.h" header "b.h" header "c.h" } }' > %t/modulemap // RUN: echo 'module other {}' > %t/other.modulemap // We lazily check that the files referenced by an explicitly-specified .pcm