diff --git a/libcxx/src/any.cpp b/libcxx/src/any.cpp --- a/libcxx/src/any.cpp +++ b/libcxx/src/any.cpp @@ -9,7 +9,7 @@ #include "any" namespace std { -const char* bad_any_cast::what() const _NOEXCEPT { +const char* bad_any_cast::what() const noexcept { return "bad any cast"; } } @@ -24,10 +24,10 @@ class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast { public: - virtual const char* what() const _NOEXCEPT; + virtual const char* what() const noexcept; }; -const char* bad_any_cast::what() const _NOEXCEPT { +const char* bad_any_cast::what() const noexcept { return "bad any cast"; } diff --git a/libcxx/src/charconv.cpp b/libcxx/src/charconv.cpp --- a/libcxx/src/charconv.cpp +++ b/libcxx/src/charconv.cpp @@ -99,7 +99,7 @@ } char* -__u32toa(uint32_t value, char* buffer) _NOEXCEPT +__u32toa(uint32_t value, char* buffer) noexcept { if (value < 100000000) { @@ -120,7 +120,7 @@ } char* -__u64toa(uint64_t value, char* buffer) _NOEXCEPT +__u64toa(uint64_t value, char* buffer) noexcept { if (value < 100000000) { diff --git a/libcxx/src/chrono.cpp b/libcxx/src/chrono.cpp --- a/libcxx/src/chrono.cpp +++ b/libcxx/src/chrono.cpp @@ -107,19 +107,19 @@ const bool system_clock::is_steady; system_clock::time_point -system_clock::now() _NOEXCEPT +system_clock::now() noexcept { return __libcpp_system_clock_now(); } time_t -system_clock::to_time_t(const time_point& t) _NOEXCEPT +system_clock::to_time_t(const time_point& t) noexcept { return time_t(duration_cast(t.time_since_epoch()).count()); } system_clock::time_point -system_clock::from_time_t(time_t t) _NOEXCEPT +system_clock::from_time_t(time_t t) noexcept { return system_clock::time_point(seconds(t)); } @@ -255,7 +255,7 @@ const bool steady_clock::is_steady; steady_clock::time_point -steady_clock::now() _NOEXCEPT +steady_clock::now() noexcept { return __libcpp_steady_clock_now(); } diff --git a/libcxx/src/condition_variable.cpp b/libcxx/src/condition_variable.cpp --- a/libcxx/src/condition_variable.cpp +++ b/libcxx/src/condition_variable.cpp @@ -24,19 +24,19 @@ // ~condition_variable is defined elsewhere. void -condition_variable::notify_one() _NOEXCEPT +condition_variable::notify_one() noexcept { __libcpp_condvar_signal(&__cv_); } void -condition_variable::notify_all() _NOEXCEPT +condition_variable::notify_all() noexcept { __libcpp_condvar_broadcast(&__cv_); } void -condition_variable::wait(unique_lock& lk) _NOEXCEPT +condition_variable::wait(unique_lock& lk) noexcept { if (!lk.owns_lock()) __throw_system_error(EPERM, @@ -48,7 +48,7 @@ void condition_variable::__do_timed_wait(unique_lock& lk, - chrono::time_point tp) _NOEXCEPT + chrono::time_point tp) noexcept { using namespace chrono; if (!lk.owns_lock()) diff --git a/libcxx/src/experimental/memory_resource.cpp b/libcxx/src/experimental/memory_resource.cpp --- a/libcxx/src/experimental/memory_resource.cpp +++ b/libcxx/src/experimental/memory_resource.cpp @@ -40,7 +40,7 @@ _VSTD::__libcpp_deallocate(p, n, align); } - bool do_is_equal(memory_resource const & other) const _NOEXCEPT override + bool do_is_equal(memory_resource const & other) const noexcept override { return &other == this; } public: @@ -60,7 +60,7 @@ __throw_bad_alloc(); } virtual void do_deallocate(void *, size_t, size_t) {} - virtual bool do_is_equal(memory_resource const & __other) const _NOEXCEPT + virtual bool do_is_equal(memory_resource const & __other) const noexcept { return &__other == this; } }; @@ -81,18 +81,18 @@ } // end namespace -memory_resource * new_delete_resource() _NOEXCEPT { +memory_resource * new_delete_resource() noexcept { return &res_init.resources.new_delete_res; } -memory_resource * null_memory_resource() _NOEXCEPT { +memory_resource * null_memory_resource() noexcept { return &res_init.resources.null_res; } // default_memory_resource() static memory_resource * -__default_memory_resource(bool set = false, memory_resource * new_res = nullptr) _NOEXCEPT +__default_memory_resource(bool set = false, memory_resource * new_res = nullptr) noexcept { #ifndef _LIBCPP_HAS_NO_ATOMIC_HEADER _LIBCPP_SAFE_STATIC static atomic __res = @@ -133,12 +133,12 @@ #endif } -memory_resource * get_default_resource() _NOEXCEPT +memory_resource * get_default_resource() noexcept { return __default_memory_resource(); } -memory_resource * set_default_resource(memory_resource * __new_res) _NOEXCEPT +memory_resource * set_default_resource(memory_resource * __new_res) noexcept { return __default_memory_resource(true, __new_res); } diff --git a/libcxx/src/functional.cpp b/libcxx/src/functional.cpp --- a/libcxx/src/functional.cpp +++ b/libcxx/src/functional.cpp @@ -11,12 +11,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD #ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION -bad_function_call::~bad_function_call() _NOEXCEPT +bad_function_call::~bad_function_call() noexcept { } const char* -bad_function_call::what() const _NOEXCEPT +bad_function_call::what() const noexcept { return "std::bad_function_call"; } diff --git a/libcxx/src/future.cpp b/libcxx/src/future.cpp --- a/libcxx/src/future.cpp +++ b/libcxx/src/future.cpp @@ -19,12 +19,12 @@ : public __do_message { public: - virtual const char* name() const _NOEXCEPT; + virtual const char* name() const noexcept; virtual string message(int ev) const; }; const char* -__future_error_category::name() const _NOEXCEPT +__future_error_category::name() const noexcept { return "future"; } @@ -65,7 +65,7 @@ #endif const error_category& -future_category() _NOEXCEPT +future_category() noexcept { static __future_error_category __f; return __f; @@ -77,12 +77,12 @@ { } -future_error::~future_error() _NOEXCEPT +future_error::~future_error() noexcept { } void -__assoc_sub_state::__on_zero_shared() _NOEXCEPT +__assoc_sub_state::__on_zero_shared() noexcept { delete this; } diff --git a/libcxx/src/include/refstring.h b/libcxx/src/include/refstring.h --- a/libcxx/src/include/refstring.h +++ b/libcxx/src/include/refstring.h @@ -55,7 +55,7 @@ #if defined(_LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE) inline -const char* compute_gcc_empty_string_storage() _NOEXCEPT +const char* compute_gcc_empty_string_storage() noexcept { void* handle = dlopen("/usr/lib/libstdc++.6.dylib", RTLD_NOLOAD); if (handle == nullptr) @@ -68,7 +68,7 @@ inline const char* -get_gcc_empty_string_storage() _NOEXCEPT +get_gcc_empty_string_storage() noexcept { static const char* p = compute_gcc_empty_string_storage(); return p; @@ -92,7 +92,7 @@ } inline -__libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) _NOEXCEPT +__libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) noexcept : __imp_(s.__imp_) { if (__uses_refcount()) @@ -100,7 +100,7 @@ } inline -__libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) _NOEXCEPT { +__libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) noexcept { bool adjust_old_count = __uses_refcount(); struct _Rep_base *old_rep = rep_from_data(__imp_); __imp_ = s.__imp_; diff --git a/libcxx/src/ios.cpp b/libcxx/src/ios.cpp --- a/libcxx/src/ios.cpp +++ b/libcxx/src/ios.cpp @@ -27,12 +27,12 @@ : public __do_message { public: - virtual const char* name() const _NOEXCEPT; + virtual const char* name() const noexcept; virtual string message(int ev) const; }; const char* -__iostream_category::name() const _NOEXCEPT +__iostream_category::name() const noexcept { return "iostream"; } @@ -50,7 +50,7 @@ } const error_category& -iostream_category() _NOEXCEPT +iostream_category() noexcept { static __iostream_category s; return s; @@ -387,7 +387,7 @@ } void -ios_base::swap(ios_base& rhs) _NOEXCEPT +ios_base::swap(ios_base& rhs) noexcept { _VSTD::swap(__fmtflags_, rhs.__fmtflags_); _VSTD::swap(__precision_, rhs.__precision_); diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp --- a/libcxx/src/locale.cpp +++ b/libcxx/src/locale.cpp @@ -532,13 +532,13 @@ return g; } -locale::locale() _NOEXCEPT +locale::locale() noexcept : __locale_(__global().__locale_) { __locale_->__add_shared(); } -locale::locale(const locale& l) _NOEXCEPT +locale::locale(const locale& l) noexcept : __locale_(l.__locale_) { __locale_->__add_shared(); @@ -550,7 +550,7 @@ } const locale& -locale::operator=(const locale& other) _NOEXCEPT +locale::operator=(const locale& other) noexcept { other.__locale_->__add_shared(); __locale_->__release_shared(); @@ -643,7 +643,7 @@ } void -locale::facet::__on_zero_shared() _NOEXCEPT +locale::facet::__on_zero_shared() noexcept { delete this; } @@ -1051,7 +1051,7 @@ #ifdef _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE const ctype::mask* -ctype::classic_table() _NOEXCEPT +ctype::classic_table() noexcept { static _LIBCPP_CONSTEXPR const ctype::mask builtin_table[table_size] = { cntrl, cntrl, @@ -1131,7 +1131,7 @@ } #else const ctype::mask* -ctype::classic_table() _NOEXCEPT +ctype::classic_table() noexcept { #if defined(__APPLE__) || defined(__FreeBSD__) return _DefaultRuneLocale.__runetype; @@ -1163,38 +1163,38 @@ #if defined(__GLIBC__) const int* -ctype::__classic_lower_table() _NOEXCEPT +ctype::__classic_lower_table() noexcept { return _LIBCPP_GET_C_LOCALE->__ctype_tolower; } const int* -ctype::__classic_upper_table() _NOEXCEPT +ctype::__classic_upper_table() noexcept { return _LIBCPP_GET_C_LOCALE->__ctype_toupper; } #elif defined(__NetBSD__) const short* -ctype::__classic_lower_table() _NOEXCEPT +ctype::__classic_lower_table() noexcept { return _C_tolower_tab_ + 1; } const short* -ctype::__classic_upper_table() _NOEXCEPT +ctype::__classic_upper_table() noexcept { return _C_toupper_tab_ + 1; } #elif defined(__EMSCRIPTEN__) const int* -ctype::__classic_lower_table() _NOEXCEPT +ctype::__classic_lower_table() noexcept { return *__ctype_tolower_loc(); } const int* -ctype::__classic_upper_table() _NOEXCEPT +ctype::__classic_upper_table() noexcept { return *__ctype_toupper_loc(); } @@ -1492,13 +1492,13 @@ } int -codecvt::do_encoding() const _NOEXCEPT +codecvt::do_encoding() const noexcept { return 1; } bool -codecvt::do_always_noconv() const _NOEXCEPT +codecvt::do_always_noconv() const noexcept { return true; } @@ -1511,7 +1511,7 @@ } int -codecvt::do_max_length() const _NOEXCEPT +codecvt::do_max_length() const noexcept { return 1; } @@ -1682,7 +1682,7 @@ } int -codecvt::do_encoding() const _NOEXCEPT +codecvt::do_encoding() const noexcept { if (__libcpp_mbtowc_l(nullptr, nullptr, MB_LEN_MAX, __l) != 0) return -1; @@ -1694,7 +1694,7 @@ } bool -codecvt::do_always_noconv() const _NOEXCEPT +codecvt::do_always_noconv() const noexcept { return false; } @@ -1726,7 +1726,7 @@ } int -codecvt::do_max_length() const _NOEXCEPT +codecvt::do_max_length() const noexcept { return __l == 0 ? 1 : static_cast(__libcpp_mb_cur_max_l(__l)); } @@ -3169,13 +3169,13 @@ } int -codecvt::do_encoding() const _NOEXCEPT +codecvt::do_encoding() const noexcept { return 0; } bool -codecvt::do_always_noconv() const _NOEXCEPT +codecvt::do_always_noconv() const noexcept { return false; } @@ -3190,7 +3190,7 @@ } int -codecvt::do_max_length() const _NOEXCEPT +codecvt::do_max_length() const noexcept { return 4; } @@ -3248,13 +3248,13 @@ } int -codecvt::do_encoding() const _NOEXCEPT +codecvt::do_encoding() const noexcept { return 0; } bool -codecvt::do_always_noconv() const _NOEXCEPT +codecvt::do_always_noconv() const noexcept { return false; } @@ -3269,7 +3269,7 @@ } int -codecvt::do_max_length() const _NOEXCEPT +codecvt::do_max_length() const noexcept { return 4; } @@ -3327,13 +3327,13 @@ } int -codecvt::do_encoding() const _NOEXCEPT +codecvt::do_encoding() const noexcept { return 0; } bool -codecvt::do_always_noconv() const _NOEXCEPT +codecvt::do_always_noconv() const noexcept { return false; } @@ -3348,7 +3348,7 @@ } int -codecvt::do_max_length() const _NOEXCEPT +codecvt::do_max_length() const noexcept { return 4; } @@ -3406,13 +3406,13 @@ } int -codecvt::do_encoding() const _NOEXCEPT +codecvt::do_encoding() const noexcept { return 0; } bool -codecvt::do_always_noconv() const _NOEXCEPT +codecvt::do_always_noconv() const noexcept { return false; } @@ -3427,7 +3427,7 @@ } int -codecvt::do_max_length() const _NOEXCEPT +codecvt::do_max_length() const noexcept { return 4; } @@ -3500,13 +3500,13 @@ } int -__codecvt_utf8::do_encoding() const _NOEXCEPT +__codecvt_utf8::do_encoding() const noexcept { return 0; } bool -__codecvt_utf8::do_always_noconv() const _NOEXCEPT +__codecvt_utf8::do_always_noconv() const noexcept { return false; } @@ -3521,7 +3521,7 @@ } int -__codecvt_utf8::do_max_length() const _NOEXCEPT +__codecvt_utf8::do_max_length() const noexcept { if (_Mode_ & consume_header) return 7; @@ -3575,13 +3575,13 @@ } int -__codecvt_utf8::do_encoding() const _NOEXCEPT +__codecvt_utf8::do_encoding() const noexcept { return 0; } bool -__codecvt_utf8::do_always_noconv() const _NOEXCEPT +__codecvt_utf8::do_always_noconv() const noexcept { return false; } @@ -3596,7 +3596,7 @@ } int -__codecvt_utf8::do_max_length() const _NOEXCEPT +__codecvt_utf8::do_max_length() const noexcept { if (_Mode_ & consume_header) return 6; @@ -3650,13 +3650,13 @@ } int -__codecvt_utf8::do_encoding() const _NOEXCEPT +__codecvt_utf8::do_encoding() const noexcept { return 0; } bool -__codecvt_utf8::do_always_noconv() const _NOEXCEPT +__codecvt_utf8::do_always_noconv() const noexcept { return false; } @@ -3671,7 +3671,7 @@ } int -__codecvt_utf8::do_max_length() const _NOEXCEPT +__codecvt_utf8::do_max_length() const noexcept { if (_Mode_ & consume_header) return 7; @@ -3725,13 +3725,13 @@ } int -__codecvt_utf16::do_encoding() const _NOEXCEPT +__codecvt_utf16::do_encoding() const noexcept { return 0; } bool -__codecvt_utf16::do_always_noconv() const _NOEXCEPT +__codecvt_utf16::do_always_noconv() const noexcept { return false; } @@ -3746,7 +3746,7 @@ } int -__codecvt_utf16::do_max_length() const _NOEXCEPT +__codecvt_utf16::do_max_length() const noexcept { if (_Mode_ & consume_header) return 6; @@ -3800,13 +3800,13 @@ } int -__codecvt_utf16::do_encoding() const _NOEXCEPT +__codecvt_utf16::do_encoding() const noexcept { return 0; } bool -__codecvt_utf16::do_always_noconv() const _NOEXCEPT +__codecvt_utf16::do_always_noconv() const noexcept { return false; } @@ -3821,7 +3821,7 @@ } int -__codecvt_utf16::do_max_length() const _NOEXCEPT +__codecvt_utf16::do_max_length() const noexcept { if (_Mode_ & consume_header) return 6; @@ -3875,13 +3875,13 @@ } int -__codecvt_utf16::do_encoding() const _NOEXCEPT +__codecvt_utf16::do_encoding() const noexcept { return 0; } bool -__codecvt_utf16::do_always_noconv() const _NOEXCEPT +__codecvt_utf16::do_always_noconv() const noexcept { return false; } @@ -3896,7 +3896,7 @@ } int -__codecvt_utf16::do_max_length() const _NOEXCEPT +__codecvt_utf16::do_max_length() const noexcept { if (_Mode_ & consume_header) return 4; @@ -3950,13 +3950,13 @@ } int -__codecvt_utf16::do_encoding() const _NOEXCEPT +__codecvt_utf16::do_encoding() const noexcept { return 0; } bool -__codecvt_utf16::do_always_noconv() const _NOEXCEPT +__codecvt_utf16::do_always_noconv() const noexcept { return false; } @@ -3971,7 +3971,7 @@ } int -__codecvt_utf16::do_max_length() const _NOEXCEPT +__codecvt_utf16::do_max_length() const noexcept { if (_Mode_ & consume_header) return 4; @@ -4025,13 +4025,13 @@ } int -__codecvt_utf16::do_encoding() const _NOEXCEPT +__codecvt_utf16::do_encoding() const noexcept { return 0; } bool -__codecvt_utf16::do_always_noconv() const _NOEXCEPT +__codecvt_utf16::do_always_noconv() const noexcept { return false; } @@ -4046,7 +4046,7 @@ } int -__codecvt_utf16::do_max_length() const _NOEXCEPT +__codecvt_utf16::do_max_length() const noexcept { if (_Mode_ & consume_header) return 6; @@ -4100,13 +4100,13 @@ } int -__codecvt_utf16::do_encoding() const _NOEXCEPT +__codecvt_utf16::do_encoding() const noexcept { return 0; } bool -__codecvt_utf16::do_always_noconv() const _NOEXCEPT +__codecvt_utf16::do_always_noconv() const noexcept { return false; } @@ -4121,7 +4121,7 @@ } int -__codecvt_utf16::do_max_length() const _NOEXCEPT +__codecvt_utf16::do_max_length() const noexcept { if (_Mode_ & consume_header) return 6; @@ -4175,13 +4175,13 @@ } int -__codecvt_utf8_utf16::do_encoding() const _NOEXCEPT +__codecvt_utf8_utf16::do_encoding() const noexcept { return 0; } bool -__codecvt_utf8_utf16::do_always_noconv() const _NOEXCEPT +__codecvt_utf8_utf16::do_always_noconv() const noexcept { return false; } @@ -4196,7 +4196,7 @@ } int -__codecvt_utf8_utf16::do_max_length() const _NOEXCEPT +__codecvt_utf8_utf16::do_max_length() const noexcept { if (_Mode_ & consume_header) return 7; @@ -4250,13 +4250,13 @@ } int -__codecvt_utf8_utf16::do_encoding() const _NOEXCEPT +__codecvt_utf8_utf16::do_encoding() const noexcept { return 0; } bool -__codecvt_utf8_utf16::do_always_noconv() const _NOEXCEPT +__codecvt_utf8_utf16::do_always_noconv() const noexcept { return false; } @@ -4271,7 +4271,7 @@ } int -__codecvt_utf8_utf16::do_max_length() const _NOEXCEPT +__codecvt_utf8_utf16::do_max_length() const noexcept { if (_Mode_ & consume_header) return 7; @@ -4325,13 +4325,13 @@ } int -__codecvt_utf8_utf16::do_encoding() const _NOEXCEPT +__codecvt_utf8_utf16::do_encoding() const noexcept { return 0; } bool -__codecvt_utf8_utf16::do_always_noconv() const _NOEXCEPT +__codecvt_utf8_utf16::do_always_noconv() const noexcept { return false; } @@ -4346,7 +4346,7 @@ } int -__codecvt_utf8_utf16::do_max_length() const _NOEXCEPT +__codecvt_utf8_utf16::do_max_length() const noexcept { if (_Mode_ & consume_header) return 7; diff --git a/libcxx/src/memory.cpp b/libcxx/src/memory.cpp --- a/libcxx/src/memory.cpp +++ b/libcxx/src/memory.cpp @@ -20,10 +20,10 @@ const allocator_arg_t allocator_arg = allocator_arg_t(); -bad_weak_ptr::~bad_weak_ptr() _NOEXCEPT {} +bad_weak_ptr::~bad_weak_ptr() noexcept {} const char* -bad_weak_ptr::what() const _NOEXCEPT +bad_weak_ptr::what() const noexcept { return "bad_weak_ptr"; } @@ -38,13 +38,13 @@ #if defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS) void -__shared_count::__add_shared() _NOEXCEPT +__shared_count::__add_shared() noexcept { __libcpp_atomic_refcount_increment(__shared_owners_); } bool -__shared_count::__release_shared() _NOEXCEPT +__shared_count::__release_shared() noexcept { if (__libcpp_atomic_refcount_decrement(__shared_owners_) == -1) { @@ -55,19 +55,19 @@ } void -__shared_weak_count::__add_shared() _NOEXCEPT +__shared_weak_count::__add_shared() noexcept { __shared_count::__add_shared(); } void -__shared_weak_count::__add_weak() _NOEXCEPT +__shared_weak_count::__add_weak() noexcept { __libcpp_atomic_refcount_increment(__shared_weak_owners_); } void -__shared_weak_count::__release_shared() _NOEXCEPT +__shared_weak_count::__release_shared() noexcept { if (__shared_count::__release_shared()) __release_weak(); @@ -76,7 +76,7 @@ #endif // _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS void -__shared_weak_count::__release_weak() _NOEXCEPT +__shared_weak_count::__release_weak() noexcept { // NOTE: The acquire load here is an optimization of the very // common case where a shared pointer is being destructed while @@ -111,7 +111,7 @@ } __shared_weak_count* -__shared_weak_count::lock() _NOEXCEPT +__shared_weak_count::lock() noexcept { long object_owners = __libcpp_atomic_load(&__shared_owners_); while (object_owners != -1) @@ -125,7 +125,7 @@ } const void* -__shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT +__shared_weak_count::__get_deleter(const type_info&) const noexcept { return nullptr; } @@ -141,13 +141,13 @@ _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER }; -_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) _NOEXCEPT +_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) noexcept : __lx(p) { } void -__sp_mut::lock() _NOEXCEPT +__sp_mut::lock() noexcept { auto m = static_cast<__libcpp_mutex_t*>(__lx); unsigned count = 0; @@ -163,7 +163,7 @@ } void -__sp_mut::unlock() _NOEXCEPT +__sp_mut::unlock() noexcept { __libcpp_mutex_unlock(static_cast<__libcpp_mutex_t*>(__lx)); } @@ -199,7 +199,7 @@ } #if !defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE) -pointer_safety get_pointer_safety() _NOEXCEPT +pointer_safety get_pointer_safety() noexcept { return pointer_safety::relaxed; } diff --git a/libcxx/src/mutex.cpp b/libcxx/src/mutex.cpp --- a/libcxx/src/mutex.cpp +++ b/libcxx/src/mutex.cpp @@ -36,13 +36,13 @@ } bool -mutex::try_lock() _NOEXCEPT +mutex::try_lock() noexcept { return __libcpp_mutex_trylock(&__m_); } void -mutex::unlock() _NOEXCEPT +mutex::unlock() noexcept { int ec = __libcpp_mutex_unlock(&__m_); (void)ec; @@ -74,7 +74,7 @@ } void -recursive_mutex::unlock() _NOEXCEPT +recursive_mutex::unlock() noexcept { int e = __libcpp_recursive_mutex_unlock(&__m_); (void)e; @@ -82,7 +82,7 @@ } bool -recursive_mutex::try_lock() _NOEXCEPT +recursive_mutex::try_lock() noexcept { return __libcpp_recursive_mutex_trylock(&__m_); } @@ -109,7 +109,7 @@ } bool -timed_mutex::try_lock() _NOEXCEPT +timed_mutex::try_lock() noexcept { unique_lock lk(__m_, try_to_lock); if (lk.owns_lock() && !__locked_) @@ -121,7 +121,7 @@ } void -timed_mutex::unlock() _NOEXCEPT +timed_mutex::unlock() noexcept { lock_guard _(__m_); __locked_ = false; @@ -160,7 +160,7 @@ } bool -recursive_timed_mutex::try_lock() _NOEXCEPT +recursive_timed_mutex::try_lock() noexcept { __thread_id id = this_thread::get_id(); unique_lock lk(__m_, try_to_lock); @@ -176,7 +176,7 @@ } void -recursive_timed_mutex::unlock() _NOEXCEPT +recursive_timed_mutex::unlock() noexcept { unique_lock lk(__m_); if (--__count_ == 0) diff --git a/libcxx/src/mutex_destructor.cpp b/libcxx/src/mutex_destructor.cpp --- a/libcxx/src/mutex_destructor.cpp +++ b/libcxx/src/mutex_destructor.cpp @@ -41,7 +41,7 @@ }; -mutex::~mutex() _NOEXCEPT +mutex::~mutex() noexcept { __libcpp_mutex_destroy(&__m_); } diff --git a/libcxx/src/new.cpp b/libcxx/src/new.cpp --- a/libcxx/src/new.cpp +++ b/libcxx/src/new.cpp @@ -83,7 +83,7 @@ _LIBCPP_WEAK void* -operator new(size_t size, const std::nothrow_t&) _NOEXCEPT +operator new(size_t size, const std::nothrow_t&) noexcept { void* p = nullptr; #ifndef _LIBCPP_NO_EXCEPTIONS @@ -109,7 +109,7 @@ _LIBCPP_WEAK void* -operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT +operator new[](size_t size, const std::nothrow_t&) noexcept { void* p = nullptr; #ifndef _LIBCPP_NO_EXCEPTIONS @@ -128,42 +128,42 @@ _LIBCPP_WEAK void -operator delete(void* ptr) _NOEXCEPT +operator delete(void* ptr) noexcept { ::free(ptr); } _LIBCPP_WEAK void -operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT +operator delete(void* ptr, const std::nothrow_t&) noexcept { ::operator delete(ptr); } _LIBCPP_WEAK void -operator delete(void* ptr, size_t) _NOEXCEPT +operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); } _LIBCPP_WEAK void -operator delete[] (void* ptr) _NOEXCEPT +operator delete[] (void* ptr) noexcept { ::operator delete(ptr); } _LIBCPP_WEAK void -operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT +operator delete[] (void* ptr, const std::nothrow_t&) noexcept { ::operator delete[](ptr); } _LIBCPP_WEAK void -operator delete[] (void* ptr, size_t) _NOEXCEPT +operator delete[] (void* ptr, size_t) noexcept { ::operator delete[](ptr); } @@ -204,7 +204,7 @@ _LIBCPP_WEAK void* -operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT +operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept { void* p = nullptr; #ifndef _LIBCPP_NO_EXCEPTIONS @@ -230,7 +230,7 @@ _LIBCPP_WEAK void* -operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT +operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept { void* p = nullptr; #ifndef _LIBCPP_NO_EXCEPTIONS @@ -249,42 +249,42 @@ _LIBCPP_WEAK void -operator delete(void* ptr, std::align_val_t) _NOEXCEPT +operator delete(void* ptr, std::align_val_t) noexcept { std::__libcpp_aligned_free(ptr); } _LIBCPP_WEAK void -operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT +operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept { ::operator delete(ptr, alignment); } _LIBCPP_WEAK void -operator delete(void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT +operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept { ::operator delete(ptr, alignment); } _LIBCPP_WEAK void -operator delete[] (void* ptr, std::align_val_t alignment) _NOEXCEPT +operator delete[] (void* ptr, std::align_val_t alignment) noexcept { ::operator delete(ptr, alignment); } _LIBCPP_WEAK void -operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT +operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept { ::operator delete[](ptr, alignment); } _LIBCPP_WEAK void -operator delete[] (void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT +operator delete[] (void* ptr, size_t, std::align_val_t alignment) noexcept { ::operator delete[](ptr, alignment); } diff --git a/libcxx/src/optional.cpp b/libcxx/src/optional.cpp --- a/libcxx/src/optional.cpp +++ b/libcxx/src/optional.cpp @@ -12,9 +12,9 @@ namespace std { -bad_optional_access::~bad_optional_access() _NOEXCEPT = default; +bad_optional_access::~bad_optional_access() noexcept = default; -const char* bad_optional_access::what() const _NOEXCEPT { +const char* bad_optional_access::what() const noexcept { return "bad_optional_access"; } @@ -34,9 +34,9 @@ bad_optional_access() : std::logic_error("Bad optional Access") {} // Get the key function ~bad_optional_access() into the dylib - virtual ~bad_optional_access() _NOEXCEPT; + virtual ~bad_optional_access() noexcept; }; -bad_optional_access::~bad_optional_access() _NOEXCEPT = default; +bad_optional_access::~bad_optional_access() noexcept = default; _LIBCPP_END_NAMESPACE_EXPERIMENTAL diff --git a/libcxx/src/random.cpp b/libcxx/src/random.cpp --- a/libcxx/src/random.cpp +++ b/libcxx/src/random.cpp @@ -175,7 +175,7 @@ #endif double -random_device::entropy() const _NOEXCEPT +random_device::entropy() const noexcept { #if defined(_LIBCPP_USING_DEV_RANDOM) && defined(RNDGETENTCNT) int ent; diff --git a/libcxx/src/support/runtime/exception_fallback.ipp b/libcxx/src/support/runtime/exception_fallback.ipp --- a/libcxx/src/support/runtime/exception_fallback.ipp +++ b/libcxx/src/support/runtime/exception_fallback.ipp @@ -17,13 +17,13 @@ // libcxxrt provides implementations of these functions itself. unexpected_handler -set_unexpected(unexpected_handler func) _NOEXCEPT +set_unexpected(unexpected_handler func) noexcept { return __libcpp_atomic_exchange(&__unexpected_handler, func); } unexpected_handler -get_unexpected() _NOEXCEPT +get_unexpected() noexcept { return __libcpp_atomic_load(&__unexpected_handler); @@ -38,20 +38,20 @@ } terminate_handler -set_terminate(terminate_handler func) _NOEXCEPT +set_terminate(terminate_handler func) noexcept { return __libcpp_atomic_exchange(&__terminate_handler, func); } terminate_handler -get_terminate() _NOEXCEPT +get_terminate() noexcept { return __libcpp_atomic_load(&__terminate_handler); } _LIBCPP_NORETURN void -terminate() _NOEXCEPT +terminate() noexcept { #ifndef _LIBCPP_NO_EXCEPTIONS try @@ -72,9 +72,9 @@ #endif // _LIBCPP_NO_EXCEPTIONS } -bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; } +bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; } -int uncaught_exceptions() _NOEXCEPT +int uncaught_exceptions() noexcept { #warning uncaught_exception not yet implemented fprintf(stderr, "uncaught_exceptions not yet implemented\n"); @@ -82,77 +82,77 @@ } -exception::~exception() _NOEXCEPT +exception::~exception() noexcept { } -const char* exception::what() const _NOEXCEPT +const char* exception::what() const noexcept { return "std::exception"; } -bad_exception::~bad_exception() _NOEXCEPT +bad_exception::~bad_exception() noexcept { } -const char* bad_exception::what() const _NOEXCEPT +const char* bad_exception::what() const noexcept { return "std::bad_exception"; } -bad_alloc::bad_alloc() _NOEXCEPT +bad_alloc::bad_alloc() noexcept { } -bad_alloc::~bad_alloc() _NOEXCEPT +bad_alloc::~bad_alloc() noexcept { } const char* -bad_alloc::what() const _NOEXCEPT +bad_alloc::what() const noexcept { return "std::bad_alloc"; } -bad_array_new_length::bad_array_new_length() _NOEXCEPT +bad_array_new_length::bad_array_new_length() noexcept { } -bad_array_new_length::~bad_array_new_length() _NOEXCEPT +bad_array_new_length::~bad_array_new_length() noexcept { } const char* -bad_array_new_length::what() const _NOEXCEPT +bad_array_new_length::what() const noexcept { return "bad_array_new_length"; } -bad_cast::bad_cast() _NOEXCEPT +bad_cast::bad_cast() noexcept { } -bad_typeid::bad_typeid() _NOEXCEPT +bad_typeid::bad_typeid() noexcept { } -bad_cast::~bad_cast() _NOEXCEPT +bad_cast::~bad_cast() noexcept { } const char* -bad_cast::what() const _NOEXCEPT +bad_cast::what() const noexcept { return "std::bad_cast"; } -bad_typeid::~bad_typeid() _NOEXCEPT +bad_typeid::~bad_typeid() noexcept { } const char* -bad_typeid::what() const _NOEXCEPT +bad_typeid::what() const noexcept { return "std::bad_typeid"; } diff --git a/libcxx/src/support/runtime/exception_glibcxx.ipp b/libcxx/src/support/runtime/exception_glibcxx.ipp --- a/libcxx/src/support/runtime/exception_glibcxx.ipp +++ b/libcxx/src/support/runtime/exception_glibcxx.ipp @@ -13,19 +13,19 @@ namespace std { -bad_alloc::bad_alloc() _NOEXCEPT +bad_alloc::bad_alloc() noexcept { } -bad_array_new_length::bad_array_new_length() _NOEXCEPT +bad_array_new_length::bad_array_new_length() noexcept { } -bad_cast::bad_cast() _NOEXCEPT +bad_cast::bad_cast() noexcept { } -bad_typeid::bad_typeid() _NOEXCEPT +bad_typeid::bad_typeid() noexcept { } diff --git a/libcxx/src/support/runtime/exception_libcxxabi.ipp b/libcxx/src/support/runtime/exception_libcxxabi.ipp --- a/libcxx/src/support/runtime/exception_libcxxabi.ipp +++ b/libcxx/src/support/runtime/exception_libcxxabi.ipp @@ -13,9 +13,9 @@ namespace std { -bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; } +bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; } -int uncaught_exceptions() _NOEXCEPT +int uncaught_exceptions() noexcept { # if _LIBCPPABI_VERSION > 1001 return __cxa_uncaught_exceptions(); diff --git a/libcxx/src/support/runtime/exception_libcxxrt.ipp b/libcxx/src/support/runtime/exception_libcxxrt.ipp --- a/libcxx/src/support/runtime/exception_libcxxrt.ipp +++ b/libcxx/src/support/runtime/exception_libcxxrt.ipp @@ -13,11 +13,11 @@ namespace std { -bad_exception::~bad_exception() _NOEXCEPT +bad_exception::~bad_exception() noexcept { } -const char* bad_exception::what() const _NOEXCEPT +const char* bad_exception::what() const noexcept { return "std::bad_exception"; } diff --git a/libcxx/src/support/runtime/exception_msvc.ipp b/libcxx/src/support/runtime/exception_msvc.ipp --- a/libcxx/src/support/runtime/exception_msvc.ipp +++ b/libcxx/src/support/runtime/exception_msvc.ipp @@ -31,11 +31,11 @@ namespace std { unexpected_handler -set_unexpected(unexpected_handler func) _NOEXCEPT { +set_unexpected(unexpected_handler func) noexcept { return ::set_unexpected(func); } -unexpected_handler get_unexpected() _NOEXCEPT { +unexpected_handler get_unexpected() noexcept { return ::_get_unexpected(); } @@ -46,16 +46,16 @@ terminate(); } -terminate_handler set_terminate(terminate_handler func) _NOEXCEPT { +terminate_handler set_terminate(terminate_handler func) noexcept { return ::set_terminate(func); } -terminate_handler get_terminate() _NOEXCEPT { +terminate_handler get_terminate() noexcept { return ::_get_terminate(); } _LIBCPP_NORETURN -void terminate() _NOEXCEPT +void terminate() noexcept { #ifndef _LIBCPP_NO_EXCEPTIONS try @@ -76,85 +76,85 @@ #endif // _LIBCPP_NO_EXCEPTIONS } -bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; } +bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; } -int uncaught_exceptions() _NOEXCEPT { +int uncaught_exceptions() noexcept { return __uncaught_exceptions(); } #if !defined(_LIBCPP_ABI_VCRUNTIME) -bad_cast::bad_cast() _NOEXCEPT +bad_cast::bad_cast() noexcept { } -bad_cast::~bad_cast() _NOEXCEPT +bad_cast::~bad_cast() noexcept { } const char * -bad_cast::what() const _NOEXCEPT +bad_cast::what() const noexcept { return "std::bad_cast"; } -bad_typeid::bad_typeid() _NOEXCEPT +bad_typeid::bad_typeid() noexcept { } -bad_typeid::~bad_typeid() _NOEXCEPT +bad_typeid::~bad_typeid() noexcept { } const char * -bad_typeid::what() const _NOEXCEPT +bad_typeid::what() const noexcept { return "std::bad_typeid"; } -exception::~exception() _NOEXCEPT +exception::~exception() noexcept { } -const char* exception::what() const _NOEXCEPT +const char* exception::what() const noexcept { return "std::exception"; } -bad_exception::~bad_exception() _NOEXCEPT +bad_exception::~bad_exception() noexcept { } -const char* bad_exception::what() const _NOEXCEPT +const char* bad_exception::what() const noexcept { return "std::bad_exception"; } -bad_alloc::bad_alloc() _NOEXCEPT +bad_alloc::bad_alloc() noexcept { } -bad_alloc::~bad_alloc() _NOEXCEPT +bad_alloc::~bad_alloc() noexcept { } const char* -bad_alloc::what() const _NOEXCEPT +bad_alloc::what() const noexcept { return "std::bad_alloc"; } -bad_array_new_length::bad_array_new_length() _NOEXCEPT +bad_array_new_length::bad_array_new_length() noexcept { } -bad_array_new_length::~bad_array_new_length() _NOEXCEPT +bad_array_new_length::~bad_array_new_length() noexcept { } const char* -bad_array_new_length::what() const _NOEXCEPT +bad_array_new_length::what() const noexcept { return "bad_array_new_length"; } diff --git a/libcxx/src/support/runtime/exception_pointer_cxxabi.ipp b/libcxx/src/support/runtime/exception_pointer_cxxabi.ipp --- a/libcxx/src/support/runtime/exception_pointer_cxxabi.ipp +++ b/libcxx/src/support/runtime/exception_pointer_cxxabi.ipp @@ -13,17 +13,17 @@ namespace std { -exception_ptr::~exception_ptr() _NOEXCEPT { +exception_ptr::~exception_ptr() noexcept { __cxa_decrement_exception_refcount(__ptr_); } -exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT +exception_ptr::exception_ptr(const exception_ptr& other) noexcept : __ptr_(other.__ptr_) { __cxa_increment_exception_refcount(__ptr_); } -exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT +exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept { if (__ptr_ != other.__ptr_) { @@ -34,12 +34,12 @@ return *this; } -nested_exception::nested_exception() _NOEXCEPT +nested_exception::nested_exception() noexcept : __ptr_(current_exception()) { } -nested_exception::~nested_exception() _NOEXCEPT +nested_exception::~nested_exception() noexcept { } @@ -52,7 +52,7 @@ rethrow_exception(__ptr_); } -exception_ptr current_exception() _NOEXCEPT +exception_ptr current_exception() noexcept { // be nicer if there was a constructor that took a ptr, then // this whole function would be just: diff --git a/libcxx/src/support/runtime/exception_pointer_glibcxx.ipp b/libcxx/src/support/runtime/exception_pointer_glibcxx.ipp --- a/libcxx/src/support/runtime/exception_pointer_glibcxx.ipp +++ b/libcxx/src/support/runtime/exception_pointer_glibcxx.ipp @@ -25,35 +25,35 @@ { void* __ptr_; - exception_ptr(const exception_ptr&) _NOEXCEPT; - exception_ptr& operator=(const exception_ptr&) _NOEXCEPT; - ~exception_ptr() _NOEXCEPT; + exception_ptr(const exception_ptr&) noexcept; + exception_ptr& operator=(const exception_ptr&) noexcept; + ~exception_ptr() noexcept; }; } _LIBCPP_NORETURN void rethrow_exception(__exception_ptr::exception_ptr); -exception_ptr::~exception_ptr() _NOEXCEPT +exception_ptr::~exception_ptr() noexcept { reinterpret_cast<__exception_ptr::exception_ptr*>(this)->~exception_ptr(); } -exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT +exception_ptr::exception_ptr(const exception_ptr& other) noexcept : __ptr_(other.__ptr_) { new (reinterpret_cast(this)) __exception_ptr::exception_ptr( reinterpret_cast(other)); } -exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT +exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept { *reinterpret_cast<__exception_ptr::exception_ptr*>(this) = reinterpret_cast(other); return *this; } -nested_exception::nested_exception() _NOEXCEPT +nested_exception::nested_exception() noexcept : __ptr_(current_exception()) { } diff --git a/libcxx/src/support/runtime/exception_pointer_msvc.ipp b/libcxx/src/support/runtime/exception_pointer_msvc.ipp --- a/libcxx/src/support/runtime/exception_pointer_msvc.ipp +++ b/libcxx/src/support/runtime/exception_pointer_msvc.ipp @@ -24,35 +24,35 @@ namespace std { -exception_ptr::exception_ptr() _NOEXCEPT { __ExceptionPtrCreate(this); } -exception_ptr::exception_ptr(nullptr_t) _NOEXCEPT { __ExceptionPtrCreate(this); } +exception_ptr::exception_ptr() noexcept { __ExceptionPtrCreate(this); } +exception_ptr::exception_ptr(nullptr_t) noexcept { __ExceptionPtrCreate(this); } -exception_ptr::exception_ptr(const exception_ptr& __other) _NOEXCEPT { +exception_ptr::exception_ptr(const exception_ptr& __other) noexcept { __ExceptionPtrCopy(this, &__other); } -exception_ptr& exception_ptr::operator=(const exception_ptr& __other) _NOEXCEPT { +exception_ptr& exception_ptr::operator=(const exception_ptr& __other) noexcept { __ExceptionPtrAssign(this, &__other); return *this; } -exception_ptr& exception_ptr::operator=(nullptr_t) _NOEXCEPT { +exception_ptr& exception_ptr::operator=(nullptr_t) noexcept { exception_ptr dummy; __ExceptionPtrAssign(this, &dummy); return *this; } -exception_ptr::~exception_ptr() _NOEXCEPT { __ExceptionPtrDestroy(this); } +exception_ptr::~exception_ptr() noexcept { __ExceptionPtrDestroy(this); } -exception_ptr::operator bool() const _NOEXCEPT { +exception_ptr::operator bool() const noexcept { return __ExceptionPtrToBool(this); } -bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT { +bool operator==(const exception_ptr& __x, const exception_ptr& __y) noexcept { return __ExceptionPtrCompare(&__x, &__y); } -void swap(exception_ptr& lhs, exception_ptr& rhs) _NOEXCEPT { +void swap(exception_ptr& lhs, exception_ptr& rhs) noexcept { __ExceptionPtrSwap(&rhs, &lhs); } @@ -63,7 +63,7 @@ return __ret; } -exception_ptr current_exception() _NOEXCEPT { +exception_ptr current_exception() noexcept { exception_ptr __ret; __ExceptionPtrCurrentException(&__ret); return __ret; @@ -72,9 +72,9 @@ _LIBCPP_NORETURN void rethrow_exception(exception_ptr p) { __ExceptionPtrRethrow(&p); } -nested_exception::nested_exception() _NOEXCEPT : __ptr_(current_exception()) {} +nested_exception::nested_exception() noexcept : __ptr_(current_exception()) {} -nested_exception::~nested_exception() _NOEXCEPT {} +nested_exception::~nested_exception() noexcept {} _LIBCPP_NORETURN void nested_exception::rethrow_nested() const { diff --git a/libcxx/src/support/runtime/exception_pointer_unimplemented.ipp b/libcxx/src/support/runtime/exception_pointer_unimplemented.ipp --- a/libcxx/src/support/runtime/exception_pointer_unimplemented.ipp +++ b/libcxx/src/support/runtime/exception_pointer_unimplemented.ipp @@ -12,14 +12,14 @@ namespace std { -exception_ptr::~exception_ptr() _NOEXCEPT +exception_ptr::~exception_ptr() noexcept { # warning exception_ptr not yet implemented fprintf(stderr, "exception_ptr not yet implemented\n"); ::abort(); } -exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT +exception_ptr::exception_ptr(const exception_ptr& other) noexcept : __ptr_(other.__ptr_) { # warning exception_ptr not yet implemented @@ -27,21 +27,21 @@ ::abort(); } -exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT +exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept { # warning exception_ptr not yet implemented fprintf(stderr, "exception_ptr not yet implemented\n"); ::abort(); } -nested_exception::nested_exception() _NOEXCEPT +nested_exception::nested_exception() noexcept : __ptr_(current_exception()) { } #if !defined(__GLIBCXX__) -nested_exception::~nested_exception() _NOEXCEPT +nested_exception::~nested_exception() noexcept { } @@ -61,7 +61,7 @@ #endif // FIXME } -exception_ptr current_exception() _NOEXCEPT +exception_ptr current_exception() noexcept { # warning exception_ptr not yet implemented fprintf(stderr, "exception_ptr not yet implemented\n"); diff --git a/libcxx/src/support/runtime/new_handler_fallback.ipp b/libcxx/src/support/runtime/new_handler_fallback.ipp --- a/libcxx/src/support/runtime/new_handler_fallback.ipp +++ b/libcxx/src/support/runtime/new_handler_fallback.ipp @@ -12,13 +12,13 @@ _LIBCPP_SAFE_STATIC static std::new_handler __new_handler; new_handler -set_new_handler(new_handler handler) _NOEXCEPT +set_new_handler(new_handler handler) noexcept { return __libcpp_atomic_exchange(&__new_handler, handler); } new_handler -get_new_handler() _NOEXCEPT +get_new_handler() noexcept { return __libcpp_atomic_load(&__new_handler); } diff --git a/libcxx/src/support/runtime/stdexcept_default.ipp b/libcxx/src/support/runtime/stdexcept_default.ipp --- a/libcxx/src/support/runtime/stdexcept_default.ipp +++ b/libcxx/src/support/runtime/stdexcept_default.ipp @@ -23,9 +23,9 @@ logic_error::logic_error(const char* msg) : __imp_(msg) {} -logic_error::logic_error(const logic_error& le) _NOEXCEPT : __imp_(le.__imp_) {} +logic_error::logic_error(const logic_error& le) noexcept : __imp_(le.__imp_) {} -logic_error& logic_error::operator=(const logic_error& le) _NOEXCEPT { +logic_error& logic_error::operator=(const logic_error& le) noexcept { __imp_ = le.__imp_; return *this; } @@ -34,30 +34,30 @@ runtime_error::runtime_error(const char* msg) : __imp_(msg) {} -runtime_error::runtime_error(const runtime_error& re) _NOEXCEPT +runtime_error::runtime_error(const runtime_error& re) noexcept : __imp_(re.__imp_) {} -runtime_error& runtime_error::operator=(const runtime_error& re) _NOEXCEPT { +runtime_error& runtime_error::operator=(const runtime_error& re) noexcept { __imp_ = re.__imp_; return *this; } #if !defined(_LIBCPPABI_VERSION) && !defined(LIBSTDCXX) -const char* logic_error::what() const _NOEXCEPT { return __imp_.c_str(); } +const char* logic_error::what() const noexcept { return __imp_.c_str(); } -const char* runtime_error::what() const _NOEXCEPT { return __imp_.c_str(); } +const char* runtime_error::what() const noexcept { return __imp_.c_str(); } -logic_error::~logic_error() _NOEXCEPT {} -domain_error::~domain_error() _NOEXCEPT {} -invalid_argument::~invalid_argument() _NOEXCEPT {} -length_error::~length_error() _NOEXCEPT {} -out_of_range::~out_of_range() _NOEXCEPT {} +logic_error::~logic_error() noexcept {} +domain_error::~domain_error() noexcept {} +invalid_argument::~invalid_argument() noexcept {} +length_error::~length_error() noexcept {} +out_of_range::~out_of_range() noexcept {} -runtime_error::~runtime_error() _NOEXCEPT {} -range_error::~range_error() _NOEXCEPT {} -overflow_error::~overflow_error() _NOEXCEPT {} -underflow_error::~underflow_error() _NOEXCEPT {} +runtime_error::~runtime_error() noexcept {} +range_error::~range_error() noexcept {} +overflow_error::~overflow_error() noexcept {} +underflow_error::~underflow_error() noexcept {} #endif diff --git a/libcxx/src/system_error.cpp b/libcxx/src/system_error.cpp --- a/libcxx/src/system_error.cpp +++ b/libcxx/src/system_error.cpp @@ -28,29 +28,29 @@ // class error_category #if defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS) -error_category::error_category() _NOEXCEPT +error_category::error_category() noexcept { } #endif -error_category::~error_category() _NOEXCEPT +error_category::~error_category() noexcept { } error_condition -error_category::default_error_condition(int ev) const _NOEXCEPT +error_category::default_error_condition(int ev) const noexcept { return error_condition(ev, *this); } bool -error_category::equivalent(int code, const error_condition& condition) const _NOEXCEPT +error_category::equivalent(int code, const error_condition& condition) const noexcept { return default_error_condition(code) == condition; } bool -error_category::equivalent(const error_code& code, int condition) const _NOEXCEPT +error_category::equivalent(const error_code& code, int condition) const noexcept { return *this == code.category() && code.value() == condition; } @@ -141,12 +141,12 @@ : public __do_message { public: - virtual const char* name() const _NOEXCEPT; + virtual const char* name() const noexcept; virtual string message(int ev) const; }; const char* -__generic_error_category::name() const _NOEXCEPT +__generic_error_category::name() const noexcept { return "generic"; } @@ -162,7 +162,7 @@ } const error_category& -generic_category() _NOEXCEPT +generic_category() noexcept { static __generic_error_category s; return s; @@ -172,13 +172,13 @@ : public __do_message { public: - virtual const char* name() const _NOEXCEPT; + virtual const char* name() const noexcept; virtual string message(int ev) const; - virtual error_condition default_error_condition(int ev) const _NOEXCEPT; + virtual error_condition default_error_condition(int ev) const noexcept; }; const char* -__system_error_category::name() const _NOEXCEPT +__system_error_category::name() const noexcept { return "system"; } @@ -194,7 +194,7 @@ } error_condition -__system_error_category::default_error_condition(int ev) const _NOEXCEPT +__system_error_category::default_error_condition(int ev) const noexcept { #ifdef _LIBCPP_ELAST if (ev > _LIBCPP_ELAST) @@ -204,7 +204,7 @@ } const error_category& -system_category() _NOEXCEPT +system_category() noexcept { static __system_error_category s; return s; @@ -276,7 +276,7 @@ { } -system_error::~system_error() _NOEXCEPT +system_error::~system_error() noexcept { } diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp --- a/libcxx/src/thread.cpp +++ b/libcxx/src/thread.cpp @@ -70,7 +70,7 @@ } unsigned -thread::hardware_concurrency() _NOEXCEPT +thread::hardware_concurrency() noexcept { #if defined(_SC_NPROCESSORS_ONLN) long result = sysconf(_SC_NPROCESSORS_ONLN); diff --git a/libcxx/src/typeinfo.cpp b/libcxx/src/typeinfo.cpp --- a/libcxx/src/typeinfo.cpp +++ b/libcxx/src/typeinfo.cpp @@ -11,18 +11,18 @@ #if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_ABI_VCRUNTIME) #include -int std::type_info::__compare(const type_info &__rhs) const _NOEXCEPT { +int std::type_info::__compare(const type_info &__rhs) const noexcept { if (&__data == &__rhs.__data) return 0; return strcmp(&__data.__decorated_name[1], &__rhs.__data.__decorated_name[1]); } -const char *std::type_info::name() const _NOEXCEPT { +const char *std::type_info::name() const noexcept { // TODO(compnerd) cache demangled &__data.__decorated_name[1] return &__data.__decorated_name[1]; } -size_t std::type_info::hash_code() const _NOEXCEPT { +size_t std::type_info::hash_code() const noexcept { #if defined(_WIN64) constexpr size_t fnv_offset_basis = 14695981039346656037ull; constexpr size_t fnv_prime = 10995116282110ull; diff --git a/libcxxabi/src/cxa_default_handlers.cpp b/libcxxabi/src/cxa_default_handlers.cpp --- a/libcxxabi/src/cxa_default_handlers.cpp +++ b/libcxxabi/src/cxa_default_handlers.cpp @@ -108,7 +108,7 @@ { unexpected_handler -set_unexpected(unexpected_handler func) _NOEXCEPT +set_unexpected(unexpected_handler func) noexcept { if (func == 0) func = default_unexpected_handler; @@ -117,7 +117,7 @@ } terminate_handler -set_terminate(terminate_handler func) _NOEXCEPT +set_terminate(terminate_handler func) noexcept { if (func == 0) func = default_terminate_handler; diff --git a/libcxxabi/src/cxa_handlers.h b/libcxxabi/src/cxa_handlers.h --- a/libcxxabi/src/cxa_handlers.h +++ b/libcxxabi/src/cxa_handlers.h @@ -25,7 +25,7 @@ _LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN void -__terminate(terminate_handler func) _NOEXCEPT; +__terminate(terminate_handler func) noexcept; } // std diff --git a/libcxxabi/src/cxa_handlers.cpp b/libcxxabi/src/cxa_handlers.cpp --- a/libcxxabi/src/cxa_handlers.cpp +++ b/libcxxabi/src/cxa_handlers.cpp @@ -23,7 +23,7 @@ { unexpected_handler -get_unexpected() _NOEXCEPT +get_unexpected() noexcept { return __libcpp_atomic_load(&__cxa_unexpected_handler, _AO_Acquire); } @@ -44,13 +44,13 @@ } terminate_handler -get_terminate() _NOEXCEPT +get_terminate() noexcept { return __libcpp_atomic_load(&__cxa_terminate_handler, _AO_Acquire); } void -__terminate(terminate_handler func) _NOEXCEPT +__terminate(terminate_handler func) noexcept { #ifndef _LIBCXXABI_NO_EXCEPTIONS try @@ -71,7 +71,7 @@ __attribute__((noreturn)) void -terminate() _NOEXCEPT +terminate() noexcept { #ifndef _LIBCXXABI_NO_EXCEPTIONS // If there might be an uncaught exception @@ -97,13 +97,13 @@ } new_handler -set_new_handler(new_handler handler) _NOEXCEPT +set_new_handler(new_handler handler) noexcept { return __libcpp_atomic_exchange(&__cxa_new_handler, handler, _AO_Acq_Rel); } new_handler -get_new_handler() _NOEXCEPT +get_new_handler() noexcept { return __libcpp_atomic_load(&__cxa_new_handler, _AO_Acquire); } diff --git a/libcxxabi/src/stdlib_exception.cpp b/libcxxabi/src/stdlib_exception.cpp --- a/libcxxabi/src/stdlib_exception.cpp +++ b/libcxxabi/src/stdlib_exception.cpp @@ -14,22 +14,22 @@ // exception -exception::~exception() _NOEXCEPT +exception::~exception() noexcept { } -const char* exception::what() const _NOEXCEPT +const char* exception::what() const noexcept { return "std::exception"; } // bad_exception -bad_exception::~bad_exception() _NOEXCEPT +bad_exception::~bad_exception() noexcept { } -const char* bad_exception::what() const _NOEXCEPT +const char* bad_exception::what() const noexcept { return "std::bad_exception"; } @@ -37,32 +37,32 @@ // bad_alloc -bad_alloc::bad_alloc() _NOEXCEPT +bad_alloc::bad_alloc() noexcept { } -bad_alloc::~bad_alloc() _NOEXCEPT +bad_alloc::~bad_alloc() noexcept { } const char* -bad_alloc::what() const _NOEXCEPT +bad_alloc::what() const noexcept { return "std::bad_alloc"; } // bad_array_new_length -bad_array_new_length::bad_array_new_length() _NOEXCEPT +bad_array_new_length::bad_array_new_length() noexcept { } -bad_array_new_length::~bad_array_new_length() _NOEXCEPT +bad_array_new_length::~bad_array_new_length() noexcept { } const char* -bad_array_new_length::what() const _NOEXCEPT +bad_array_new_length::what() const noexcept { return "bad_array_new_length"; } diff --git a/libcxxabi/src/stdlib_new_delete.cpp b/libcxxabi/src/stdlib_new_delete.cpp --- a/libcxxabi/src/stdlib_new_delete.cpp +++ b/libcxxabi/src/stdlib_new_delete.cpp @@ -12,8 +12,8 @@ #include #include -#if !defined(_THROW_BAD_ALLOC) || !defined(_NOEXCEPT) || !defined(_LIBCXXABI_WEAK) -#error The _THROW_BAD_ALLOC, _NOEXCEPT, and _LIBCXXABI_WEAK libc++ macros must \ +#if !defined(_THROW_BAD_ALLOC) || !defined(_LIBCXXABI_WEAK) +#error The _THROW_BAD_ALLOC and _LIBCXXABI_WEAK libc++ macros must \ already be defined by libc++. #endif // Implement all new and delete operators as weak definitions @@ -46,7 +46,7 @@ _LIBCXXABI_WEAK void* -operator new(size_t size, const std::nothrow_t&) _NOEXCEPT +operator new(size_t size, const std::nothrow_t&) noexcept { void* p = nullptr; #ifndef _LIBCXXABI_NO_EXCEPTIONS @@ -72,7 +72,7 @@ _LIBCXXABI_WEAK void* -operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT +operator new[](size_t size, const std::nothrow_t&) noexcept { void* p = nullptr; #ifndef _LIBCXXABI_NO_EXCEPTIONS @@ -91,42 +91,42 @@ _LIBCXXABI_WEAK void -operator delete(void* ptr) _NOEXCEPT +operator delete(void* ptr) noexcept { ::free(ptr); } _LIBCXXABI_WEAK void -operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT +operator delete(void* ptr, const std::nothrow_t&) noexcept { ::operator delete(ptr); } _LIBCXXABI_WEAK void -operator delete(void* ptr, size_t) _NOEXCEPT +operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); } _LIBCXXABI_WEAK void -operator delete[] (void* ptr) _NOEXCEPT +operator delete[] (void* ptr) noexcept { ::operator delete(ptr); } _LIBCXXABI_WEAK void -operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT +operator delete[] (void* ptr, const std::nothrow_t&) noexcept { ::operator delete[](ptr); } _LIBCXXABI_WEAK void -operator delete[] (void* ptr, size_t) _NOEXCEPT +operator delete[] (void* ptr, size_t) noexcept { ::operator delete[](ptr); } @@ -167,7 +167,7 @@ _LIBCXXABI_WEAK void* -operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT +operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept { void* p = nullptr; #ifndef _LIBCXXABI_NO_EXCEPTIONS @@ -193,7 +193,7 @@ _LIBCXXABI_WEAK void* -operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT +operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept { void* p = nullptr; #ifndef _LIBCXXABI_NO_EXCEPTIONS @@ -212,42 +212,42 @@ _LIBCXXABI_WEAK void -operator delete(void* ptr, std::align_val_t) _NOEXCEPT +operator delete(void* ptr, std::align_val_t) noexcept { std::__libcpp_aligned_free(ptr); } _LIBCXXABI_WEAK void -operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT +operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept { ::operator delete(ptr, alignment); } _LIBCXXABI_WEAK void -operator delete(void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT +operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept { ::operator delete(ptr, alignment); } _LIBCXXABI_WEAK void -operator delete[] (void* ptr, std::align_val_t alignment) _NOEXCEPT +operator delete[] (void* ptr, std::align_val_t alignment) noexcept { ::operator delete(ptr, alignment); } _LIBCXXABI_WEAK void -operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT +operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept { ::operator delete[](ptr, alignment); } _LIBCXXABI_WEAK void -operator delete[] (void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT +operator delete[] (void* ptr, size_t, std::align_val_t alignment) noexcept { ::operator delete[](ptr, alignment); } diff --git a/libcxxabi/src/stdlib_stdexcept.cpp b/libcxxabi/src/stdlib_stdexcept.cpp --- a/libcxxabi/src/stdlib_stdexcept.cpp +++ b/libcxxabi/src/stdlib_stdexcept.cpp @@ -21,29 +21,29 @@ namespace std // purposefully not using versioning namespace { -logic_error::~logic_error() _NOEXCEPT {} +logic_error::~logic_error() noexcept {} const char* -logic_error::what() const _NOEXCEPT +logic_error::what() const noexcept { return __imp_.c_str(); } -runtime_error::~runtime_error() _NOEXCEPT {} +runtime_error::~runtime_error() noexcept {} const char* -runtime_error::what() const _NOEXCEPT +runtime_error::what() const noexcept { return __imp_.c_str(); } -domain_error::~domain_error() _NOEXCEPT {} -invalid_argument::~invalid_argument() _NOEXCEPT {} -length_error::~length_error() _NOEXCEPT {} -out_of_range::~out_of_range() _NOEXCEPT {} +domain_error::~domain_error() noexcept {} +invalid_argument::~invalid_argument() noexcept {} +length_error::~length_error() noexcept {} +out_of_range::~out_of_range() noexcept {} -range_error::~range_error() _NOEXCEPT {} -overflow_error::~overflow_error() _NOEXCEPT {} -underflow_error::~underflow_error() _NOEXCEPT {} +range_error::~range_error() noexcept {} +overflow_error::~overflow_error() noexcept {} +underflow_error::~underflow_error() noexcept {} } // std diff --git a/libcxxabi/src/stdlib_typeinfo.cpp b/libcxxabi/src/stdlib_typeinfo.cpp --- a/libcxxabi/src/stdlib_typeinfo.cpp +++ b/libcxxabi/src/stdlib_typeinfo.cpp @@ -19,32 +19,32 @@ // bad_cast -bad_cast::bad_cast() _NOEXCEPT +bad_cast::bad_cast() noexcept { } -bad_cast::~bad_cast() _NOEXCEPT +bad_cast::~bad_cast() noexcept { } const char* -bad_cast::what() const _NOEXCEPT +bad_cast::what() const noexcept { return "std::bad_cast"; } // bad_typeid -bad_typeid::bad_typeid() _NOEXCEPT +bad_typeid::bad_typeid() noexcept { } -bad_typeid::~bad_typeid() _NOEXCEPT +bad_typeid::~bad_typeid() noexcept { } const char* -bad_typeid::what() const _NOEXCEPT +bad_typeid::what() const noexcept { return "std::bad_typeid"; }