]> granicus.if.org Git - clang/commit
Revert "Recover better from an incompatible .pcm file being provided by -fmodule...
authorDaniel Jasper <djasper@google.com>
Sun, 4 Dec 2016 22:34:37 +0000 (22:34 +0000)
committerDaniel Jasper <djasper@google.com>
Sun, 4 Dec 2016 22:34:37 +0000 (22:34 +0000)
commitfc454719b46cd00a5877958cd1cb9097e4f0472c
treeaa72929cafd5dbf21e7e477ff87f6e805e55b36c
parentcdc1a6e2aa50cee379c26d2b51fa43bff03ef5eb
Revert "Recover better from an incompatible .pcm file being provided by -fmodule-file=. We try to include the headers of the module textually in this case, still enforcing the modules semantic rules. In order to make that work, we need to still track that we're entering and leaving the module. Also, if the module was also marked as unavailable (perhaps because it was missing a file), we shouldn't mark the module unavailable -- we don't need the module to be complete if we're going to enter it textually."

This reverts commit r288449.

I believe that this is currently faulty wrt. modules being imported
inside namespaces. Adding these lines to the new test:

  namespace n {
  #include "foo.h"
  }

Makes it break with

  fatal error: import of module 'M' appears within namespace 'n'

However, I believe it should fail with

  error: redundant #include of module 'M' appears within namespace 'n'

I have tracked this down to us now inserting a tok::annot_module_begin
instead of a tok::annot_module_include in
Preprocessor::HandleIncludeDirective() and then later in
Parser::parseMisplacedModuleImport(), we hit the code path for
tok::annot_module_begin, which doesn't set FromInclude of
checkModuleImportContext to true (thus leading to the "wrong"
diagnostic).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288626 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Lex/ModuleLoader.h
lib/Frontend/CompilerInstance.cpp
lib/Lex/PPDirectives.cpp
test/Modules/config-mismatch.cpp [deleted file]