[PATCH] D118893: [C++20][Modules] Track valid import state.

Nathan Sidwell via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 15 12:18:58 PST 2022


urnathan added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:1543
+def err_import_not_allowed_here : Error<
+  "imports must be contiguous and immediately follow the module declaration">;
+def err_import_in_global_fragment : Error<
----------------
iains wrote:
> urnathan wrote:
> > "imports must immediately follow a module declaration"?  (the contiguous isn't adding anything IMHO)
> um, maybe I need two diagnostics then - the "contiguous" aspect applies when imports are split by a non-import statement.
> 
> Selecting between the two case on the basis of a flag seems unproductive here.  Would two diagnostics seem more reasonable to you?
> 
I don't follow.  If the imports are split by a non-import, then the latter ones don't immediately follow the module declaration.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118893



More information about the cfe-commits mailing list