[libcxx-commits] [PATCH] D144994: [Draft][libc++][modules] Adds std module.

Chuanqi Xu via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 1 18:26:49 PST 2023


ChuanqiXu added a comment.

I noticed the test lives under `std_modules` dir. But they should live under `std` dir finally, right?



================
Comment at: libcxx/test/std_modules/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.pass.cpp:19-24
+#ifdef TEST_MODULES
+import std;
+#else
+#  include <coroutine>
+#  include <type_traits>
+#endif
----------------
philnik wrote:
> Mordante wrote:
> > philnik wrote:
> > > Couldn't we just have a header with `import std;` in it that is always included in the C++ modules build? We have to test `#include`ing the headers and modules together anyways. That would avoid touching every single test and adding a preprocessor conditional.
> > Interesting point. I think we then need 3 versions:
> > - module with only an import
> > - module with import and test whether works with includes
> > - non-module only using includes.
> > 
> > But this is indeed one of the things we need to think about how we want to tackle it.
> For "only an import" it would be possible to have dummy headers, which just export nothing. It's probably technically not standards-conforming, but I don't think that's a real problem.
While I don't maintain libcxx, I suggest to use the current style. Since I feel it has better readability.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144994



More information about the libcxx-commits mailing list