diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-04-12 19:58:30 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-04-12 19:58:30 +0000 |
commit | 58df343b76682e805bf1a90999b745a216dedc9f (patch) | |
tree | 9a76e14b56c4d3e123f9f779f0066f9ebde9226d /clang/lib | |
parent | 4c3fa5f9551639505513a3317fe97399557b1311 (diff) | |
download | bcm5719-llvm-58df343b76682e805bf1a90999b745a216dedc9f.tar.gz bcm5719-llvm-58df343b76682e805bf1a90999b745a216dedc9f.zip |
[modules] When an incompatible module file is explicitly provided for a module,
and we fall back to textual inclusion, don't require the module as a whole to
be marked available; it's OK if some other file in the same module is missing,
just as it would be if the header were explicitly marked textual.
llvm-svn: 266113
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index dc1f32fb569..4312c89d0a7 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -1675,7 +1675,10 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, getLangOpts().CurrentModule) { // If this include corresponds to a module but that module is // unavailable, diagnose the situation and bail out. - if (!SuggestedModule.getModule()->isAvailable()) { + // FIXME: Remove this; loadModule does the same check (but produces + // slightly worse diagnostics). + if (!SuggestedModule.getModule()->isAvailable() && + !SuggestedModule.getModule()->HasIncompatibleModuleFile) { clang::Module::Requirement Requirement; clang::Module::UnresolvedHeaderDirective MissingHeader; Module *M = SuggestedModule.getModule(); |