[libcxx-commits] [libcxx] [libc++] First attempt to regroup a few modules in the modulemap (PR #98214)

Ian Anderson via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 15 10:12:07 PDT 2024


================
@@ -245,8 +245,15 @@ module std_stdexcept [system] {
   header "stdexcept"
   export *
 }
-module std_stop_token {
+module std_stop_token [system] {
   header "stop_token"
+  private header "__stop_token/atomic_unique_lock.h"
----------------
ian-twilightcoder wrote:

Well yes. The stop_token implementation headers are a bit unique in that stop_token itself directly includes all of them, and none of the other headers do. Something more typical is like __type_traits headers. You can't do like this.
```
module std_type_traits [system] {
  header "type_traits"
  private header "__type_traits/A.h"
  export *
}
```
1. If say `algorithm` includes __type_traits/A.h it will also get type_traits and all of the other headers declared at the same level.
2. `algorithm` can't include __type_traits/A.h because it's private.

So while this is fine for stop_token, it's going to unravel fast when you try to do some of the more significant ones.

https://github.com/llvm/llvm-project/pull/98214


More information about the libcxx-commits mailing list