]> granicus.if.org Git - clang/commitdiff
[modules] Extend r266113 to cope with submodules.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 12 Apr 2016 20:20:33 +0000 (20:20 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 12 Apr 2016 20:20:33 +0000 (20:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266116 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPDirectives.cpp
test/Modules/explicit-build-missing-files.cpp

index 4312c89d0a7aca483569ba4333419f0769f0d4c0..59ea27c586888cd01d9071014b313561228da957 100644 (file)
@@ -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();
index ebe08fb40eb74996020382af8fb97001d48b4f0c..e36b5051e8319c850c08006c57c652630f6d739a 100644 (file)
@@ -3,7 +3,7 @@
 // RUN: echo 'extern int a; template<typename T> 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