diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -302,7 +302,6 @@ __coroutine/trivial_awaitables.h __debug __debug_utils/randomize_range.h - __errc __exception/exception.h __exception/exception_ptr.h __exception/nested_exception.h @@ -589,6 +588,7 @@ __support/xlocale/__nop_locale_mgmt.h __support/xlocale/__posix_l_fallback.h __support/xlocale/__strtonum_fallback.h + __system_error/errc.h __thread/poll_with_backoff.h __thread/timed_backoff_policy.h __threading_support diff --git a/libcxx/include/__charconv/from_chars_integral.h b/libcxx/include/__charconv/from_chars_integral.h --- a/libcxx/include/__charconv/from_chars_integral.h +++ b/libcxx/include/__charconv/from_chars_integral.h @@ -14,8 +14,8 @@ #include <__charconv/from_chars_result.h> #include <__charconv/traits.h> #include <__config> -#include <__errc> #include <__memory/addressof.h> +#include <__system_error/errc.h> #include <__type_traits/enable_if.h> #include <__type_traits/integral_constant.h> #include <__type_traits/is_integral.h> diff --git a/libcxx/include/__charconv/from_chars_result.h b/libcxx/include/__charconv/from_chars_result.h --- a/libcxx/include/__charconv/from_chars_result.h +++ b/libcxx/include/__charconv/from_chars_result.h @@ -11,7 +11,7 @@ #define _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H #include <__config> -#include <__errc> +#include <__system_error/errc.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__charconv/to_chars_integral.h b/libcxx/include/__charconv/to_chars_integral.h --- a/libcxx/include/__charconv/to_chars_integral.h +++ b/libcxx/include/__charconv/to_chars_integral.h @@ -17,7 +17,7 @@ #include <__charconv/to_chars_result.h> #include <__charconv/traits.h> #include <__config> -#include <__errc> +#include <__system_error/errc.h> #include <__type_traits/enable_if.h> #include <__type_traits/integral_constant.h> #include <__type_traits/is_same.h> diff --git a/libcxx/include/__charconv/to_chars_result.h b/libcxx/include/__charconv/to_chars_result.h --- a/libcxx/include/__charconv/to_chars_result.h +++ b/libcxx/include/__charconv/to_chars_result.h @@ -11,7 +11,7 @@ #define _LIBCPP___CHARCONV_TO_CHARS_RESULT_H #include <__config> -#include <__errc> +#include <__system_error/errc.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__filesystem/directory_entry.h b/libcxx/include/__filesystem/directory_entry.h --- a/libcxx/include/__filesystem/directory_entry.h +++ b/libcxx/include/__filesystem/directory_entry.h @@ -13,7 +13,6 @@ #include <__availability> #include <__chrono/time_point.h> #include <__config> -#include <__errc> #include <__filesystem/file_status.h> #include <__filesystem/file_time_type.h> #include <__filesystem/file_type.h> @@ -21,6 +20,7 @@ #include <__filesystem/operations.h> #include <__filesystem/path.h> #include <__filesystem/perms.h> +#include <__system_error/errc.h> #include <__utility/unreachable.h> #include #include diff --git a/libcxx/include/__format/formatter_floating_point.h b/libcxx/include/__format/formatter_floating_point.h --- a/libcxx/include/__format/formatter_floating_point.h +++ b/libcxx/include/__format/formatter_floating_point.h @@ -22,7 +22,6 @@ #include <__concepts/arithmetic.h> #include <__concepts/same_as.h> #include <__config> -#include <__errc> #include <__format/concepts.h> #include <__format/format_parse_context.h> #include <__format/formatter.h> @@ -30,6 +29,7 @@ #include <__format/formatter_output.h> #include <__format/parser_std_format_spec.h> #include <__memory/allocator.h> +#include <__system_error/errc.h> #include <__type_traits/conditional.h> #include <__utility/move.h> #include <__utility/unreachable.h> diff --git a/libcxx/include/__format/formatter_integral.h b/libcxx/include/__format/formatter_integral.h --- a/libcxx/include/__format/formatter_integral.h +++ b/libcxx/include/__format/formatter_integral.h @@ -16,11 +16,11 @@ #include <__concepts/arithmetic.h> #include <__concepts/same_as.h> #include <__config> -#include <__errc> #include <__format/concepts.h> #include <__format/format_error.h> #include <__format/formatter_output.h> #include <__format/parser_std_format_spec.h> +#include <__system_error/errc.h> #include <__type_traits/make_unsigned.h> #include <__utility/unreachable.h> #include diff --git a/libcxx/include/__format/formatter_output.h b/libcxx/include/__format/formatter_output.h --- a/libcxx/include/__format/formatter_output.h +++ b/libcxx/include/__format/formatter_output.h @@ -19,7 +19,6 @@ #include <__chrono/statically_widen.h> #include <__concepts/same_as.h> #include <__config> -#include <__errc> #include <__format/buffer.h> #include <__format/concepts.h> #include <__format/escaped_output_table.h> @@ -29,6 +28,7 @@ #include <__iterator/back_insert_iterator.h> #include <__iterator/concepts.h> #include <__iterator/readable_traits.h> // iter_value_t +#include <__system_error/errc.h> #include <__type_traits/make_unsigned.h> #include <__utility/move.h> #include <__utility/unreachable.h> diff --git a/libcxx/include/__errc b/libcxx/include/__system_error/errc.h rename from libcxx/include/__errc rename to libcxx/include/__system_error/errc.h diff --git a/libcxx/include/charconv b/libcxx/include/charconv --- a/libcxx/include/charconv +++ b/libcxx/include/charconv @@ -80,7 +80,7 @@ #include <__charconv/traits.h> #include <__config> #include <__debug> -#include <__errc> +#include <__system_error/errc.h> #include // for log2f #include #include diff --git a/libcxx/include/libcxx.imp b/libcxx/include/libcxx.imp --- a/libcxx/include/libcxx.imp +++ b/libcxx/include/libcxx.imp @@ -41,6 +41,7 @@ { include: [ "@<__ranges/.*>", "private", "", "public" ] }, { include: [ "@<__string/.*>", "private", "", "public" ] }, { include: [ "@<__support/.*>", "private", "", "public" ] }, + { include: [ "@<__system_error/.*>", "private", "", "public" ] }, { include: [ "@<__thread/.*>", "private", "", "public" ] }, { include: [ "@<__tuple_dir/.*>", "private", "", "public" ] }, { include: [ "@<__type_traits/.*>", "private", "", "public" ] }, diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in --- a/libcxx/include/module.modulemap.in +++ b/libcxx/include/module.modulemap.in @@ -1434,6 +1434,10 @@ module system_error { header "system_error" export * + + module __system_error { + module errc { private header "__system_error/errc.h" } + } } module thread { @requires_LIBCXX_ENABLE_THREADS@ @@ -1699,7 +1703,6 @@ module __availability { private header "__availability" export * } module __bit_reference { private header "__bit_reference" export * } module __debug { header "__debug" export * } - module __errc { private header "__errc" export * } module __hash_table { header "__hash_table" export * } module __locale { @requires_LIBCXX_ENABLE_LOCALIZATION@ diff --git a/libcxx/include/system_error b/libcxx/include/system_error --- a/libcxx/include/system_error +++ b/libcxx/include/system_error @@ -146,10 +146,10 @@ #include <__assert> // all public C++ headers provide the assertion handler #include <__config> -#include <__errc> #include <__functional/hash.h> #include <__functional/unary_function.h> #include <__memory/addressof.h> +#include <__system_error/errc.h> #include #include #include diff --git a/libcxx/src/include/ryu/ryu.h b/libcxx/src/include/ryu/ryu.h --- a/libcxx/src/include/ryu/ryu.h +++ b/libcxx/src/include/ryu/ryu.h @@ -48,7 +48,7 @@ #include <__charconv/to_chars_result.h> #include <__config> #include <__debug> -#include <__errc> +#include <__system_error/errc.h> #include #include #include diff --git a/libcxx/test/libcxx/private_headers.verify.cpp b/libcxx/test/libcxx/private_headers.verify.cpp --- a/libcxx/test/libcxx/private_headers.verify.cpp +++ b/libcxx/test/libcxx/private_headers.verify.cpp @@ -334,7 +334,6 @@ #include <__coroutine/noop_coroutine_handle.h> // expected-error@*:* {{use of private header from outside its module: '__coroutine/noop_coroutine_handle.h'}} #include <__coroutine/trivial_awaitables.h> // expected-error@*:* {{use of private header from outside its module: '__coroutine/trivial_awaitables.h'}} #include <__debug_utils/randomize_range.h> // expected-error@*:* {{use of private header from outside its module: '__debug_utils/randomize_range.h'}} -#include <__errc> // expected-error@*:* {{use of private header from outside its module: '__errc'}} #include <__exception/exception.h> // expected-error@*:* {{use of private header from outside its module: '__exception/exception.h'}} #include <__exception/exception_ptr.h> // expected-error@*:* {{use of private header from outside its module: '__exception/exception_ptr.h'}} #include <__exception/nested_exception.h> // expected-error@*:* {{use of private header from outside its module: '__exception/nested_exception.h'}} @@ -604,6 +603,7 @@ #include <__string/char_traits.h> // expected-error@*:* {{use of private header from outside its module: '__string/char_traits.h'}} #include <__string/constexpr_c_functions.h> // expected-error@*:* {{use of private header from outside its module: '__string/constexpr_c_functions.h'}} #include <__string/extern_template_lists.h> // expected-error@*:* {{use of private header from outside its module: '__string/extern_template_lists.h'}} +#include <__system_error/errc.h> // expected-error@*:* {{use of private header from outside its module: '__system_error/errc.h'}} #include <__thread/poll_with_backoff.h> // expected-error@*:* {{use of private header from outside its module: '__thread/poll_with_backoff.h'}} #include <__thread/timed_backoff_policy.h> // expected-error@*:* {{use of private header from outside its module: '__thread/timed_backoff_policy.h'}} #include <__tuple_dir/apply_cv.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/apply_cv.h'}} diff --git a/libcxx/utils/data/ignore_format.txt b/libcxx/utils/data/ignore_format.txt --- a/libcxx/utils/data/ignore_format.txt +++ b/libcxx/utils/data/ignore_format.txt @@ -308,7 +308,6 @@ libcxx/include/__debug libcxx/include/__debug_utils/randomize_range.h libcxx/include/deque -libcxx/include/__errc libcxx/include/errno.h libcxx/include/execution libcxx/include/expected @@ -611,6 +610,7 @@ libcxx/include/__support/solaris/xlocale.h libcxx/include/__support/win32/locale_win32.h libcxx/include/__support/xlocale/__nop_locale_mgmt.h +libcxx/include/__system_error/errc.h libcxx/include/system_error libcxx/include/thread libcxx/include/__threading_support