[libcxx-commits] [libcxx] e57f6f7 - [libc++][modules] Fixes exporting named declarations.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 31 09:37:52 PDT 2023


Author: Mark de Wever
Date: 2023-07-31T18:37:45+02:00
New Revision: e57f6f709ed2ebef7852bebb47baaf202962b4ee

URL: https://github.com/llvm/llvm-project/commit/e57f6f709ed2ebef7852bebb47baaf202962b4ee
DIFF: https://github.com/llvm/llvm-project/commit/e57f6f709ed2ebef7852bebb47baaf202962b4ee.diff

LOG: [libc++][modules] Fixes exporting named declarations.

@ChuanqiXu noticed std::atomic was not properly exported in the std module.
Investigation showed other named declarations were not exported either. This
fixes the issue.

Depends on D156550

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D156592

Added: 
    

Modified: 
    libcxx/modules/std/atomic.cppm
    libcxx/modules/std/execution.cppm
    libcxx/modules/std/filesystem.cppm

Removed: 
    


################################################################################
diff  --git a/libcxx/modules/std/atomic.cppm b/libcxx/modules/std/atomic.cppm
index 9c1948494bd4ab..faf902b768d750 100644
--- a/libcxx/modules/std/atomic.cppm
+++ b/libcxx/modules/std/atomic.cppm
@@ -23,9 +23,6 @@ export namespace std {
   using std::memory_order_seq_cst;
 
   using std::kill_dependency;
-} // namespace std
-
-namespace std {
 
   // [atomics.ref.generic], class template atomic_ref
   // [atomics.ref.pointer], partial specialization for pointers

diff  --git a/libcxx/modules/std/execution.cppm b/libcxx/modules/std/execution.cppm
index 6ea12c0dc4ee45..e0996f33d41523 100644
--- a/libcxx/modules/std/execution.cppm
+++ b/libcxx/modules/std/execution.cppm
@@ -17,7 +17,7 @@ export namespace std {
   using std::is_execution_policy_v;
 } // namespace std
 
-namespace std::execution {
+export namespace std::execution {
   // [execpol.seq], sequenced execution policy
   using std::execution::sequenced_policy;
 

diff  --git a/libcxx/modules/std/filesystem.cppm b/libcxx/modules/std/filesystem.cppm
index ea8136b4ef9fcf..c6dac368a1cd58 100644
--- a/libcxx/modules/std/filesystem.cppm
+++ b/libcxx/modules/std/filesystem.cppm
@@ -110,11 +110,11 @@ export namespace std::filesystem {
 } // namespace std::filesystem
 
 // [fs.path.hash], hash support
-namespace std {
+export namespace std {
   using std::hash;
 }
 
-namespace std::ranges {
+export namespace std::ranges {
   using std::ranges::enable_borrowed_range;
   using std::ranges::enable_view;
 } // namespace std::ranges


        


More information about the libcxx-commits mailing list