[libcxx-commits] [PATCH] D153211: [libc++][Modules] Make module exports consistent with header includes

Ian Anderson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jun 18 19:55:10 PDT 2023


iana added inline comments.


================
Comment at: libcxx/include/__format/format_context.h:24
 #include <__iterator/concepts.h>
+#include <__locale>
 #include <__memory/addressof.h>
----------------
Mordante wrote:
> I doubt this is needed, this is part of `<locale>` and should be exported by `<locale>`. When this is really needed it should be moved to line 31 in the `_LIBCPP_HAS_NO_LOCALIZATION`. Otherwise the CI will fail.
I added this because `std.format.__format.format_context` exports `__locale` (aka `std.__locale`). This currently works because they're in the same top level module, but when `__format/format_context.h` and `__locale` belong to different top level modules, the export can have no effect. (Sometimes it works and sometimes it doesn't. I think if the export is transitively included by one of the module's headers then it does work, but that's fragile.) Most of the includes added in this review are due to similar circumstances: the module for the header was exporting the module for the include. Maybe not all of the exports need to be there, but it's too difficult to track down which ones are necessary after the mega module breakup.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153211



More information about the libcxx-commits mailing list