[PATCH] D140927: [C++20][Modules] Fix named module import diagnostics.

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 18:00:23 PST 2023


ChuanqiXu added a comment.

[module.import]p1 says:

> In a module unit, all module-import-declarations and export-declarations exporting module-import-declarations shall appear before all other declarations in the declaration-seq of the translation-unit and of the private-module-fragment (if any).

So the following case is invalid:

  //--- b.hpp
  void func() {}
  import a;
  
  //--- c.cpp
  module;
  #include "b.hpp"
  export module c;

I feel we'd better to address such cases in the test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140927



More information about the cfe-commits mailing list