[PATCH] D128328: [C++20][Modules] Improve handing of Private Module Fragment diagnostics.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 22 20:14:55 PDT 2022


vsapsai added a comment.

>From the perspective of handling `err_export_inline_not_defined` error as a developer what about the following option?

  export inline void fn_e(); // note: function 'fn_e' exported as 'inline' here
  
  // ...
  module :private;
  void fn_e() {}  // error: definition of function 'fn_e' can not be inlined because it is private

My suggestion isn't about specific wording but about emitting an error for the definition and mention declaration in the note. Will it make easier to explain the situation? Because I'm not a fan of "must be defined within the module purview" and don't know how digestible it will be for others. Please note that the suggestion is purely from user perspective, I haven't checked how it might affect the implementation.



================
Comment at: clang/test/Modules/cxx20-10-5-ex1.cpp:25-28
+export void g(X *x) {
+  fn_s();
+  fn_m();
+}
----------------
Can `export inline` function call other non-`export inline` functions? Sorry if it is tested somewhere else. Curious what are the transitive restrictions, so we test edge cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128328



More information about the cfe-commits mailing list