[libcxx-commits] [PATCH] D156592: [libc++][modules] Fixes exporting named declarations.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 30 03:48:26 PDT 2023


Mordante created this revision.
Herald added a project: All.
Mordante published this revision for review.
Mordante added a comment.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Note this patch is a minimal fix intended to be backported to LLVM-17. The tests are in D156594 <https://reviews.llvm.org/D156594>.


@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 <https://reviews.llvm.org/D156550>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156592

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


Index: libcxx/modules/std/filesystem.cppm
===================================================================
--- libcxx/modules/std/filesystem.cppm
+++ libcxx/modules/std/filesystem.cppm
@@ -110,11 +110,11 @@
 } // 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
Index: libcxx/modules/std/execution.cppm
===================================================================
--- libcxx/modules/std/execution.cppm
+++ libcxx/modules/std/execution.cppm
@@ -17,7 +17,7 @@
   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;
 
Index: libcxx/modules/std/atomic.cppm
===================================================================
--- libcxx/modules/std/atomic.cppm
+++ libcxx/modules/std/atomic.cppm
@@ -23,9 +23,6 @@
   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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156592.545361.patch
Type: text/x-patch
Size: 1350 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230730/9375a10f/attachment.bin>


More information about the libcxx-commits mailing list