[PATCH] D84458: [Modules] Improve error message when cannot find parent module for submodule definition.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 23 12:57:45 PDT 2020


vsapsai marked 3 inline comments as done.
vsapsai added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticLexKinds.td:700
+  "no module named '%0' %select{found|in '%2'}1, "
+  "expected parent module to be defined before the submodule">;
 def err_mmap_top_level_inferred_submodule : Error<
----------------
Not sure about this second part of the message ("expected..."). Wanted to make it more actionable but not entirely happy with the wording. Any suggestions including removal are welcome.


================
Comment at: clang/lib/Lex/ModuleMap.cpp:1911
-      } else {
-        Diags.Report(Id[I].second, diag::err_mmap_expected_module_name);
-      }
----------------
Both of `err_mmap_missing_module_qualified` and `err_mmap_expected_module_name` are still used in other places.


================
Comment at: clang/lib/Lex/ModuleMap.cpp:1914
       HadError = true;
-      return;
     }
----------------
I've removed this `return` because otherwise you get spurious "expected module declaration" errors for valid module definition.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84458/new/

https://reviews.llvm.org/D84458





More information about the cfe-commits mailing list