[c++20] Parsing support for module-declarations, import-declarations,
and the global and private module fragment.

For now, the private module fragment introducer is ignored, but use of
the global module fragment introducer should be properly enforced.

llvm-svn: 358353
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index c4adec8..b3778c1 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -1648,6 +1648,7 @@
                                             EndLoc, LookupFrom, LookupFromFile);
   switch (Action.Kind) {
   case ImportAction::None:
+  case ImportAction::SkippedModuleImport:
     break;
   case ImportAction::ModuleBegin:
     EnterAnnotationToken(SourceRange(HashLoc, EndLoc),
@@ -2034,6 +2035,8 @@
   switch (Action) {
   case Skip:
     // If we don't need to enter the file, stop now.
+    if (Module *M = SuggestedModule.getModule())
+      return {ImportAction::SkippedModuleImport, M};
     return {ImportAction::None};
 
   case IncludeLimitReached:
@@ -2117,6 +2120,7 @@
     return {ImportAction::ModuleBegin, M};
   }
 
+  assert(!IsImportDecl && "failed to diagnose missing module for import decl");
   return {ImportAction::None};
 }