From 73e86db88731f24f6442dc5527e37d8f8057eff5 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Tue, 7 May 2024 20:24:11 +0200 Subject: [PATCH] [libc++][modules] Attach declarations to the global module. 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. --- libcxx/include/__config | 11 +++++++++++ libcxx/modules/std.compat/cassert.inc | 4 ++-- libcxx/modules/std.compat/cctype.inc | 4 ++-- libcxx/modules/std.compat/cerrno.inc | 4 ++-- libcxx/modules/std.compat/cfenv.inc | 4 ++-- libcxx/modules/std.compat/cfloat.inc | 4 ++-- libcxx/modules/std.compat/cinttypes.inc | 4 ++-- libcxx/modules/std.compat/climits.inc | 4 ++-- libcxx/modules/std.compat/clocale.inc | 4 ++-- libcxx/modules/std.compat/cmath.inc | 4 ++-- libcxx/modules/std.compat/csetjmp.inc | 4 ++-- libcxx/modules/std.compat/csignal.inc | 4 ++-- libcxx/modules/std.compat/cstdarg.inc | 2 +- libcxx/modules/std.compat/cstddef.inc | 4 ++-- libcxx/modules/std.compat/cstdint.inc | 4 ++-- libcxx/modules/std.compat/cstdio.inc | 4 ++-- libcxx/modules/std.compat/cstdlib.inc | 4 ++-- libcxx/modules/std.compat/cstring.inc | 4 ++-- libcxx/modules/std.compat/ctime.inc | 4 ++-- libcxx/modules/std.compat/cuchar.inc | 4 ++-- libcxx/modules/std.compat/cwchar.inc | 4 ++-- libcxx/modules/std.compat/cwctype.inc | 4 ++-- libcxx/modules/std/algorithm.inc | 2 +- libcxx/modules/std/any.inc | 3 +-- libcxx/modules/std/array.inc | 3 +-- libcxx/modules/std/atomic.inc | 3 +-- libcxx/modules/std/barrier.inc | 2 +- libcxx/modules/std/bit.inc | 2 +- libcxx/modules/std/bitset.inc | 2 +- libcxx/modules/std/cassert.inc | 2 +- libcxx/modules/std/cctype.inc | 2 +- libcxx/modules/std/cerrno.inc | 2 +- libcxx/modules/std/cfenv.inc | 2 +- libcxx/modules/std/cfloat.inc | 2 +- libcxx/modules/std/charconv.inc | 3 +-- libcxx/modules/std/chrono.inc | 5 ++--- libcxx/modules/std/cinttypes.inc | 2 +- libcxx/modules/std/climits.inc | 2 +- libcxx/modules/std/clocale.inc | 2 +- libcxx/modules/std/cmath.inc | 3 +-- libcxx/modules/std/codecvt.inc | 2 +- libcxx/modules/std/compare.inc | 3 +-- libcxx/modules/std/complex.inc | 3 +-- libcxx/modules/std/concepts.inc | 3 +-- libcxx/modules/std/condition_variable.inc | 2 +- libcxx/modules/std/coroutine.inc | 3 +-- libcxx/modules/std/csetjmp.inc | 2 +- libcxx/modules/std/csignal.inc | 2 +- libcxx/modules/std/cstdarg.inc | 4 +--- libcxx/modules/std/cstddef.inc | 2 +- libcxx/modules/std/cstdint.inc | 2 +- libcxx/modules/std/cstdio.inc | 2 +- libcxx/modules/std/cstdlib.inc | 2 +- libcxx/modules/std/cstring.inc | 2 +- libcxx/modules/std/ctime.inc | 2 +- libcxx/modules/std/cuchar.inc | 2 +- libcxx/modules/std/cwchar.inc | 2 +- libcxx/modules/std/cwctype.inc | 2 +- libcxx/modules/std/deque.inc | 2 +- libcxx/modules/std/exception.inc | 2 +- libcxx/modules/std/execution.inc | 4 ++-- libcxx/modules/std/expected.inc | 2 +- libcxx/modules/std/filesystem.inc | 8 +++----- libcxx/modules/std/flat_map.inc | 2 +- libcxx/modules/std/flat_set.inc | 2 +- libcxx/modules/std/format.inc | 2 +- libcxx/modules/std/forward_list.inc | 2 +- libcxx/modules/std/fstream.inc | 2 +- libcxx/modules/std/functional.inc | 2 +- libcxx/modules/std/future.inc | 2 +- libcxx/modules/std/generator.inc | 2 +- libcxx/modules/std/hazard_pointer.inc | 2 +- libcxx/modules/std/initializer_list.inc | 2 +- libcxx/modules/std/iomanip.inc | 2 +- libcxx/modules/std/ios.inc | 2 +- libcxx/modules/std/iosfwd.inc | 2 +- libcxx/modules/std/iostream.inc | 2 +- libcxx/modules/std/istream.inc | 2 +- libcxx/modules/std/iterator.inc | 2 +- libcxx/modules/std/latch.inc | 2 +- libcxx/modules/std/limits.inc | 2 +- libcxx/modules/std/list.inc | 2 +- libcxx/modules/std/locale.inc | 2 +- libcxx/modules/std/map.inc | 2 +- libcxx/modules/std/mdspan.inc | 2 +- libcxx/modules/std/memory.inc | 2 +- libcxx/modules/std/memory_resource.inc | 2 +- libcxx/modules/std/mutex.inc | 2 +- libcxx/modules/std/new.inc | 6 +++--- libcxx/modules/std/numbers.inc | 2 +- libcxx/modules/std/numeric.inc | 2 +- libcxx/modules/std/optional.inc | 2 +- libcxx/modules/std/ostream.inc | 2 +- libcxx/modules/std/print.inc | 2 +- libcxx/modules/std/queue.inc | 2 +- libcxx/modules/std/random.inc | 2 +- libcxx/modules/std/ranges.inc | 2 +- libcxx/modules/std/ratio.inc | 2 +- libcxx/modules/std/rcu.inc | 2 +- libcxx/modules/std/regex.inc | 2 +- libcxx/modules/std/scoped_allocator.inc | 2 +- libcxx/modules/std/semaphore.inc | 2 +- libcxx/modules/std/set.inc | 2 +- libcxx/modules/std/shared_mutex.inc | 2 +- libcxx/modules/std/source_location.inc | 4 +--- libcxx/modules/std/span.inc | 2 +- libcxx/modules/std/spanstream.inc | 2 +- libcxx/modules/std/sstream.inc | 2 +- libcxx/modules/std/stack.inc | 2 +- libcxx/modules/std/stacktrace.inc | 2 +- libcxx/modules/std/stdexcept.inc | 2 +- libcxx/modules/std/stdfloat.inc | 2 +- libcxx/modules/std/stop_token.inc | 2 +- libcxx/modules/std/streambuf.inc | 2 +- libcxx/modules/std/string.inc | 2 +- libcxx/modules/std/string_view.inc | 2 +- libcxx/modules/std/strstream.inc | 2 +- libcxx/modules/std/syncstream.inc | 2 +- libcxx/modules/std/system_error.inc | 2 +- libcxx/modules/std/text_encoding.inc | 2 +- libcxx/modules/std/thread.inc | 2 +- libcxx/modules/std/tuple.inc | 2 +- libcxx/modules/std/type_traits.inc | 2 +- libcxx/modules/std/typeindex.inc | 2 +- libcxx/modules/std/typeinfo.inc | 2 +- libcxx/modules/std/unordered_map.inc | 2 +- libcxx/modules/std/unordered_set.inc | 2 +- libcxx/modules/std/utility.inc | 2 +- libcxx/modules/std/valarray.inc | 2 +- libcxx/modules/std/variant.inc | 2 +- libcxx/modules/std/vector.inc | 2 +- libcxx/modules/std/version.inc | 2 +- .../header_exportable_declarations.cpp | 9 ++++++++- libcxx/utils/libcxx/test/modules.py | 3 +++ 134 files changed, 179 insertions(+), 174 deletions(-) diff --git a/libcxx/include/__config b/libcxx/include/__config index 104a244cc82cc4..865ebb0f6fbf61 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -837,6 +837,17 @@ 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. +# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 1700 +// Clang-17 does not support extern "C++" export +# define _LIBCPP_MODULE_EXPORT export +# else +# define _LIBCPP_MODULE_EXPORT extern "C++" export +# endif + # 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 ac0533d14e9a9a..befbfc49ba4d4c 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 5cde12ddb38d78..34b0e55c243fff 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 ac0533d14e9a9a..befbfc49ba4d4c 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 5a373f64697120..d2a484323d6caf 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 ac0533d14e9a9a..befbfc49ba4d4c 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 4789ec33102008..c6011f0ae22e1b 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 ac0533d14e9a9a..befbfc49ba4d4c 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 1a975c560a496d..2b0982ac61a2f0 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 6c86d0df574062..cd858968122b3a 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 53e1421a2fbdd0..94c698387ff9f3 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 bf72459df16535..8d83d2dcaf67d5 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 79b5df4ec99ced..e7aaddce6d6885 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 8704a31e01f326..f7f4c5e993dca0 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 a8dd6898cb266f..5edddde004d2d4 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 33dd2cbfb0d7c3..4dc19dc1936679 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 94f5e7e8d7f451..52414334c33d35 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 5029a7674bb210..fbc59d5b120c01 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 eba8234a08969e..af2d8043c31977 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 d1a511cadef184..d14307d47c48d3 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 4cad9281fb49a2..21bd1c29ff5710 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 8d06eaa379eaa2..28f58733f1261d 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 e7796bfa26af81..71a7788d209bb9 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 c57257ede84909..1430e76623eb6f 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 d55779c8bd128b..180fcfed6120ec 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 d77d7a5bb0fbc1..2513aa527d28b0 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 dadb67f7ef3301..3ad2e87c7f4432 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 027a6c17ad6a6b..469948b6875c43 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 bb528860eb5617..7416acf8fbcf2b 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 2ab8eb970e7a5e..929fc550423cd2 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 43417aa159624c..6e8f362f3ef3d9 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 2ab8eb970e7a5e..929fc550423cd2 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 831c1fed8ebefb..f125817fa834a8 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 2ab8eb970e7a5e..929fc550423cd2 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 6fee460108d65c..f1a3f22d889d77 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 813322a1797f6a..ba9d0eaf70ba57 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 b2b98c973e9826..5c18fd5860e297 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 2ab8eb970e7a5e..929fc550423cd2 100644 --- a/libcxx/modules/std/climits.inc +++ b/libcxx/modules/std/climits.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/clocale.inc b/libcxx/modules/std/clocale.inc index 359868a61eb9d7..25e27e01304166 100644 --- a/libcxx/modules/std/clocale.inc +++ b/libcxx/modules/std/clocale.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::lconv _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/modules/std/cmath.inc b/libcxx/modules/std/cmath.inc index a463c1e3ccf861..e80b4683f2afc2 100644 --- a/libcxx/modules/std/cmath.inc +++ b/libcxx/modules/std/cmath.inc @@ -7,8 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { - +_LIBCPP_MODULE_EXPORT namespace std { using std::double_t _LIBCPP_USING_IF_EXISTS; using std::float_t _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/modules/std/codecvt.inc b/libcxx/modules/std/codecvt.inc index 277ef046349a9e..8f15668559a9fe 100644 --- a/libcxx/modules/std/codecvt.inc +++ b/libcxx/modules/std/codecvt.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION # if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT) using std::codecvt_mode; diff --git a/libcxx/modules/std/compare.inc b/libcxx/modules/std/compare.inc index 9d002d301efc3c..95aefd8352edbb 100644 --- a/libcxx/modules/std/compare.inc +++ b/libcxx/modules/std/compare.inc @@ -7,8 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { - +_LIBCPP_MODULE_EXPORT namespace std { // [cmp.categories], comparison category types using std::partial_ordering; using std::strong_ordering; diff --git a/libcxx/modules/std/complex.inc b/libcxx/modules/std/complex.inc index 47a44420b127a9..4a97e784d706ba 100644 --- a/libcxx/modules/std/complex.inc +++ b/libcxx/modules/std/complex.inc @@ -7,8 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { - +_LIBCPP_MODULE_EXPORT namespace std { // [complex], class template complex using std::complex; diff --git a/libcxx/modules/std/concepts.inc b/libcxx/modules/std/concepts.inc index 29f4e2788e9ab2..e2b414a9320786 100644 --- a/libcxx/modules/std/concepts.inc +++ b/libcxx/modules/std/concepts.inc @@ -7,8 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { - +_LIBCPP_MODULE_EXPORT namespace std { // [concepts.lang], language-related concepts // [concept.same], concept same_as using std::same_as; diff --git a/libcxx/modules/std/condition_variable.inc b/libcxx/modules/std/condition_variable.inc index b428918f90603d..a0d90a9ab8fe4e 100644 --- a/libcxx/modules/std/condition_variable.inc +++ b/libcxx/modules/std/condition_variable.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_THREADS // [thread.condition.condvar], class condition_variable using std::condition_variable; diff --git a/libcxx/modules/std/coroutine.inc b/libcxx/modules/std/coroutine.inc index 5d992f29a1e2ed..e6ccdc749a6a7b 100644 --- a/libcxx/modules/std/coroutine.inc +++ b/libcxx/modules/std/coroutine.inc @@ -7,8 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { - +_LIBCPP_MODULE_EXPORT namespace std { // [coroutine.traits], coroutine traits using std::coroutine_traits; diff --git a/libcxx/modules/std/csetjmp.inc b/libcxx/modules/std/csetjmp.inc index 8aa2e232929153..08c1e188528248 100644 --- a/libcxx/modules/std/csetjmp.inc +++ b/libcxx/modules/std/csetjmp.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::jmp_buf _LIBCPP_USING_IF_EXISTS; using std::longjmp _LIBCPP_USING_IF_EXISTS; } // namespace std diff --git a/libcxx/modules/std/csignal.inc b/libcxx/modules/std/csignal.inc index 05f3986866c7be..a574277a7b282c 100644 --- a/libcxx/modules/std/csignal.inc +++ b/libcxx/modules/std/csignal.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::sig_atomic_t _LIBCPP_USING_IF_EXISTS; // [support.signal], signal handlers diff --git a/libcxx/modules/std/cstdarg.inc b/libcxx/modules/std/cstdarg.inc index 5947bc2452b711..2821cb8b4ca18f 100644 --- a/libcxx/modules/std/cstdarg.inc +++ b/libcxx/modules/std/cstdarg.inc @@ -7,6 +7,4 @@ // //===----------------------------------------------------------------------===// -export namespace std { - using std::va_list _LIBCPP_USING_IF_EXISTS; -} // namespace std +_LIBCPP_MODULE_EXPORT namespace std { using std::va_list _LIBCPP_USING_IF_EXISTS; } // namespace std diff --git a/libcxx/modules/std/cstddef.inc b/libcxx/modules/std/cstddef.inc index 6443de89238239..d2713d102550b3 100644 --- a/libcxx/modules/std/cstddef.inc +++ b/libcxx/modules/std/cstddef.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::max_align_t _LIBCPP_USING_IF_EXISTS; using std::nullptr_t; using std::ptrdiff_t _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/modules/std/cstdint.inc b/libcxx/modules/std/cstdint.inc index f23b52a94526eb..a8d5371f599699 100644 --- a/libcxx/modules/std/cstdint.inc +++ b/libcxx/modules/std/cstdint.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // signed using std::int8_t _LIBCPP_USING_IF_EXISTS; using std::int16_t _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/modules/std/cstdio.inc b/libcxx/modules/std/cstdio.inc index 62fa2f566a5f62..e07f717c040da1 100644 --- a/libcxx/modules/std/cstdio.inc +++ b/libcxx/modules/std/cstdio.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::FILE _LIBCPP_USING_IF_EXISTS; using std::fpos_t _LIBCPP_USING_IF_EXISTS; using std::size_t _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/modules/std/cstdlib.inc b/libcxx/modules/std/cstdlib.inc index 617cf3ff3ef6b7..8527fe03dc82d1 100644 --- a/libcxx/modules/std/cstdlib.inc +++ b/libcxx/modules/std/cstdlib.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::div_t _LIBCPP_USING_IF_EXISTS; using std::ldiv_t _LIBCPP_USING_IF_EXISTS; using std::lldiv_t _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/modules/std/cstring.inc b/libcxx/modules/std/cstring.inc index 9ad33b982b32af..d10284dcdd2d43 100644 --- a/libcxx/modules/std/cstring.inc +++ b/libcxx/modules/std/cstring.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::size_t _LIBCPP_USING_IF_EXISTS; using std::memchr _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/modules/std/ctime.inc b/libcxx/modules/std/ctime.inc index 5bfa61917e5f20..993828a4591a8d 100644 --- a/libcxx/modules/std/ctime.inc +++ b/libcxx/modules/std/ctime.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::clock_t _LIBCPP_USING_IF_EXISTS; using std::size_t _LIBCPP_USING_IF_EXISTS; using std::time_t _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/modules/std/cuchar.inc b/libcxx/modules/std/cuchar.inc index fd80110d11ee84..979a4e68d28a4b 100644 --- a/libcxx/modules/std/cuchar.inc +++ b/libcxx/modules/std/cuchar.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // Note the Standard does not mark these symbols optional, but libc++'s header // does. So this seems strictly not to be conforming. diff --git a/libcxx/modules/std/cwchar.inc b/libcxx/modules/std/cwchar.inc index 02b1713359b6aa..7adc25fa4b9076 100644 --- a/libcxx/modules/std/cwchar.inc +++ b/libcxx/modules/std/cwchar.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS using std::mbstate_t _LIBCPP_USING_IF_EXISTS; using std::size_t _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/modules/std/cwctype.inc b/libcxx/modules/std/cwctype.inc index 30e526aae0af6f..9e2aa250c7bc89 100644 --- a/libcxx/modules/std/cwctype.inc +++ b/libcxx/modules/std/cwctype.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS using std::wctrans_t _LIBCPP_USING_IF_EXISTS; using std::wctype_t _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/modules/std/deque.inc b/libcxx/modules/std/deque.inc index 5abf88816a98ad..842fa4aea2f195 100644 --- a/libcxx/modules/std/deque.inc +++ b/libcxx/modules/std/deque.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [deque], class template deque using std::deque; diff --git a/libcxx/modules/std/exception.inc b/libcxx/modules/std/exception.inc index 8e802c7065e0f5..77158097c777dc 100644 --- a/libcxx/modules/std/exception.inc +++ b/libcxx/modules/std/exception.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::bad_exception; using std::current_exception; using std::exception; diff --git a/libcxx/modules/std/execution.inc b/libcxx/modules/std/execution.inc index 86c1cd7622b9b8..4d318174f68bfa 100644 --- a/libcxx/modules/std/execution.inc +++ b/libcxx/modules/std/execution.inc @@ -8,13 +8,13 @@ //===----------------------------------------------------------------------===// #ifdef _LIBCPP_ENABLE_EXPERIMENTAL -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [execpol.type], execution policy type trait using std::is_execution_policy; using std::is_execution_policy_v; } // namespace std -export namespace std::execution { +_LIBCPP_MODULE_EXPORT namespace std::execution { // [execpol.seq], sequenced execution policy using std::execution::sequenced_policy; diff --git a/libcxx/modules/std/expected.inc b/libcxx/modules/std/expected.inc index c21683cb90d634..e519d67d6902ae 100644 --- a/libcxx/modules/std/expected.inc +++ b/libcxx/modules/std/expected.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if _LIBCPP_STD_VER >= 23 // [expected.unexpected], class template unexpected using std::unexpected; diff --git a/libcxx/modules/std/filesystem.inc b/libcxx/modules/std/filesystem.inc index 3214b49fe8d823..d2c34144127353 100644 --- a/libcxx/modules/std/filesystem.inc +++ b/libcxx/modules/std/filesystem.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std::filesystem { +_LIBCPP_MODULE_EXPORT namespace std::filesystem { // [fs.class.path], paths using std::filesystem::path; @@ -109,11 +109,9 @@ export namespace std::filesystem { } // namespace std::filesystem // [fs.path.hash], hash support -export namespace std { - using std::hash; -} +_LIBCPP_MODULE_EXPORT namespace std { using std::hash; } -export namespace std::ranges { +_LIBCPP_MODULE_EXPORT namespace std::ranges { #ifndef _LIBCPP_HAS_NO_FILESYSTEM using std::ranges::enable_borrowed_range; using std::ranges::enable_view; diff --git a/libcxx/modules/std/flat_map.inc b/libcxx/modules/std/flat_map.inc index 83cd20ad618946..5758ecf9ea6690 100644 --- a/libcxx/modules/std/flat_map.inc +++ b/libcxx/modules/std/flat_map.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if 0 // [flat.map], class template flat_­map using std::flat_map; diff --git a/libcxx/modules/std/flat_set.inc b/libcxx/modules/std/flat_set.inc index a86cc1eae02a62..1b4f004bdc00f1 100644 --- a/libcxx/modules/std/flat_set.inc +++ b/libcxx/modules/std/flat_set.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if 0 // [flat.set], class template flat_­set using std::flat_set; diff --git a/libcxx/modules/std/format.inc b/libcxx/modules/std/format.inc index 743a43811005a4..9c3a1a5dd9b8de 100644 --- a/libcxx/modules/std/format.inc +++ b/libcxx/modules/std/format.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [format.context], class template basic_format_context using std::basic_format_context; using std::format_context; diff --git a/libcxx/modules/std/forward_list.inc b/libcxx/modules/std/forward_list.inc index c9585b5523b369..5fd970240f4dce 100644 --- a/libcxx/modules/std/forward_list.inc +++ b/libcxx/modules/std/forward_list.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [forward.list], class template forward_list using std::forward_list; diff --git a/libcxx/modules/std/fstream.inc b/libcxx/modules/std/fstream.inc index b0017949af5403..27c27e82646cef 100644 --- a/libcxx/modules/std/fstream.inc +++ b/libcxx/modules/std/fstream.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::basic_filebuf; diff --git a/libcxx/modules/std/functional.inc b/libcxx/modules/std/functional.inc index ddc7d023ee6dc2..0e2a27f31e6889 100644 --- a/libcxx/modules/std/functional.inc +++ b/libcxx/modules/std/functional.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [func.invoke], invoke using std::invoke; #if _LIBCPP_STD_VER >= 23 diff --git a/libcxx/modules/std/future.inc b/libcxx/modules/std/future.inc index 2500ad1dee2740..a186ca470be868 100644 --- a/libcxx/modules/std/future.inc +++ b/libcxx/modules/std/future.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_THREADS using std::future_errc; using std::future_status; diff --git a/libcxx/modules/std/generator.inc b/libcxx/modules/std/generator.inc index 43fb0daf5c6593..5ca3eb304d33c4 100644 --- a/libcxx/modules/std/generator.inc +++ b/libcxx/modules/std/generator.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if 0 using std::generator; #endif diff --git a/libcxx/modules/std/hazard_pointer.inc b/libcxx/modules/std/hazard_pointer.inc index e56f4d0bf43630..53381fbb55af55 100644 --- a/libcxx/modules/std/hazard_pointer.inc +++ b/libcxx/modules/std/hazard_pointer.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if 0 # if _LIBCPP_STD_VER >= 23 // 4.1.3, class template hazard_pointer_obj_base diff --git a/libcxx/modules/std/initializer_list.inc b/libcxx/modules/std/initializer_list.inc index 1dbeb220ca3c5f..e22c2c728c3073 100644 --- a/libcxx/modules/std/initializer_list.inc +++ b/libcxx/modules/std/initializer_list.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::initializer_list; // [support.initlist.range], initializer list range access diff --git a/libcxx/modules/std/iomanip.inc b/libcxx/modules/std/iomanip.inc index 35a52efcd20b0b..1ac3a59b5c2b1c 100644 --- a/libcxx/modules/std/iomanip.inc +++ b/libcxx/modules/std/iomanip.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::get_money; using std::get_time; diff --git a/libcxx/modules/std/ios.inc b/libcxx/modules/std/ios.inc index eeed5398c5a684..e6fed28da27a98 100644 --- a/libcxx/modules/std/ios.inc +++ b/libcxx/modules/std/ios.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::fpos; // based on [tab:fpos.operations] diff --git a/libcxx/modules/std/iosfwd.inc b/libcxx/modules/std/iosfwd.inc index 090d990d061e5e..b39937a67e5f22 100644 --- a/libcxx/modules/std/iosfwd.inc +++ b/libcxx/modules/std/iosfwd.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::streampos; #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS using std::wstreampos; diff --git a/libcxx/modules/std/iostream.inc b/libcxx/modules/std/iostream.inc index d6e20364960575..62b71baabf1052 100644 --- a/libcxx/modules/std/iostream.inc +++ b/libcxx/modules/std/iostream.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::cerr; using std::cin; diff --git a/libcxx/modules/std/istream.inc b/libcxx/modules/std/istream.inc index fdb1854014036f..9d868c3e4b43cb 100644 --- a/libcxx/modules/std/istream.inc +++ b/libcxx/modules/std/istream.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::basic_istream; diff --git a/libcxx/modules/std/iterator.inc b/libcxx/modules/std/iterator.inc index 10c63d74e6e05e..5c85b84d94beaf 100644 --- a/libcxx/modules/std/iterator.inc +++ b/libcxx/modules/std/iterator.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [iterator.assoc.types], associated types // [incrementable.traits], incrementable traits using std::incrementable_traits; diff --git a/libcxx/modules/std/latch.inc b/libcxx/modules/std/latch.inc index 922a55e038ec37..856f83b9241102 100644 --- a/libcxx/modules/std/latch.inc +++ b/libcxx/modules/std/latch.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_THREADS using std::latch; #endif // _LIBCPP_HAS_NO_THREADS diff --git a/libcxx/modules/std/limits.inc b/libcxx/modules/std/limits.inc index 9aae993baa6f7e..c467732509e367 100644 --- a/libcxx/modules/std/limits.inc +++ b/libcxx/modules/std/limits.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [fp.style], floating-point type properties using std::float_denorm_style; using std::float_round_style; diff --git a/libcxx/modules/std/list.inc b/libcxx/modules/std/list.inc index f38094c9b8a7c4..7ef738f09a3705 100644 --- a/libcxx/modules/std/list.inc +++ b/libcxx/modules/std/list.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [list], class template list using std::list; diff --git a/libcxx/modules/std/locale.inc b/libcxx/modules/std/locale.inc index 8975453864226b..688a3b61f58c11 100644 --- a/libcxx/modules/std/locale.inc +++ b/libcxx/modules/std/locale.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION // [locale], locale using std::has_facet; diff --git a/libcxx/modules/std/map.inc b/libcxx/modules/std/map.inc index ed154e3e8c6fd8..a9ebc9468afbae 100644 --- a/libcxx/modules/std/map.inc +++ b/libcxx/modules/std/map.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [map], class template map using std::map; diff --git a/libcxx/modules/std/mdspan.inc b/libcxx/modules/std/mdspan.inc index ba3f3926c3abdd..7f67231cd70a06 100644 --- a/libcxx/modules/std/mdspan.inc +++ b/libcxx/modules/std/mdspan.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if _LIBCPP_STD_VER >= 23 // [mdspan.extents], class template extents using std::extents; diff --git a/libcxx/modules/std/memory.inc b/libcxx/modules/std/memory.inc index b23c27707afd63..139a46c8db7304 100644 --- a/libcxx/modules/std/memory.inc +++ b/libcxx/modules/std/memory.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [pointer.traits], pointer traits using std::pointer_traits; diff --git a/libcxx/modules/std/memory_resource.inc b/libcxx/modules/std/memory_resource.inc index 740179baea273b..e4b6478358b0e8 100644 --- a/libcxx/modules/std/memory_resource.inc +++ b/libcxx/modules/std/memory_resource.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std::pmr { +_LIBCPP_MODULE_EXPORT namespace std::pmr { // [mem.res.class], class memory_resource using std::pmr::memory_resource; diff --git a/libcxx/modules/std/mutex.inc b/libcxx/modules/std/mutex.inc index 24c7f2e598a8bd..f52dc429aaf148 100644 --- a/libcxx/modules/std/mutex.inc +++ b/libcxx/modules/std/mutex.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_THREADS // [thread.mutex.class], class mutex using std::mutex; diff --git a/libcxx/modules/std/new.inc b/libcxx/modules/std/new.inc index 31c49057d0d286..2b4102751f6323 100644 --- a/libcxx/modules/std/new.inc +++ b/libcxx/modules/std/new.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [alloc.errors], storage allocation errors using std::bad_alloc; using std::bad_array_new_length; @@ -34,9 +34,9 @@ export namespace std { #endif } // namespace std -export { +_LIBCPP_MODULE_EXPORT { using ::operator new; using ::operator delete; using ::operator new[]; using ::operator delete[]; -} // export +} // _LIBCPP_MODULE_EXPORT diff --git a/libcxx/modules/std/numbers.inc b/libcxx/modules/std/numbers.inc index 2f55f442b18dcc..8bd362cecdbac6 100644 --- a/libcxx/modules/std/numbers.inc +++ b/libcxx/modules/std/numbers.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std::numbers { +_LIBCPP_MODULE_EXPORT namespace std::numbers { using std::numbers::e_v; using std::numbers::egamma_v; using std::numbers::inv_pi_v; diff --git a/libcxx/modules/std/numeric.inc b/libcxx/modules/std/numeric.inc index 3bc7b231681584..83189b19c6679f 100644 --- a/libcxx/modules/std/numeric.inc +++ b/libcxx/modules/std/numeric.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [accumulate], accumulate using std::accumulate; diff --git a/libcxx/modules/std/optional.inc b/libcxx/modules/std/optional.inc index 0f812bc0e24a47..f7cc865fcfbd8b 100644 --- a/libcxx/modules/std/optional.inc +++ b/libcxx/modules/std/optional.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [optional.optional], class template optional using std::optional; diff --git a/libcxx/modules/std/ostream.inc b/libcxx/modules/std/ostream.inc index 0e0e2d54fe6bae..6b75579639d224 100644 --- a/libcxx/modules/std/ostream.inc +++ b/libcxx/modules/std/ostream.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::basic_ostream; diff --git a/libcxx/modules/std/print.inc b/libcxx/modules/std/print.inc index 1ca52c70068872..2578c304428dbd 100644 --- a/libcxx/modules/std/print.inc +++ b/libcxx/modules/std/print.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if _LIBCPP_STD_VER >= 23 // [print.fun], print functions using std::print; diff --git a/libcxx/modules/std/queue.inc b/libcxx/modules/std/queue.inc index d2fb18709c7097..99c4f678b64986 100644 --- a/libcxx/modules/std/queue.inc +++ b/libcxx/modules/std/queue.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [queue], class template queue using std::queue; diff --git a/libcxx/modules/std/random.inc b/libcxx/modules/std/random.inc index 0b003fdd8902e4..65ea4a81782dda 100644 --- a/libcxx/modules/std/random.inc +++ b/libcxx/modules/std/random.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [rand.req.urng], uniform random bit generator requirements using std::uniform_random_bit_generator; diff --git a/libcxx/modules/std/ranges.inc b/libcxx/modules/std/ranges.inc index f71efe948ede10..e39798431dfa5d 100644 --- a/libcxx/modules/std/ranges.inc +++ b/libcxx/modules/std/ranges.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { namespace ranges { inline namespace __cpo { // [range.access], range access diff --git a/libcxx/modules/std/ratio.inc b/libcxx/modules/std/ratio.inc index 4e1d4c61e70721..dfa3e1984a8b7f 100644 --- a/libcxx/modules/std/ratio.inc +++ b/libcxx/modules/std/ratio.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [ratio.ratio], class template ratio using std::ratio; diff --git a/libcxx/modules/std/rcu.inc b/libcxx/modules/std/rcu.inc index abf5afad30c138..25c54f733641cf 100644 --- a/libcxx/modules/std/rcu.inc +++ b/libcxx/modules/std/rcu.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if 0 # if _LIBCPP_STD_VER >= 23 // 2.2.3, class template rcu_obj_base using std::rcu_obj_base; diff --git a/libcxx/modules/std/regex.inc b/libcxx/modules/std/regex.inc index 8217e34bc22c84..1e7c147fadc5ad 100644 --- a/libcxx/modules/std/regex.inc +++ b/libcxx/modules/std/regex.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION // [re.const], regex constants namespace regex_constants { diff --git a/libcxx/modules/std/scoped_allocator.inc b/libcxx/modules/std/scoped_allocator.inc index 91c9694db28f91..86c972fd3a11e7 100644 --- a/libcxx/modules/std/scoped_allocator.inc +++ b/libcxx/modules/std/scoped_allocator.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // class template scoped_allocator_adaptor using std::scoped_allocator_adaptor; diff --git a/libcxx/modules/std/semaphore.inc b/libcxx/modules/std/semaphore.inc index a8c8a1b6018e18..1526effdc37426 100644 --- a/libcxx/modules/std/semaphore.inc +++ b/libcxx/modules/std/semaphore.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_THREADS // [thread.sema.cnt], class template counting_semaphore using std::counting_semaphore; diff --git a/libcxx/modules/std/set.inc b/libcxx/modules/std/set.inc index a8db792b4b3815..bf2a1df6396b21 100644 --- a/libcxx/modules/std/set.inc +++ b/libcxx/modules/std/set.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [set], class template set using std::set; diff --git a/libcxx/modules/std/shared_mutex.inc b/libcxx/modules/std/shared_mutex.inc index 5f09446e38bc77..6f6720f5de7511 100644 --- a/libcxx/modules/std/shared_mutex.inc +++ b/libcxx/modules/std/shared_mutex.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_THREADS // [thread.sharedmutex.class], class shared_­mutex using std::shared_mutex; diff --git a/libcxx/modules/std/source_location.inc b/libcxx/modules/std/source_location.inc index 750ab164a38de1..f9262fa15990f4 100644 --- a/libcxx/modules/std/source_location.inc +++ b/libcxx/modules/std/source_location.inc @@ -7,6 +7,4 @@ // //===----------------------------------------------------------------------===// -export namespace std { - using std::source_location; -} // namespace std +_LIBCPP_MODULE_EXPORT namespace std { using std::source_location; } // namespace std diff --git a/libcxx/modules/std/span.inc b/libcxx/modules/std/span.inc index 184591c6b170d9..c7a49014944005 100644 --- a/libcxx/modules/std/span.inc +++ b/libcxx/modules/std/span.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // constants using std::dynamic_extent; diff --git a/libcxx/modules/std/spanstream.inc b/libcxx/modules/std/spanstream.inc index e6383a185e0798..fc98ab31397c16 100644 --- a/libcxx/modules/std/spanstream.inc +++ b/libcxx/modules/std/spanstream.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if 0 using std::basic_spanbuf; diff --git a/libcxx/modules/std/sstream.inc b/libcxx/modules/std/sstream.inc index 2218001290d0f0..bc5b29f8852395 100644 --- a/libcxx/modules/std/sstream.inc +++ b/libcxx/modules/std/sstream.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::basic_stringbuf; diff --git a/libcxx/modules/std/stack.inc b/libcxx/modules/std/stack.inc index 3f736ff0e84108..8fb4a631f397cb 100644 --- a/libcxx/modules/std/stack.inc +++ b/libcxx/modules/std/stack.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [stack], class template stack using std::stack; diff --git a/libcxx/modules/std/stacktrace.inc b/libcxx/modules/std/stacktrace.inc index c1184087c0df40..03ed2d09c46b07 100644 --- a/libcxx/modules/std/stacktrace.inc +++ b/libcxx/modules/std/stacktrace.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if 0 // [stacktrace.entry], class stacktrace_­entry using std::stacktrace_entry; diff --git a/libcxx/modules/std/stdexcept.inc b/libcxx/modules/std/stdexcept.inc index 15d37bafdba95c..e5c8e00131a2c0 100644 --- a/libcxx/modules/std/stdexcept.inc +++ b/libcxx/modules/std/stdexcept.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::domain_error; using std::invalid_argument; using std::length_error; diff --git a/libcxx/modules/std/stdfloat.inc b/libcxx/modules/std/stdfloat.inc index 7e7201a854154c..81a42eca190c65 100644 --- a/libcxx/modules/std/stdfloat.inc +++ b/libcxx/modules/std/stdfloat.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if defined(__STDCPP_FLOAT16_T__) using std::float16_t; #endif diff --git a/libcxx/modules/std/stop_token.inc b/libcxx/modules/std/stop_token.inc index ad2401747d61c6..548ac7181f6662 100644 --- a/libcxx/modules/std/stop_token.inc +++ b/libcxx/modules/std/stop_token.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_THREADS # ifdef _LIBCPP_ENABLE_EXPERIMENTAL // [stoptoken], class stop_­token diff --git a/libcxx/modules/std/streambuf.inc b/libcxx/modules/std/streambuf.inc index 32914cfe53687d..9abb05967aac26 100644 --- a/libcxx/modules/std/streambuf.inc +++ b/libcxx/modules/std/streambuf.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::basic_streambuf; using std::streambuf; diff --git a/libcxx/modules/std/string.inc b/libcxx/modules/std/string.inc index 9808a96215a182..a162f2c5ceed50 100644 --- a/libcxx/modules/std/string.inc +++ b/libcxx/modules/std/string.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [char.traits], character traits using std::char_traits; diff --git a/libcxx/modules/std/string_view.inc b/libcxx/modules/std/string_view.inc index f4f9d80ddb83da..0a7ef7bd0c2c38 100644 --- a/libcxx/modules/std/string_view.inc +++ b/libcxx/modules/std/string_view.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [string.view.template], class template basic_string_view using std::basic_string_view; diff --git a/libcxx/modules/std/strstream.inc b/libcxx/modules/std/strstream.inc index 808796701abaeb..7722799bbf057a 100644 --- a/libcxx/modules/std/strstream.inc +++ b/libcxx/modules/std/strstream.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_LOCALIZATION # if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM) using std::istrstream; diff --git a/libcxx/modules/std/syncstream.inc b/libcxx/modules/std/syncstream.inc index e3fb391b67c636..e2f645f65e7d79 100644 --- a/libcxx/modules/std/syncstream.inc +++ b/libcxx/modules/std/syncstream.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM) using std::basic_syncbuf; diff --git a/libcxx/modules/std/system_error.inc b/libcxx/modules/std/system_error.inc index cf553a5ee4a181..331f71d813c932 100644 --- a/libcxx/modules/std/system_error.inc +++ b/libcxx/modules/std/system_error.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::error_category; using std::generic_category; using std::system_category; diff --git a/libcxx/modules/std/text_encoding.inc b/libcxx/modules/std/text_encoding.inc index 6d5e3f1d68c605..58ec258989b8f0 100644 --- a/libcxx/modules/std/text_encoding.inc +++ b/libcxx/modules/std/text_encoding.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #if 0 # if _LIBCPP_STD_VER >= 23 using std::text_encoding; diff --git a/libcxx/modules/std/thread.inc b/libcxx/modules/std/thread.inc index 6504a39a7aeaee..9ea979a0bb0c2f 100644 --- a/libcxx/modules/std/thread.inc +++ b/libcxx/modules/std/thread.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { #ifndef _LIBCPP_HAS_NO_THREADS // [thread.thread.class], class thread using std::thread; diff --git a/libcxx/modules/std/tuple.inc b/libcxx/modules/std/tuple.inc index 706e2266c174b7..1bd909d9d8c4d8 100644 --- a/libcxx/modules/std/tuple.inc +++ b/libcxx/modules/std/tuple.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [tuple.tuple], class template tuple using std::tuple; diff --git a/libcxx/modules/std/type_traits.inc b/libcxx/modules/std/type_traits.inc index d368daf35ccb8c..8ccfd40d64c24a 100644 --- a/libcxx/modules/std/type_traits.inc +++ b/libcxx/modules/std/type_traits.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [meta.help], helper class using std::integral_constant; diff --git a/libcxx/modules/std/typeindex.inc b/libcxx/modules/std/typeindex.inc index 0fdcd8fb440f13..3019a9508a643b 100644 --- a/libcxx/modules/std/typeindex.inc +++ b/libcxx/modules/std/typeindex.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::hash; using std::type_index; } // namespace std diff --git a/libcxx/modules/std/typeinfo.inc b/libcxx/modules/std/typeinfo.inc index ee1273baf48965..949afaebb5c29f 100644 --- a/libcxx/modules/std/typeinfo.inc +++ b/libcxx/modules/std/typeinfo.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::bad_cast; using std::bad_typeid; using std::type_info; diff --git a/libcxx/modules/std/unordered_map.inc b/libcxx/modules/std/unordered_map.inc index eff62f30540a77..0f31935633e9a1 100644 --- a/libcxx/modules/std/unordered_map.inc +++ b/libcxx/modules/std/unordered_map.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [unord.map], class template unordered_­map using std::unordered_map; diff --git a/libcxx/modules/std/unordered_set.inc b/libcxx/modules/std/unordered_set.inc index c214e3420434b6..58d6d6a321b18b 100644 --- a/libcxx/modules/std/unordered_set.inc +++ b/libcxx/modules/std/unordered_set.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [unord.set], class template unordered_­set using std::unordered_set; diff --git a/libcxx/modules/std/utility.inc b/libcxx/modules/std/utility.inc index 77c21b87640dd4..9ce1957ef5c156 100644 --- a/libcxx/modules/std/utility.inc +++ b/libcxx/modules/std/utility.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [utility.swap], swap using std::swap; diff --git a/libcxx/modules/std/valarray.inc b/libcxx/modules/std/valarray.inc index 1cdf7f14060fb2..6be0915d860b8d 100644 --- a/libcxx/modules/std/valarray.inc +++ b/libcxx/modules/std/valarray.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { using std::gslice; using std::gslice_array; using std::indirect_array; diff --git a/libcxx/modules/std/variant.inc b/libcxx/modules/std/variant.inc index 6fcecddbedaf50..7583ffce882d0a 100644 --- a/libcxx/modules/std/variant.inc +++ b/libcxx/modules/std/variant.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [variant.variant], class template variant using std::variant; diff --git a/libcxx/modules/std/vector.inc b/libcxx/modules/std/vector.inc index 7168ec2bb70357..91063eb8d27c71 100644 --- a/libcxx/modules/std/vector.inc +++ b/libcxx/modules/std/vector.inc @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // [vector], class template vector using std::vector; diff --git a/libcxx/modules/std/version.inc b/libcxx/modules/std/version.inc index 2ab8eb970e7a5e..929fc550423cd2 100644 --- a/libcxx/modules/std/version.inc +++ b/libcxx/modules/std/version.inc @@ -7,6 +7,6 @@ // //===----------------------------------------------------------------------===// -export namespace std { +_LIBCPP_MODULE_EXPORT namespace std { // This module exports nothing. } // namespace std diff --git a/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp b/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp index 0a48f855fba069..a4fbcc1af49a62 100644 --- a/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp +++ b/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp @@ -261,10 +261,17 @@ void header_exportable_declarations::check(const clang::ast_matchers::MatchFinde return; // For modules only take the declarations exported. - if (is_module(file_type_)) + if (is_module(file_type_)) { if (decl->getModuleOwnershipKind() != clang::Decl::ModuleOwnershipKind::VisibleWhenImported) return; + // The named declarations included in the global module fragment are + // attached to the global module. The exported named declarations should + // also be attached to the global module. + if (!decl->getOwningModule()->isGlobalModule()) + return; + } + if (!is_valid_declaration_context(*decl, name, file_type_)) return; diff --git a/libcxx/utils/libcxx/test/modules.py b/libcxx/utils/libcxx/test/modules.py index aab7651c7bb039..fc78766aaa56ee 100644 --- a/libcxx/utils/libcxx/test/modules.py +++ b/libcxx/utils/libcxx/test/modules.py @@ -118,6 +118,9 @@ def write_lit_configuration(self): // The GCC compiler flags are not always compatible with clang-tidy. // UNSUPPORTED: gcc +// Clang 17 does not attach the declarations to the global module. +// UNSUPPORTED: clang-17 + // MODULE_DEPENDENCIES: {self.module} // RUN: echo -n > {self.tmp_prefix}.all_partitions