[libcxx-commits] [libcxx] [libc++][modules] Attach declarations to the global module. (PR #92747)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon May 20 06:09:04 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Mark de Wever (mordante)
<details>
<summary>Changes</summary>
Declarations in the global module fragment (the included headers) are attached to the global module. The using declarations in the module std and std.compat were attached to their module.
This violates
[basic.link]/10
If two declarations of an entity are attached to different modules, the
program is ill-formed; no diagnostic is required if neither is reachable from
the other.
Instead attach the delarations in the module to the global module by using a linkage-specification. ([module.unit]/7)
Thanks to @<!-- -->DanielaE for pointing out this issue.
---
Patch is 63.85 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/92747.diff
133 Files Affected:
- (modified) libcxx/include/__config (+6)
- (modified) libcxx/modules/std.compat/cassert.inc (+2-2)
- (modified) libcxx/modules/std.compat/cctype.inc (+2-2)
- (modified) libcxx/modules/std.compat/cerrno.inc (+2-2)
- (modified) libcxx/modules/std.compat/cfenv.inc (+2-2)
- (modified) libcxx/modules/std.compat/cfloat.inc (+2-2)
- (modified) libcxx/modules/std.compat/cinttypes.inc (+2-2)
- (modified) libcxx/modules/std.compat/climits.inc (+2-2)
- (modified) libcxx/modules/std.compat/clocale.inc (+2-2)
- (modified) libcxx/modules/std.compat/cmath.inc (+2-2)
- (modified) libcxx/modules/std.compat/csetjmp.inc (+2-2)
- (modified) libcxx/modules/std.compat/csignal.inc (+2-2)
- (modified) libcxx/modules/std.compat/cstdarg.inc (+1-1)
- (modified) libcxx/modules/std.compat/cstddef.inc (+2-2)
- (modified) libcxx/modules/std.compat/cstdint.inc (+2-2)
- (modified) libcxx/modules/std.compat/cstdio.inc (+2-2)
- (modified) libcxx/modules/std.compat/cstdlib.inc (+2-2)
- (modified) libcxx/modules/std.compat/cstring.inc (+2-2)
- (modified) libcxx/modules/std.compat/ctime.inc (+2-2)
- (modified) libcxx/modules/std.compat/cuchar.inc (+2-2)
- (modified) libcxx/modules/std.compat/cwchar.inc (+2-2)
- (modified) libcxx/modules/std.compat/cwctype.inc (+2-2)
- (modified) libcxx/modules/std/algorithm.inc (+1-1)
- (modified) libcxx/modules/std/any.inc (+1-2)
- (modified) libcxx/modules/std/array.inc (+1-2)
- (modified) libcxx/modules/std/atomic.inc (+1-2)
- (modified) libcxx/modules/std/barrier.inc (+1-1)
- (modified) libcxx/modules/std/bit.inc (+1-1)
- (modified) libcxx/modules/std/bitset.inc (+1-1)
- (modified) libcxx/modules/std/cassert.inc (+1-1)
- (modified) libcxx/modules/std/cctype.inc (+1-1)
- (modified) libcxx/modules/std/cerrno.inc (+1-1)
- (modified) libcxx/modules/std/cfenv.inc (+1-1)
- (modified) libcxx/modules/std/cfloat.inc (+1-1)
- (modified) libcxx/modules/std/charconv.inc (+1-2)
- (modified) libcxx/modules/std/chrono.inc (+2-3)
- (modified) libcxx/modules/std/cinttypes.inc (+1-1)
- (modified) libcxx/modules/std/climits.inc (+1-1)
- (modified) libcxx/modules/std/clocale.inc (+1-1)
- (modified) libcxx/modules/std/cmath.inc (+1-2)
- (modified) libcxx/modules/std/codecvt.inc (+1-1)
- (modified) libcxx/modules/std/compare.inc (+1-2)
- (modified) libcxx/modules/std/complex.inc (+1-2)
- (modified) libcxx/modules/std/concepts.inc (+1-2)
- (modified) libcxx/modules/std/condition_variable.inc (+1-1)
- (modified) libcxx/modules/std/coroutine.inc (+1-2)
- (modified) libcxx/modules/std/csetjmp.inc (+1-1)
- (modified) libcxx/modules/std/csignal.inc (+1-1)
- (modified) libcxx/modules/std/cstdarg.inc (+1-3)
- (modified) libcxx/modules/std/cstddef.inc (+1-1)
- (modified) libcxx/modules/std/cstdint.inc (+1-1)
- (modified) libcxx/modules/std/cstdio.inc (+1-1)
- (modified) libcxx/modules/std/cstdlib.inc (+1-1)
- (modified) libcxx/modules/std/cstring.inc (+1-1)
- (modified) libcxx/modules/std/ctime.inc (+1-1)
- (modified) libcxx/modules/std/cuchar.inc (+1-1)
- (modified) libcxx/modules/std/cwchar.inc (+1-1)
- (modified) libcxx/modules/std/cwctype.inc (+1-1)
- (modified) libcxx/modules/std/deque.inc (+1-1)
- (modified) libcxx/modules/std/exception.inc (+1-1)
- (modified) libcxx/modules/std/execution.inc (+2-2)
- (modified) libcxx/modules/std/expected.inc (+1-1)
- (modified) libcxx/modules/std/filesystem.inc (+3-5)
- (modified) libcxx/modules/std/flat_map.inc (+1-1)
- (modified) libcxx/modules/std/flat_set.inc (+1-1)
- (modified) libcxx/modules/std/format.inc (+1-1)
- (modified) libcxx/modules/std/forward_list.inc (+1-1)
- (modified) libcxx/modules/std/fstream.inc (+1-1)
- (modified) libcxx/modules/std/functional.inc (+1-1)
- (modified) libcxx/modules/std/future.inc (+1-1)
- (modified) libcxx/modules/std/generator.inc (+1-1)
- (modified) libcxx/modules/std/hazard_pointer.inc (+1-1)
- (modified) libcxx/modules/std/initializer_list.inc (+1-1)
- (modified) libcxx/modules/std/iomanip.inc (+1-1)
- (modified) libcxx/modules/std/ios.inc (+1-1)
- (modified) libcxx/modules/std/iosfwd.inc (+1-1)
- (modified) libcxx/modules/std/iostream.inc (+1-1)
- (modified) libcxx/modules/std/istream.inc (+1-1)
- (modified) libcxx/modules/std/iterator.inc (+1-1)
- (modified) libcxx/modules/std/latch.inc (+1-1)
- (modified) libcxx/modules/std/limits.inc (+1-1)
- (modified) libcxx/modules/std/list.inc (+1-1)
- (modified) libcxx/modules/std/locale.inc (+1-1)
- (modified) libcxx/modules/std/map.inc (+1-1)
- (modified) libcxx/modules/std/mdspan.inc (+1-1)
- (modified) libcxx/modules/std/memory.inc (+1-1)
- (modified) libcxx/modules/std/memory_resource.inc (+1-1)
- (modified) libcxx/modules/std/mutex.inc (+1-1)
- (modified) libcxx/modules/std/new.inc (+3-3)
- (modified) libcxx/modules/std/numbers.inc (+1-1)
- (modified) libcxx/modules/std/numeric.inc (+1-1)
- (modified) libcxx/modules/std/optional.inc (+1-1)
- (modified) libcxx/modules/std/ostream.inc (+1-1)
- (modified) libcxx/modules/std/print.inc (+1-1)
- (modified) libcxx/modules/std/queue.inc (+1-1)
- (modified) libcxx/modules/std/random.inc (+1-1)
- (modified) libcxx/modules/std/ranges.inc (+1-1)
- (modified) libcxx/modules/std/ratio.inc (+1-1)
- (modified) libcxx/modules/std/rcu.inc (+1-1)
- (modified) libcxx/modules/std/regex.inc (+1-1)
- (modified) libcxx/modules/std/scoped_allocator.inc (+1-1)
- (modified) libcxx/modules/std/semaphore.inc (+1-1)
- (modified) libcxx/modules/std/set.inc (+1-1)
- (modified) libcxx/modules/std/shared_mutex.inc (+1-1)
- (modified) libcxx/modules/std/source_location.inc (+1-3)
- (modified) libcxx/modules/std/span.inc (+1-1)
- (modified) libcxx/modules/std/spanstream.inc (+1-1)
- (modified) libcxx/modules/std/sstream.inc (+1-1)
- (modified) libcxx/modules/std/stack.inc (+1-1)
- (modified) libcxx/modules/std/stacktrace.inc (+1-1)
- (modified) libcxx/modules/std/stdexcept.inc (+1-1)
- (modified) libcxx/modules/std/stdfloat.inc (+1-1)
- (modified) libcxx/modules/std/stop_token.inc (+1-1)
- (modified) libcxx/modules/std/streambuf.inc (+1-1)
- (modified) libcxx/modules/std/string.inc (+1-1)
- (modified) libcxx/modules/std/string_view.inc (+1-1)
- (modified) libcxx/modules/std/strstream.inc (+1-1)
- (modified) libcxx/modules/std/syncstream.inc (+1-1)
- (modified) libcxx/modules/std/system_error.inc (+1-1)
- (modified) libcxx/modules/std/text_encoding.inc (+1-1)
- (modified) libcxx/modules/std/thread.inc (+1-1)
- (modified) libcxx/modules/std/tuple.inc (+1-1)
- (modified) libcxx/modules/std/type_traits.inc (+1-1)
- (modified) libcxx/modules/std/typeindex.inc (+1-1)
- (modified) libcxx/modules/std/typeinfo.inc (+1-1)
- (modified) libcxx/modules/std/unordered_map.inc (+1-1)
- (modified) libcxx/modules/std/unordered_set.inc (+1-1)
- (modified) libcxx/modules/std/utility.inc (+1-1)
- (modified) libcxx/modules/std/valarray.inc (+1-1)
- (modified) libcxx/modules/std/variant.inc (+1-1)
- (modified) libcxx/modules/std/vector.inc (+1-1)
- (modified) libcxx/modules/std/version.inc (+1-1)
- (modified) libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp (+8-1)
``````````diff
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 104a244cc82cc..a75cb86a83daf 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -837,6 +837,12 @@ typedef __char32_t char32_t;
# define _LIBCPP_END_NAMESPACE_FILESYSTEM }} _LIBCPP_END_NAMESPACE_STD
// clang-format on
+// Named declarations included in the headers are part of the global module
+// fragment. These declarations are attached to the global module. The using
+// declarations in the module should also attach their declarations to the
+// global module. This is done by using a linkage specification.
+# define _LIBCPP_MODULE_EXPORT extern "C++" export
+
# if __has_attribute(__enable_if__)
# define _LIBCPP_PREFERRED_OVERLOAD __attribute__((__enable_if__(true, "")))
# endif
diff --git a/libcxx/modules/std.compat/cassert.inc b/libcxx/modules/std.compat/cassert.inc
index ac0533d14e9a9..befbfc49ba4d4 100644
--- a/libcxx/modules/std.compat/cassert.inc
+++ b/libcxx/modules/std.compat/cassert.inc
@@ -7,6 +7,6 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
// This module exports nothing.
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cctype.inc b/libcxx/modules/std.compat/cctype.inc
index 5cde12ddb38d7..34b0e55c243ff 100644
--- a/libcxx/modules/std.compat/cctype.inc
+++ b/libcxx/modules/std.compat/cctype.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
using ::isalnum _LIBCPP_USING_IF_EXISTS;
using ::isalpha _LIBCPP_USING_IF_EXISTS;
using ::isblank _LIBCPP_USING_IF_EXISTS;
@@ -22,4 +22,4 @@ export {
using ::isxdigit _LIBCPP_USING_IF_EXISTS;
using ::tolower _LIBCPP_USING_IF_EXISTS;
using ::toupper _LIBCPP_USING_IF_EXISTS;
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cerrno.inc b/libcxx/modules/std.compat/cerrno.inc
index ac0533d14e9a9..befbfc49ba4d4 100644
--- a/libcxx/modules/std.compat/cerrno.inc
+++ b/libcxx/modules/std.compat/cerrno.inc
@@ -7,6 +7,6 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
// This module exports nothing.
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cfenv.inc b/libcxx/modules/std.compat/cfenv.inc
index 5a373f6469712..d2a484323d6ca 100644
--- a/libcxx/modules/std.compat/cfenv.inc
+++ b/libcxx/modules/std.compat/cfenv.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
// types
using ::fenv_t _LIBCPP_USING_IF_EXISTS;
using ::fexcept_t _LIBCPP_USING_IF_EXISTS;
@@ -26,4 +26,4 @@ export {
using ::feholdexcept _LIBCPP_USING_IF_EXISTS;
using ::fesetenv _LIBCPP_USING_IF_EXISTS;
using ::feupdateenv _LIBCPP_USING_IF_EXISTS;
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cfloat.inc b/libcxx/modules/std.compat/cfloat.inc
index ac0533d14e9a9..befbfc49ba4d4 100644
--- a/libcxx/modules/std.compat/cfloat.inc
+++ b/libcxx/modules/std.compat/cfloat.inc
@@ -7,6 +7,6 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
// This module exports nothing.
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cinttypes.inc b/libcxx/modules/std.compat/cinttypes.inc
index 4789ec3310200..c6011f0ae22e1 100644
--- a/libcxx/modules/std.compat/cinttypes.inc
+++ b/libcxx/modules/std.compat/cinttypes.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
using ::imaxdiv_t _LIBCPP_USING_IF_EXISTS;
using ::imaxabs _LIBCPP_USING_IF_EXISTS;
@@ -22,4 +22,4 @@ export {
// div is conditionally here, but always present in cstdlib.cppm. To avoid
// conflicing declarations omit the using here.
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/climits.inc b/libcxx/modules/std.compat/climits.inc
index ac0533d14e9a9..befbfc49ba4d4 100644
--- a/libcxx/modules/std.compat/climits.inc
+++ b/libcxx/modules/std.compat/climits.inc
@@ -7,6 +7,6 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
// This module exports nothing.
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/clocale.inc b/libcxx/modules/std.compat/clocale.inc
index 1a975c560a496..2b0982ac61a2f 100644
--- a/libcxx/modules/std.compat/clocale.inc
+++ b/libcxx/modules/std.compat/clocale.inc
@@ -7,11 +7,11 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
using ::lconv _LIBCPP_USING_IF_EXISTS;
using ::localeconv _LIBCPP_USING_IF_EXISTS;
using ::setlocale _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_HAS_NO_LOCALIZATION
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cmath.inc b/libcxx/modules/std.compat/cmath.inc
index 6c86d0df57406..cd858968122b3 100644
--- a/libcxx/modules/std.compat/cmath.inc
+++ b/libcxx/modules/std.compat/cmath.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
using ::double_t _LIBCPP_USING_IF_EXISTS;
using ::float_t _LIBCPP_USING_IF_EXISTS;
@@ -265,4 +265,4 @@ export {
using ::signbit _LIBCPP_USING_IF_EXISTS;
// [sf.cmath], mathematical special functions
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/csetjmp.inc b/libcxx/modules/std.compat/csetjmp.inc
index 53e1421a2fbdd..94c698387ff9f 100644
--- a/libcxx/modules/std.compat/csetjmp.inc
+++ b/libcxx/modules/std.compat/csetjmp.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
using ::jmp_buf _LIBCPP_USING_IF_EXISTS;
using ::longjmp _LIBCPP_USING_IF_EXISTS;
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/csignal.inc b/libcxx/modules/std.compat/csignal.inc
index bf72459df1653..8d83d2dcaf67d 100644
--- a/libcxx/modules/std.compat/csignal.inc
+++ b/libcxx/modules/std.compat/csignal.inc
@@ -7,11 +7,11 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
using ::sig_atomic_t _LIBCPP_USING_IF_EXISTS;
// [support.signal], signal handlers
using ::signal _LIBCPP_USING_IF_EXISTS;
using ::raise _LIBCPP_USING_IF_EXISTS;
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cstdarg.inc b/libcxx/modules/std.compat/cstdarg.inc
index 79b5df4ec99ce..e7aaddce6d688 100644
--- a/libcxx/modules/std.compat/cstdarg.inc
+++ b/libcxx/modules/std.compat/cstdarg.inc
@@ -7,4 +7,4 @@
//
//===----------------------------------------------------------------------===//
-export { using ::va_list _LIBCPP_USING_IF_EXISTS; } // export
+_LIBCPP_MODULE_EXPORT { using ::va_list _LIBCPP_USING_IF_EXISTS; } // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cstddef.inc b/libcxx/modules/std.compat/cstddef.inc
index 8704a31e01f32..f7f4c5e993dca 100644
--- a/libcxx/modules/std.compat/cstddef.inc
+++ b/libcxx/modules/std.compat/cstddef.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
using ::max_align_t _LIBCPP_USING_IF_EXISTS;
using ::nullptr_t;
using ::ptrdiff_t _LIBCPP_USING_IF_EXISTS;
@@ -19,4 +19,4 @@ export {
// function templates described in [support.types.byteops]. ...
// [support.types.byteops], byte type operations
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cstdint.inc b/libcxx/modules/std.compat/cstdint.inc
index a8dd6898cb266..5edddde004d2d 100644
--- a/libcxx/modules/std.compat/cstdint.inc
+++ b/libcxx/modules/std.compat/cstdint.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
// signed
using ::int8_t _LIBCPP_USING_IF_EXISTS;
using ::int16_t _LIBCPP_USING_IF_EXISTS;
@@ -47,4 +47,4 @@ export {
using ::uintmax_t _LIBCPP_USING_IF_EXISTS;
using ::uintptr_t _LIBCPP_USING_IF_EXISTS;
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cstdio.inc b/libcxx/modules/std.compat/cstdio.inc
index 33dd2cbfb0d7c..4dc19dc193667 100644
--- a/libcxx/modules/std.compat/cstdio.inc
+++ b/libcxx/modules/std.compat/cstdio.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
using ::FILE _LIBCPP_USING_IF_EXISTS;
using ::fpos_t _LIBCPP_USING_IF_EXISTS;
using ::size_t _LIBCPP_USING_IF_EXISTS;
@@ -58,4 +58,4 @@ export {
using ::vsprintf _LIBCPP_USING_IF_EXISTS;
using ::vsscanf _LIBCPP_USING_IF_EXISTS;
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cstdlib.inc b/libcxx/modules/std.compat/cstdlib.inc
index 94f5e7e8d7f45..52414334c33d3 100644
--- a/libcxx/modules/std.compat/cstdlib.inc
+++ b/libcxx/modules/std.compat/cstdlib.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
using ::div_t _LIBCPP_USING_IF_EXISTS;
using ::ldiv_t _LIBCPP_USING_IF_EXISTS;
using ::lldiv_t _LIBCPP_USING_IF_EXISTS;
@@ -69,4 +69,4 @@ export {
using ::ldiv _LIBCPP_USING_IF_EXISTS;
using ::lldiv _LIBCPP_USING_IF_EXISTS;
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cstring.inc b/libcxx/modules/std.compat/cstring.inc
index 5029a7674bb21..fbc59d5b120c0 100644
--- a/libcxx/modules/std.compat/cstring.inc
+++ b/libcxx/modules/std.compat/cstring.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
using ::size_t _LIBCPP_USING_IF_EXISTS;
using ::memchr _LIBCPP_USING_IF_EXISTS;
@@ -33,4 +33,4 @@ export {
using ::strtok _LIBCPP_USING_IF_EXISTS;
using ::strxfrm _LIBCPP_USING_IF_EXISTS;
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/ctime.inc b/libcxx/modules/std.compat/ctime.inc
index eba8234a08969..af2d8043c3197 100644
--- a/libcxx/modules/std.compat/ctime.inc
+++ b/libcxx/modules/std.compat/ctime.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
using ::clock_t _LIBCPP_USING_IF_EXISTS;
using ::size_t _LIBCPP_USING_IF_EXISTS;
using ::time_t _LIBCPP_USING_IF_EXISTS;
@@ -25,4 +25,4 @@ export {
using ::strftime _LIBCPP_USING_IF_EXISTS;
using ::time _LIBCPP_USING_IF_EXISTS;
using ::timespec_get _LIBCPP_USING_IF_EXISTS;
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cuchar.inc b/libcxx/modules/std.compat/cuchar.inc
index d1a511cadef18..d14307d47c48d 100644
--- a/libcxx/modules/std.compat/cuchar.inc
+++ b/libcxx/modules/std.compat/cuchar.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
// Note the Standard does not mark these symbols optional, but libc++'s header
// does. So this seems strictly not to be conforming.
@@ -25,4 +25,4 @@ export {
using ::c16rtomb _LIBCPP_USING_IF_EXISTS;
using ::mbrtoc32 _LIBCPP_USING_IF_EXISTS;
using ::c32rtomb _LIBCPP_USING_IF_EXISTS;
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cwchar.inc b/libcxx/modules/std.compat/cwchar.inc
index 4cad9281fb49a..21bd1c29ff571 100644
--- a/libcxx/modules/std.compat/cwchar.inc
+++ b/libcxx/modules/std.compat/cwchar.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
using ::size_t _LIBCPP_USING_IF_EXISTS;
@@ -77,4 +77,4 @@ export {
using ::wcrtomb _LIBCPP_USING_IF_EXISTS;
using ::wcsrtombs _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std.compat/cwctype.inc b/libcxx/modules/std.compat/cwctype.inc
index 8d06eaa379eaa..28f58733f1261 100644
--- a/libcxx/modules/std.compat/cwctype.inc
+++ b/libcxx/modules/std.compat/cwctype.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export {
+_LIBCPP_MODULE_EXPORT {
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
using ::wctrans_t _LIBCPP_USING_IF_EXISTS;
using ::wctype_t _LIBCPP_USING_IF_EXISTS;
@@ -32,4 +32,4 @@ export {
using ::wctrans _LIBCPP_USING_IF_EXISTS;
using ::wctype _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
-} // export
+} // _LIBCPP_MODULE_EXPORT
diff --git a/libcxx/modules/std/algorithm.inc b/libcxx/modules/std/algorithm.inc
index e7796bfa26af8..71a7788d209bb 100644
--- a/libcxx/modules/std/algorithm.inc
+++ b/libcxx/modules/std/algorithm.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
+_LIBCPP_MODULE_EXPORT namespace std {
namespace ranges {
// [algorithms.results], algorithm result types
using std::ranges::in_found_result;
diff --git a/libcxx/modules/std/any.inc b/libcxx/modules/std/any.inc
index c57257ede8490..1430e76623eb6 100644
--- a/libcxx/modules/std/any.inc
+++ b/libcxx/modules/std/any.inc
@@ -7,8 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
-
+_LIBCPP_MODULE_EXPORT namespace std {
// [any.bad.any.cast], class bad_any_cast
using std::bad_any_cast;
diff --git a/libcxx/modules/std/array.inc b/libcxx/modules/std/array.inc
index d55779c8bd128..180fcfed6120e 100644
--- a/libcxx/modules/std/array.inc
+++ b/libcxx/modules/std/array.inc
@@ -7,8 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
-
+_LIBCPP_MODULE_EXPORT namespace std {
// [array], class template array
using std::array;
diff --git a/libcxx/modules/std/atomic.inc b/libcxx/modules/std/atomic.inc
index d77d7a5bb0fbc..2513aa527d28b 100644
--- a/libcxx/modules/std/atomic.inc
+++ b/libcxx/modules/std/atomic.inc
@@ -7,8 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
-
+_LIBCPP_MODULE_EXPORT namespace std {
// [atomics.order], order and consistency
using std::memory_order _LIBCPP_USING_IF_EXISTS;
using std::memory_order_acq_rel _LIBCPP_USING_IF_EXISTS;
diff --git a/libcxx/modules/std/barrier.inc b/libcxx/modules/std/barrier.inc
index dadb67f7ef330..3ad2e87c7f443 100644
--- a/libcxx/modules/std/barrier.inc
+++ b/libcxx/modules/std/barrier.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
+_LIBCPP_MODULE_EXPORT namespace std {
#ifndef _LIBCPP_HAS_NO_THREADS
using std::barrier;
#endif // _LIBCPP_HAS_NO_THREADS
diff --git a/libcxx/modules/std/bit.inc b/libcxx/modules/std/bit.inc
index 027a6c17ad6a6..469948b6875c4 100644
--- a/libcxx/modules/std/bit.inc
+++ b/libcxx/modules/std/bit.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
+_LIBCPP_MODULE_EXPORT namespace std {
// [bit.cast], bit_cast
using std::bit_cast;
diff --git a/libcxx/modules/std/bitset.inc b/libcxx/modules/std/bitset.inc
index bb528860eb561..7416acf8fbcf2 100644
--- a/libcxx/modules/std/bitset.inc
+++ b/libcxx/modules/std/bitset.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
+_LIBCPP_MODULE_EXPORT namespace std {
using std::bitset;
// [bitset.operators], bitset operators
diff --git a/libcxx/modules/std/cassert.inc b/libcxx/modules/std/cassert.inc
index 2ab8eb970e7a5..929fc550423cd 100644
--- a/libcxx/modules/std/cassert.inc
+++ b/libcxx/modules/std/cassert.inc
@@ -7,6 +7,6 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
+_LIBCPP_MODULE_EXPORT namespace std {
// This module exports nothing.
} // namespace std
diff --git a/libcxx/modules/std/cctype.inc b/libcxx/modules/std/cctype.inc
index 43417aa159624..6e8f362f3ef3d 100644
--- a/libcxx/modules/std/cctype.inc
+++ b/libcxx/modules/std/cctype.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
+_LIBCPP_MODULE_EXPORT namespace std {
using std::isalnum _LIBCPP_USING_IF_EXISTS;
using std::isalpha _LIBCPP_USING_IF_EXISTS;
using std::isblank _LIBCPP_USING_IF_EXISTS;
diff --git a/libcxx/modules/std/cerrno.inc b/libcxx/modules/std/cerrno.inc
index 2ab8eb970e7a5..929fc550423cd 100644
--- a/libcxx/modules/std/cerrno.inc
+++ b/libcxx/modules/std/cerrno.inc
@@ -7,6 +7,6 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
+_LIBCPP_MODULE_EXPORT namespace std {
// This module exports nothing.
} // namespace std
diff --git a/libcxx/modules/std/cfenv.inc b/libcxx/modules/std/cfenv.inc
index 831c1fed8ebef..f125817fa834a 100644
--- a/libcxx/modules/std/cfenv.inc
+++ b/libcxx/modules/std/cfenv.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
+_LIBCPP_MODULE_EXPORT namespace std {
// types
using std::fenv_t _LIBCPP_USING_IF_EXISTS;
using std::fexcept_t _LIBCPP_USING_IF_EXISTS;
diff --git a/libcxx/modules/std/cfloat.inc b/libcxx/modules/std/cfloat.inc
index 2ab8eb970e7a5..929fc550423cd 100644
--- a/libcxx/modules/std/cfloat.inc
+++ b/libcxx/modules/std/cfloat.inc
@@ -7,6 +7,6 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
+_LIBCPP_MODULE_EXPORT namespace std {
// This module exports nothing.
} // namespace std
diff --git a/libcxx/modules/std/charconv.inc b/libcxx/modules/std/charconv.inc
index 6fee460108d65..f1a3f22d889d7 100644
--- a/libcxx/modules/std/charconv.inc
+++ b/libcxx/modules/std/charconv.inc
@@ -7,8 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
-
+_LIBCPP_MODULE_EXPORT namespace std {
// floating-point format for primitive numerical conversion
using std::chars_format;
diff --git a/libcxx/modules/std/chrono.inc b/libcxx/modules/std/chrono.inc
index 813322a1797f6..ba9d0eaf70ba5 100644
--- a/libcxx/modules/std/chrono.inc
+++ b/libcxx/modules/std/chrono.inc
@@ -7,8 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
-
+_LIBCPP_MODULE_EXPORT namespace std {
namespace chrono {
using std::chrono::duration;
using std::chrono::time_point;
@@ -292,7 +291,7 @@ export namespace std {
} // namespace chrono
} // namespace std
-export namespace std::inline literals::inline chrono_literals {
+_LIBCPP_MODULE_EXPORT namespace std::inline literals::inline chrono_literals {
// [time.duration.literals], suffixes for duration literals
using std::literals::chrono_literals::operator""h;
using std::literals::chrono_literals::operator""min;
diff --git a/libcxx/modules/std/cinttypes.inc b/libcxx/modules/std/cinttypes.inc
index b2b98c973e982..5c18fd5860e29 100644
--- a/libcxx/modules/std/cinttypes.inc
+++ b/libcxx/modules/std/cinttypes.inc
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-export namespace std {
+_LIBCPP_MODULE_EXPORT namespace std {
using std::imaxdiv_t _LIBCPP_USING_IF_EXISTS;
using std::imaxabs _LIBCPP_USING_IF_EXISTS;
diff --git a/libcxx/modules/std/climits.inc b/libcxx/modules/std/climits.inc
index 2ab8eb970e7a5..929fc550423cd 100644
--- a/libcxx/modules/std/climits.inc...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/92747
More information about the libcxx-commits
mailing list