aboutsummaryrefslogtreecommitdiff
path: root/lib/libcxx/include/__system_error
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-05-09 01:52:26 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-05-09 01:52:26 -0700
commitbcb534c295d5cc6fd63caa570cc08e6b148a507c (patch)
tree0b17cb1e632d894f50f25e550d5113f232b0e877 /lib/libcxx/include/__system_error
parentd9b00ee4ba48717ff6b306a6f9419e7b604ac04b (diff)
parent74f52954b9cb40d59d80b839b45bb859146731a7 (diff)
downloadzig-bcb534c295d5cc6fd63caa570cc08e6b148a507c.tar.gz
zig-bcb534c295d5cc6fd63caa570cc08e6b148a507c.zip
Merge branch 'llvm18'
Upgrades the LLVM, Clang, and LLD dependencies to LLVM 18.x Related to #16270
Diffstat (limited to 'lib/libcxx/include/__system_error')
-rw-r--r--lib/libcxx/include/__system_error/errc.h170
-rw-r--r--lib/libcxx/include/__system_error/error_code.h10
-rw-r--r--lib/libcxx/include/__system_error/error_condition.h10
-rw-r--r--lib/libcxx/include/__system_error/system_error.h12
4 files changed, 101 insertions, 101 deletions
diff --git a/lib/libcxx/include/__system_error/errc.h b/lib/libcxx/include/__system_error/errc.h
index 17bbe0e2af..f87df86a71 100644
--- a/lib/libcxx/include/__system_error/errc.h
+++ b/lib/libcxx/include/__system_error/errc.h
@@ -112,104 +112,102 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// Some error codes are not present on all platforms, so we provide equivalents
// for them:
-//enum class errc
-_LIBCPP_DECLARE_STRONG_ENUM(errc)
-{
- address_family_not_supported = EAFNOSUPPORT,
- address_in_use = EADDRINUSE,
- address_not_available = EADDRNOTAVAIL,
- already_connected = EISCONN,
- argument_list_too_long = E2BIG,
- argument_out_of_domain = EDOM,
- bad_address = EFAULT,
- bad_file_descriptor = EBADF,
- bad_message = EBADMSG,
- broken_pipe = EPIPE,
- connection_aborted = ECONNABORTED,
- connection_already_in_progress = EALREADY,
- connection_refused = ECONNREFUSED,
- connection_reset = ECONNRESET,
- cross_device_link = EXDEV,
- destination_address_required = EDESTADDRREQ,
- device_or_resource_busy = EBUSY,
- directory_not_empty = ENOTEMPTY,
- executable_format_error = ENOEXEC,
- file_exists = EEXIST,
- file_too_large = EFBIG,
- filename_too_long = ENAMETOOLONG,
- function_not_supported = ENOSYS,
- host_unreachable = EHOSTUNREACH,
- identifier_removed = EIDRM,
- illegal_byte_sequence = EILSEQ,
- inappropriate_io_control_operation = ENOTTY,
- interrupted = EINTR,
- invalid_argument = EINVAL,
- invalid_seek = ESPIPE,
- io_error = EIO,
- is_a_directory = EISDIR,
- message_size = EMSGSIZE,
- network_down = ENETDOWN,
- network_reset = ENETRESET,
- network_unreachable = ENETUNREACH,
- no_buffer_space = ENOBUFS,
- no_child_process = ECHILD,
- no_link = ENOLINK,
- no_lock_available = ENOLCK,
+// enum class errc
+_LIBCPP_DECLARE_STRONG_ENUM(errc){
+ address_family_not_supported = EAFNOSUPPORT,
+ address_in_use = EADDRINUSE,
+ address_not_available = EADDRNOTAVAIL,
+ already_connected = EISCONN,
+ argument_list_too_long = E2BIG,
+ argument_out_of_domain = EDOM,
+ bad_address = EFAULT,
+ bad_file_descriptor = EBADF,
+ bad_message = EBADMSG,
+ broken_pipe = EPIPE,
+ connection_aborted = ECONNABORTED,
+ connection_already_in_progress = EALREADY,
+ connection_refused = ECONNREFUSED,
+ connection_reset = ECONNRESET,
+ cross_device_link = EXDEV,
+ destination_address_required = EDESTADDRREQ,
+ device_or_resource_busy = EBUSY,
+ directory_not_empty = ENOTEMPTY,
+ executable_format_error = ENOEXEC,
+ file_exists = EEXIST,
+ file_too_large = EFBIG,
+ filename_too_long = ENAMETOOLONG,
+ function_not_supported = ENOSYS,
+ host_unreachable = EHOSTUNREACH,
+ identifier_removed = EIDRM,
+ illegal_byte_sequence = EILSEQ,
+ inappropriate_io_control_operation = ENOTTY,
+ interrupted = EINTR,
+ invalid_argument = EINVAL,
+ invalid_seek = ESPIPE,
+ io_error = EIO,
+ is_a_directory = EISDIR,
+ message_size = EMSGSIZE,
+ network_down = ENETDOWN,
+ network_reset = ENETRESET,
+ network_unreachable = ENETUNREACH,
+ no_buffer_space = ENOBUFS,
+ no_child_process = ECHILD,
+ no_link = ENOLINK,
+ no_lock_available = ENOLCK,
#ifdef ENODATA
- no_message_available = ENODATA,
+ no_message_available = ENODATA,
#else
- no_message_available = ENOMSG,
+ no_message_available = ENOMSG,
#endif
- no_message = ENOMSG,
- no_protocol_option = ENOPROTOOPT,
- no_space_on_device = ENOSPC,
+ no_message = ENOMSG,
+ no_protocol_option = ENOPROTOOPT,
+ no_space_on_device = ENOSPC,
#ifdef ENOSR
- no_stream_resources = ENOSR,
+ no_stream_resources = ENOSR,
#else
- no_stream_resources = ENOMEM,
+ no_stream_resources = ENOMEM,
#endif
- no_such_device_or_address = ENXIO,
- no_such_device = ENODEV,
- no_such_file_or_directory = ENOENT,
- no_such_process = ESRCH,
- not_a_directory = ENOTDIR,
- not_a_socket = ENOTSOCK,
+ no_such_device_or_address = ENXIO,
+ no_such_device = ENODEV,
+ no_such_file_or_directory = ENOENT,
+ no_such_process = ESRCH,
+ not_a_directory = ENOTDIR,
+ not_a_socket = ENOTSOCK,
#ifdef ENOSTR
- not_a_stream = ENOSTR,
+ not_a_stream = ENOSTR,
#else
- not_a_stream = EINVAL,
+ not_a_stream = EINVAL,
#endif
- not_connected = ENOTCONN,
- not_enough_memory = ENOMEM,
- not_supported = ENOTSUP,
- operation_canceled = ECANCELED,
- operation_in_progress = EINPROGRESS,
- operation_not_permitted = EPERM,
- operation_not_supported = EOPNOTSUPP,
- operation_would_block = EWOULDBLOCK,
- owner_dead = EOWNERDEAD,
- permission_denied = EACCES,
- protocol_error = EPROTO,
- protocol_not_supported = EPROTONOSUPPORT,
- read_only_file_system = EROFS,
- resource_deadlock_would_occur = EDEADLK,
- resource_unavailable_try_again = EAGAIN,
- result_out_of_range = ERANGE,
- state_not_recoverable = ENOTRECOVERABLE,
+ not_connected = ENOTCONN,
+ not_enough_memory = ENOMEM,
+ not_supported = ENOTSUP,
+ operation_canceled = ECANCELED,
+ operation_in_progress = EINPROGRESS,
+ operation_not_permitted = EPERM,
+ operation_not_supported = EOPNOTSUPP,
+ operation_would_block = EWOULDBLOCK,
+ owner_dead = EOWNERDEAD,
+ permission_denied = EACCES,
+ protocol_error = EPROTO,
+ protocol_not_supported = EPROTONOSUPPORT,
+ read_only_file_system = EROFS,
+ resource_deadlock_would_occur = EDEADLK,
+ resource_unavailable_try_again = EAGAIN,
+ result_out_of_range = ERANGE,
+ state_not_recoverable = ENOTRECOVERABLE,
#ifdef ETIME
- stream_timeout = ETIME,
+ stream_timeout = ETIME,
#else
- stream_timeout = ETIMEDOUT,
+ stream_timeout = ETIMEDOUT,
#endif
- text_file_busy = ETXTBSY,
- timed_out = ETIMEDOUT,
- too_many_files_open_in_system = ENFILE,
- too_many_files_open = EMFILE,
- too_many_links = EMLINK,
- too_many_symbolic_link_levels = ELOOP,
- value_too_large = EOVERFLOW,
- wrong_protocol_type = EPROTOTYPE
-};
+ text_file_busy = ETXTBSY,
+ timed_out = ETIMEDOUT,
+ too_many_files_open_in_system = ENFILE,
+ too_many_files_open = EMFILE,
+ too_many_links = EMLINK,
+ too_many_symbolic_link_levels = ELOOP,
+ value_too_large = EOVERFLOW,
+ wrong_protocol_type = EPROTOTYPE};
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc)
_LIBCPP_END_NAMESPACE_STD
diff --git a/lib/libcxx/include/__system_error/error_code.h b/lib/libcxx/include/__system_error/error_code.h
index d05e68529f..475f2bb96a 100644
--- a/lib/libcxx/include/__system_error/error_code.h
+++ b/lib/libcxx/include/__system_error/error_code.h
@@ -49,9 +49,8 @@ public:
_LIBCPP_HIDE_FROM_ABI error_code(int __val, const error_category& __cat) _NOEXCEPT : __val_(__val), __cat_(&__cat) {}
- template <class _Ep>
- _LIBCPP_HIDE_FROM_ABI
- error_code(_Ep __e, typename enable_if<is_error_code_enum<_Ep>::value>::type* = nullptr) _NOEXCEPT {
+ template <class _Ep, __enable_if_t<is_error_code_enum<_Ep>::value, int> = 0>
+ _LIBCPP_HIDE_FROM_ABI error_code(_Ep __e) _NOEXCEPT {
using __adl_only::make_error_code;
*this = make_error_code(__e);
}
@@ -61,9 +60,8 @@ public:
__cat_ = &__cat;
}
- template <class _Ep>
- _LIBCPP_HIDE_FROM_ABI typename enable_if< is_error_code_enum<_Ep>::value, error_code& >::type
- operator=(_Ep __e) _NOEXCEPT {
+ template <class _Ep, __enable_if_t<is_error_code_enum<_Ep>::value, int> = 0>
+ _LIBCPP_HIDE_FROM_ABI error_code& operator=(_Ep __e) _NOEXCEPT {
using __adl_only::make_error_code;
*this = make_error_code(__e);
return *this;
diff --git a/lib/libcxx/include/__system_error/error_condition.h b/lib/libcxx/include/__system_error/error_condition.h
index a43a73cdc2..42898c1f0e 100644
--- a/lib/libcxx/include/__system_error/error_condition.h
+++ b/lib/libcxx/include/__system_error/error_condition.h
@@ -58,9 +58,8 @@ public:
: __val_(__val),
__cat_(&__cat) {}
- template <class _Ep>
- _LIBCPP_HIDE_FROM_ABI
- error_condition(_Ep __e, typename enable_if<is_error_condition_enum<_Ep>::value>::type* = nullptr) _NOEXCEPT {
+ template <class _Ep, __enable_if_t<is_error_condition_enum<_Ep>::value, int> = 0>
+ _LIBCPP_HIDE_FROM_ABI error_condition(_Ep __e) _NOEXCEPT {
using __adl_only::make_error_condition;
*this = make_error_condition(__e);
}
@@ -70,9 +69,8 @@ public:
__cat_ = &__cat;
}
- template <class _Ep>
- _LIBCPP_HIDE_FROM_ABI typename enable_if< is_error_condition_enum<_Ep>::value, error_condition& >::type
- operator=(_Ep __e) _NOEXCEPT {
+ template <class _Ep, __enable_if_t<is_error_condition_enum<_Ep>::value, int> = 0>
+ _LIBCPP_HIDE_FROM_ABI error_condition& operator=(_Ep __e) _NOEXCEPT {
using __adl_only::make_error_condition;
*this = make_error_condition(__e);
return *this;
diff --git a/lib/libcxx/include/__system_error/system_error.h b/lib/libcxx/include/__system_error/system_error.h
index bc829491a4..362e675056 100644
--- a/lib/libcxx/include/__system_error/system_error.h
+++ b/lib/libcxx/include/__system_error/system_error.h
@@ -13,6 +13,7 @@
#include <__config>
#include <__system_error/error_category.h>
#include <__system_error/error_code.h>
+#include <__verbose_abort>
#include <stdexcept>
#include <string>
@@ -36,12 +37,17 @@ public:
~system_error() _NOEXCEPT override;
_LIBCPP_HIDE_FROM_ABI const error_code& code() const _NOEXCEPT { return __ec_; }
-
-private:
- static string __init(const error_code&, string);
};
_LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void __throw_system_error(int __ev, const char* __what_arg);
+_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI inline void __throw_system_error(error_code __ec, const char* __what_arg) {
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+ throw system_error(__ec, __what_arg);
+#else
+ _LIBCPP_VERBOSE_ABORT(
+ "system_error was thrown in -fno-exceptions mode with error %i and message \"%s\"", __ec.value(), __what_arg);
+#endif
+}
_LIBCPP_END_NAMESPACE_STD