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

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Mar 4 11:50:07 PST 2023


philnik added inline comments.


================
Comment at: libcxx/stdmodules/std-format.cppm:12
+// TODO This file is two-fold
+// - look at how we want to integrate a synopsis
+// - test whether the experimental library works properly
----------------
My stance is still that we should just not have it/remove it. Having notes on the papers/extra status pages for large papers is way more reliable than looking through the synopsis, but I guess nobody agrees with me here.


================
Comment at: libcxx/stdmodules/std.cppm:1
+# 1 __FILE__ 1 3
+// -*- C++ -*-
----------------
Couldn't we do
```
# __LINE__ __FILE__ 1 3
export module std;
# __LINE__ __FILE__ 2 3
```
instead?
That should enable all the warnings inside the modules.


================
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
----------------
Mordante wrote:
> ChuanqiXu wrote:
> > 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.
> I rather not use code that's not strictly Standard conforming. Both MSVC STL and libstdc++ use our test suite, so violating the Standard may work for us, but it may break them.
I'm pretty sure that's exactly as technically-non-conforming as checking for `_LIBCPP_VERSION`. No implementation will ever have a problem with it.


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