[libc++/abi] Replace uses of _NOEXCEPT in src/ by noexcept

We always build the libraries in a Standard mode that supports noexcept,
so there's no need to use the _NOEXCEPT macro.

Differential Revision: https://reviews.llvm.org/D97700
This commit is contained in:
Louis Dionne 2021-03-01 12:09:45 -05:00
parent 497b7b8c00
commit 5601305fb3
37 changed files with 319 additions and 319 deletions

View File

@ -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 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
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";
}

View File

@ -99,7 +99,7 @@ append8_no_zeros(char* buffer, T v) noexcept
}
char*
__u32toa(uint32_t value, char* buffer) _NOEXCEPT
__u32toa(uint32_t value, char* buffer) noexcept
{
if (value < 100000000)
{
@ -120,7 +120,7 @@ __u32toa(uint32_t value, char* buffer) _NOEXCEPT
}
char*
__u64toa(uint64_t value, char* buffer) _NOEXCEPT
__u64toa(uint64_t value, char* buffer) noexcept
{
if (value < 100000000)
{

View File

@ -107,19 +107,19 @@ static system_clock::time_point __libcpp_system_clock_now() {
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<seconds>(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 @@ static steady_clock::time_point __libcpp_steady_clock_now() {
const bool steady_clock::is_steady;
steady_clock::time_point
steady_clock::now() _NOEXCEPT
steady_clock::now() noexcept
{
return __libcpp_steady_clock_now();
}

View File

@ -24,19 +24,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// ~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<mutex>& lk) _NOEXCEPT
condition_variable::wait(unique_lock<mutex>& lk) noexcept
{
if (!lk.owns_lock())
__throw_system_error(EPERM,
@ -48,7 +48,7 @@ condition_variable::wait(unique_lock<mutex>& lk) _NOEXCEPT
void
condition_variable::__do_timed_wait(unique_lock<mutex>& lk,
chrono::time_point<chrono::system_clock, chrono::nanoseconds> tp) _NOEXCEPT
chrono::time_point<chrono::system_clock, chrono::nanoseconds> tp) noexcept
{
using namespace chrono;
if (!lk.owns_lock())

View File

@ -40,7 +40,7 @@ class _LIBCPP_TYPE_VIS __new_delete_memory_resource_imp
_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 @@ protected:
__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 @@ _LIBCPP_SAFE_STATIC ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX;
} // 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<memory_resource*> __res =
@ -133,12 +133,12 @@ __default_memory_resource(bool set = false, memory_resource * new_res = nullptr)
#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);
}

View File

@ -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";
}

View File

@ -19,12 +19,12 @@ class _LIBCPP_HIDDEN __future_error_category
: 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 @@ __future_error_category::message(int ev) const
#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(error_code __ec)
{
}
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;
}

View File

@ -55,7 +55,7 @@ inline char * data_from_rep(_Rep_base *rep) noexcept {
#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 @@ const char* compute_gcc_empty_string_storage() _NOEXCEPT
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 @@ __libcpp_refstring::__libcpp_refstring(const char* msg) {
}
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 @@ __libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) _NOEXCEPT
}
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_;

View File

@ -27,12 +27,12 @@ class _LIBCPP_HIDDEN __iostream_category
: 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 @@ __iostream_category::message(int ev) const
}
const error_category&
iostream_category() _NOEXCEPT
iostream_category() noexcept
{
static __iostream_category s;
return s;
@ -387,7 +387,7 @@ ios_base::move(ios_base& rhs)
}
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_);

View File

@ -532,13 +532,13 @@ locale::__global()
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 @@ locale::~locale()
}
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 @@ locale::facet::~facet()
}
void
locale::facet::__on_zero_shared() _NOEXCEPT
locale::facet::__on_zero_shared() noexcept
{
delete this;
}
@ -1051,7 +1051,7 @@ extern "C" const int ** __ctype_toupper_loc();
#ifdef _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
const ctype<char>::mask*
ctype<char>::classic_table() _NOEXCEPT
ctype<char>::classic_table() noexcept
{
static _LIBCPP_CONSTEXPR const ctype<char>::mask builtin_table[table_size] = {
cntrl, cntrl,
@ -1131,7 +1131,7 @@ ctype<char>::classic_table() _NOEXCEPT
}
#else
const ctype<char>::mask*
ctype<char>::classic_table() _NOEXCEPT
ctype<char>::classic_table() noexcept
{
#if defined(__APPLE__) || defined(__FreeBSD__)
return _DefaultRuneLocale.__runetype;
@ -1163,38 +1163,38 @@ ctype<char>::classic_table() _NOEXCEPT
#if defined(__GLIBC__)
const int*
ctype<char>::__classic_lower_table() _NOEXCEPT
ctype<char>::__classic_lower_table() noexcept
{
return _LIBCPP_GET_C_LOCALE->__ctype_tolower;
}
const int*
ctype<char>::__classic_upper_table() _NOEXCEPT
ctype<char>::__classic_upper_table() noexcept
{
return _LIBCPP_GET_C_LOCALE->__ctype_toupper;
}
#elif defined(__NetBSD__)
const short*
ctype<char>::__classic_lower_table() _NOEXCEPT
ctype<char>::__classic_lower_table() noexcept
{
return _C_tolower_tab_ + 1;
}
const short*
ctype<char>::__classic_upper_table() _NOEXCEPT
ctype<char>::__classic_upper_table() noexcept
{
return _C_toupper_tab_ + 1;
}
#elif defined(__EMSCRIPTEN__)
const int*
ctype<char>::__classic_lower_table() _NOEXCEPT
ctype<char>::__classic_lower_table() noexcept
{
return *__ctype_tolower_loc();
}
const int*
ctype<char>::__classic_upper_table() _NOEXCEPT
ctype<char>::__classic_upper_table() noexcept
{
return *__ctype_toupper_loc();
}
@ -1492,13 +1492,13 @@ codecvt<char, char, mbstate_t>::do_unshift(state_type&,
}
int
codecvt<char, char, mbstate_t>::do_encoding() const _NOEXCEPT
codecvt<char, char, mbstate_t>::do_encoding() const noexcept
{
return 1;
}
bool
codecvt<char, char, mbstate_t>::do_always_noconv() const _NOEXCEPT
codecvt<char, char, mbstate_t>::do_always_noconv() const noexcept
{
return true;
}
@ -1511,7 +1511,7 @@ codecvt<char, char, mbstate_t>::do_length(state_type&,
}
int
codecvt<char, char, mbstate_t>::do_max_length() const _NOEXCEPT
codecvt<char, char, mbstate_t>::do_max_length() const noexcept
{
return 1;
}
@ -1682,7 +1682,7 @@ codecvt<wchar_t, char, mbstate_t>::do_unshift(state_type& st,
}
int
codecvt<wchar_t, char, mbstate_t>::do_encoding() const _NOEXCEPT
codecvt<wchar_t, char, mbstate_t>::do_encoding() const noexcept
{
if (__libcpp_mbtowc_l(nullptr, nullptr, MB_LEN_MAX, __l) != 0)
return -1;
@ -1694,7 +1694,7 @@ codecvt<wchar_t, char, mbstate_t>::do_encoding() const _NOEXCEPT
}
bool
codecvt<wchar_t, char, mbstate_t>::do_always_noconv() const _NOEXCEPT
codecvt<wchar_t, char, mbstate_t>::do_always_noconv() const noexcept
{
return false;
}
@ -1726,7 +1726,7 @@ codecvt<wchar_t, char, mbstate_t>::do_length(state_type& st,
}
int
codecvt<wchar_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
codecvt<wchar_t, char, mbstate_t>::do_max_length() const noexcept
{
return __l == 0 ? 1 : static_cast<int>(__libcpp_mb_cur_max_l(__l));
}
@ -3169,13 +3169,13 @@ codecvt<char16_t, char, mbstate_t>::do_unshift(state_type&,
}
int
codecvt<char16_t, char, mbstate_t>::do_encoding() const _NOEXCEPT
codecvt<char16_t, char, mbstate_t>::do_encoding() const noexcept
{
return 0;
}
bool
codecvt<char16_t, char, mbstate_t>::do_always_noconv() const _NOEXCEPT
codecvt<char16_t, char, mbstate_t>::do_always_noconv() const noexcept
{
return false;
}
@ -3190,7 +3190,7 @@ codecvt<char16_t, char, mbstate_t>::do_length(state_type&,
}
int
codecvt<char16_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
codecvt<char16_t, char, mbstate_t>::do_max_length() const noexcept
{
return 4;
}
@ -3248,13 +3248,13 @@ codecvt<char16_t, char8_t, mbstate_t>::do_unshift(state_type&,
}
int
codecvt<char16_t, char8_t, mbstate_t>::do_encoding() const _NOEXCEPT
codecvt<char16_t, char8_t, mbstate_t>::do_encoding() const noexcept
{
return 0;
}
bool
codecvt<char16_t, char8_t, mbstate_t>::do_always_noconv() const _NOEXCEPT
codecvt<char16_t, char8_t, mbstate_t>::do_always_noconv() const noexcept
{
return false;
}
@ -3269,7 +3269,7 @@ codecvt<char16_t, char8_t, mbstate_t>::do_length(state_type&,
}
int
codecvt<char16_t, char8_t, mbstate_t>::do_max_length() const _NOEXCEPT
codecvt<char16_t, char8_t, mbstate_t>::do_max_length() const noexcept
{
return 4;
}
@ -3327,13 +3327,13 @@ codecvt<char32_t, char, mbstate_t>::do_unshift(state_type&,
}
int
codecvt<char32_t, char, mbstate_t>::do_encoding() const _NOEXCEPT
codecvt<char32_t, char, mbstate_t>::do_encoding() const noexcept
{
return 0;
}
bool
codecvt<char32_t, char, mbstate_t>::do_always_noconv() const _NOEXCEPT
codecvt<char32_t, char, mbstate_t>::do_always_noconv() const noexcept
{
return false;
}
@ -3348,7 +3348,7 @@ codecvt<char32_t, char, mbstate_t>::do_length(state_type&,
}
int
codecvt<char32_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
codecvt<char32_t, char, mbstate_t>::do_max_length() const noexcept
{
return 4;
}
@ -3406,13 +3406,13 @@ codecvt<char32_t, char8_t, mbstate_t>::do_unshift(state_type&,
}
int
codecvt<char32_t, char8_t, mbstate_t>::do_encoding() const _NOEXCEPT
codecvt<char32_t, char8_t, mbstate_t>::do_encoding() const noexcept
{
return 0;
}
bool
codecvt<char32_t, char8_t, mbstate_t>::do_always_noconv() const _NOEXCEPT
codecvt<char32_t, char8_t, mbstate_t>::do_always_noconv() const noexcept
{
return false;
}
@ -3427,7 +3427,7 @@ codecvt<char32_t, char8_t, mbstate_t>::do_length(state_type&,
}
int
codecvt<char32_t, char8_t, mbstate_t>::do_max_length() const _NOEXCEPT
codecvt<char32_t, char8_t, mbstate_t>::do_max_length() const noexcept
{
return 4;
}
@ -3500,13 +3500,13 @@ __codecvt_utf8<wchar_t>::do_unshift(state_type&,
}
int
__codecvt_utf8<wchar_t>::do_encoding() const _NOEXCEPT
__codecvt_utf8<wchar_t>::do_encoding() const noexcept
{
return 0;
}
bool
__codecvt_utf8<wchar_t>::do_always_noconv() const _NOEXCEPT
__codecvt_utf8<wchar_t>::do_always_noconv() const noexcept
{
return false;
}
@ -3521,7 +3521,7 @@ __codecvt_utf8<wchar_t>::do_length(state_type&,
}
int
__codecvt_utf8<wchar_t>::do_max_length() const _NOEXCEPT
__codecvt_utf8<wchar_t>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 7;
@ -3575,13 +3575,13 @@ __codecvt_utf8<char16_t>::do_unshift(state_type&,
}
int
__codecvt_utf8<char16_t>::do_encoding() const _NOEXCEPT
__codecvt_utf8<char16_t>::do_encoding() const noexcept
{
return 0;
}
bool
__codecvt_utf8<char16_t>::do_always_noconv() const _NOEXCEPT
__codecvt_utf8<char16_t>::do_always_noconv() const noexcept
{
return false;
}
@ -3596,7 +3596,7 @@ __codecvt_utf8<char16_t>::do_length(state_type&,
}
int
__codecvt_utf8<char16_t>::do_max_length() const _NOEXCEPT
__codecvt_utf8<char16_t>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 6;
@ -3650,13 +3650,13 @@ __codecvt_utf8<char32_t>::do_unshift(state_type&,
}
int
__codecvt_utf8<char32_t>::do_encoding() const _NOEXCEPT
__codecvt_utf8<char32_t>::do_encoding() const noexcept
{
return 0;
}
bool
__codecvt_utf8<char32_t>::do_always_noconv() const _NOEXCEPT
__codecvt_utf8<char32_t>::do_always_noconv() const noexcept
{
return false;
}
@ -3671,7 +3671,7 @@ __codecvt_utf8<char32_t>::do_length(state_type&,
}
int
__codecvt_utf8<char32_t>::do_max_length() const _NOEXCEPT
__codecvt_utf8<char32_t>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 7;
@ -3725,13 +3725,13 @@ __codecvt_utf16<wchar_t, false>::do_unshift(state_type&,
}
int
__codecvt_utf16<wchar_t, false>::do_encoding() const _NOEXCEPT
__codecvt_utf16<wchar_t, false>::do_encoding() const noexcept
{
return 0;
}
bool
__codecvt_utf16<wchar_t, false>::do_always_noconv() const _NOEXCEPT
__codecvt_utf16<wchar_t, false>::do_always_noconv() const noexcept
{
return false;
}
@ -3746,7 +3746,7 @@ __codecvt_utf16<wchar_t, false>::do_length(state_type&,
}
int
__codecvt_utf16<wchar_t, false>::do_max_length() const _NOEXCEPT
__codecvt_utf16<wchar_t, false>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 6;
@ -3800,13 +3800,13 @@ __codecvt_utf16<wchar_t, true>::do_unshift(state_type&,
}
int
__codecvt_utf16<wchar_t, true>::do_encoding() const _NOEXCEPT
__codecvt_utf16<wchar_t, true>::do_encoding() const noexcept
{
return 0;
}
bool
__codecvt_utf16<wchar_t, true>::do_always_noconv() const _NOEXCEPT
__codecvt_utf16<wchar_t, true>::do_always_noconv() const noexcept
{
return false;
}
@ -3821,7 +3821,7 @@ __codecvt_utf16<wchar_t, true>::do_length(state_type&,
}
int
__codecvt_utf16<wchar_t, true>::do_max_length() const _NOEXCEPT
__codecvt_utf16<wchar_t, true>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 6;
@ -3875,13 +3875,13 @@ __codecvt_utf16<char16_t, false>::do_unshift(state_type&,
}
int
__codecvt_utf16<char16_t, false>::do_encoding() const _NOEXCEPT
__codecvt_utf16<char16_t, false>::do_encoding() const noexcept
{
return 0;
}
bool
__codecvt_utf16<char16_t, false>::do_always_noconv() const _NOEXCEPT
__codecvt_utf16<char16_t, false>::do_always_noconv() const noexcept
{
return false;
}
@ -3896,7 +3896,7 @@ __codecvt_utf16<char16_t, false>::do_length(state_type&,
}
int
__codecvt_utf16<char16_t, false>::do_max_length() const _NOEXCEPT
__codecvt_utf16<char16_t, false>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 4;
@ -3950,13 +3950,13 @@ __codecvt_utf16<char16_t, true>::do_unshift(state_type&,
}
int
__codecvt_utf16<char16_t, true>::do_encoding() const _NOEXCEPT
__codecvt_utf16<char16_t, true>::do_encoding() const noexcept
{
return 0;
}
bool
__codecvt_utf16<char16_t, true>::do_always_noconv() const _NOEXCEPT
__codecvt_utf16<char16_t, true>::do_always_noconv() const noexcept
{
return false;
}
@ -3971,7 +3971,7 @@ __codecvt_utf16<char16_t, true>::do_length(state_type&,
}
int
__codecvt_utf16<char16_t, true>::do_max_length() const _NOEXCEPT
__codecvt_utf16<char16_t, true>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 4;
@ -4025,13 +4025,13 @@ __codecvt_utf16<char32_t, false>::do_unshift(state_type&,
}
int
__codecvt_utf16<char32_t, false>::do_encoding() const _NOEXCEPT
__codecvt_utf16<char32_t, false>::do_encoding() const noexcept
{
return 0;
}
bool
__codecvt_utf16<char32_t, false>::do_always_noconv() const _NOEXCEPT
__codecvt_utf16<char32_t, false>::do_always_noconv() const noexcept
{
return false;
}
@ -4046,7 +4046,7 @@ __codecvt_utf16<char32_t, false>::do_length(state_type&,
}
int
__codecvt_utf16<char32_t, false>::do_max_length() const _NOEXCEPT
__codecvt_utf16<char32_t, false>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 6;
@ -4100,13 +4100,13 @@ __codecvt_utf16<char32_t, true>::do_unshift(state_type&,
}
int
__codecvt_utf16<char32_t, true>::do_encoding() const _NOEXCEPT
__codecvt_utf16<char32_t, true>::do_encoding() const noexcept
{
return 0;
}
bool
__codecvt_utf16<char32_t, true>::do_always_noconv() const _NOEXCEPT
__codecvt_utf16<char32_t, true>::do_always_noconv() const noexcept
{
return false;
}
@ -4121,7 +4121,7 @@ __codecvt_utf16<char32_t, true>::do_length(state_type&,
}
int
__codecvt_utf16<char32_t, true>::do_max_length() const _NOEXCEPT
__codecvt_utf16<char32_t, true>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 6;
@ -4175,13 +4175,13 @@ __codecvt_utf8_utf16<wchar_t>::do_unshift(state_type&,
}
int
__codecvt_utf8_utf16<wchar_t>::do_encoding() const _NOEXCEPT
__codecvt_utf8_utf16<wchar_t>::do_encoding() const noexcept
{
return 0;
}
bool
__codecvt_utf8_utf16<wchar_t>::do_always_noconv() const _NOEXCEPT
__codecvt_utf8_utf16<wchar_t>::do_always_noconv() const noexcept
{
return false;
}
@ -4196,7 +4196,7 @@ __codecvt_utf8_utf16<wchar_t>::do_length(state_type&,
}
int
__codecvt_utf8_utf16<wchar_t>::do_max_length() const _NOEXCEPT
__codecvt_utf8_utf16<wchar_t>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 7;
@ -4250,13 +4250,13 @@ __codecvt_utf8_utf16<char16_t>::do_unshift(state_type&,
}
int
__codecvt_utf8_utf16<char16_t>::do_encoding() const _NOEXCEPT
__codecvt_utf8_utf16<char16_t>::do_encoding() const noexcept
{
return 0;
}
bool
__codecvt_utf8_utf16<char16_t>::do_always_noconv() const _NOEXCEPT
__codecvt_utf8_utf16<char16_t>::do_always_noconv() const noexcept
{
return false;
}
@ -4271,7 +4271,7 @@ __codecvt_utf8_utf16<char16_t>::do_length(state_type&,
}
int
__codecvt_utf8_utf16<char16_t>::do_max_length() const _NOEXCEPT
__codecvt_utf8_utf16<char16_t>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 7;
@ -4325,13 +4325,13 @@ __codecvt_utf8_utf16<char32_t>::do_unshift(state_type&,
}
int
__codecvt_utf8_utf16<char32_t>::do_encoding() const _NOEXCEPT
__codecvt_utf8_utf16<char32_t>::do_encoding() const noexcept
{
return 0;
}
bool
__codecvt_utf8_utf16<char32_t>::do_always_noconv() const _NOEXCEPT
__codecvt_utf8_utf16<char32_t>::do_always_noconv() const noexcept
{
return false;
}
@ -4346,7 +4346,7 @@ __codecvt_utf8_utf16<char32_t>::do_length(state_type&,
}
int
__codecvt_utf8_utf16<char32_t>::do_max_length() const _NOEXCEPT
__codecvt_utf8_utf16<char32_t>::do_max_length() const noexcept
{
if (_Mode_ & consume_header)
return 7;

View File

@ -20,10 +20,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
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 @@ __shared_weak_count::~__shared_weak_count()
#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 @@ __shared_count::__release_shared() _NOEXCEPT
}
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 @@ __shared_weak_count::__release_shared() _NOEXCEPT
#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::__release_weak() _NOEXCEPT
}
__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 @@ __shared_weak_count::lock() _NOEXCEPT
}
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_SAFE_STATIC static __libcpp_mutex_t mut_back[__sp_mut_count] =
_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 @@ __sp_mut::lock() _NOEXCEPT
}
void
__sp_mut::unlock() _NOEXCEPT
__sp_mut::unlock() noexcept
{
__libcpp_mutex_unlock(static_cast<__libcpp_mutex_t*>(__lx));
}
@ -199,7 +199,7 @@ undeclare_no_pointers(char*, size_t)
}
#if !defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE)
pointer_safety get_pointer_safety() _NOEXCEPT
pointer_safety get_pointer_safety() noexcept
{
return pointer_safety::relaxed;
}

View File

@ -36,13 +36,13 @@ mutex::lock()
}
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 @@ recursive_mutex::lock()
}
void
recursive_mutex::unlock() _NOEXCEPT
recursive_mutex::unlock() noexcept
{
int e = __libcpp_recursive_mutex_unlock(&__m_);
(void)e;
@ -82,7 +82,7 @@ recursive_mutex::unlock() _NOEXCEPT
}
bool
recursive_mutex::try_lock() _NOEXCEPT
recursive_mutex::try_lock() noexcept
{
return __libcpp_recursive_mutex_trylock(&__m_);
}
@ -109,7 +109,7 @@ timed_mutex::lock()
}
bool
timed_mutex::try_lock() _NOEXCEPT
timed_mutex::try_lock() noexcept
{
unique_lock<mutex> lk(__m_, try_to_lock);
if (lk.owns_lock() && !__locked_)
@ -121,7 +121,7 @@ timed_mutex::try_lock() _NOEXCEPT
}
void
timed_mutex::unlock() _NOEXCEPT
timed_mutex::unlock() noexcept
{
lock_guard<mutex> _(__m_);
__locked_ = false;
@ -160,7 +160,7 @@ recursive_timed_mutex::lock()
}
bool
recursive_timed_mutex::try_lock() _NOEXCEPT
recursive_timed_mutex::try_lock() noexcept
{
__thread_id id = this_thread::get_id();
unique_lock<mutex> lk(__m_, try_to_lock);
@ -176,7 +176,7 @@ recursive_timed_mutex::try_lock() _NOEXCEPT
}
void
recursive_timed_mutex::unlock() _NOEXCEPT
recursive_timed_mutex::unlock() noexcept
{
unique_lock<mutex> lk(__m_);
if (--__count_ == 0)

View File

@ -41,7 +41,7 @@ public:
};
mutex::~mutex() _NOEXCEPT
mutex::~mutex() noexcept
{
__libcpp_mutex_destroy(&__m_);
}

View File

@ -83,7 +83,7 @@ operator new(std::size_t size) _THROW_BAD_ALLOC
_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 @@ operator new[](size_t size) _THROW_BAD_ALLOC
_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 @@ operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
_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 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
_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 @@ operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
_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 @@ operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _
_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);
}

View File

@ -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 @@ public:
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

View File

@ -175,7 +175,7 @@ random_device::operator()()
#endif
double
random_device::entropy() const _NOEXCEPT
random_device::entropy() const noexcept
{
#if defined(_LIBCPP_USING_DEV_RANDOM) && defined(RNDGETENTCNT)
int ent;

View File

@ -17,13 +17,13 @@ _LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler;
// 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 @@ void unexpected()
}
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 @@ terminate() _NOEXCEPT
#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 @@ int uncaught_exceptions() _NOEXCEPT
}
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";
}

View File

@ -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
{
}

View File

@ -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();

View File

@ -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";
}

View File

@ -31,11 +31,11 @@ int __cdecl __uncaught_exceptions();
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 @@ void unexpected() {
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 @@ void terminate() _NOEXCEPT
#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";
}

View File

@ -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 @@ exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT
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 @@ nested_exception::rethrow_nested() const
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:

View File

@ -25,35 +25,35 @@ struct exception_ptr
{
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<void*>(this)) __exception_ptr::exception_ptr(
reinterpret_cast<const __exception_ptr::exception_ptr&>(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<const __exception_ptr::exception_ptr&>(other);
return *this;
}
nested_exception::nested_exception() _NOEXCEPT
nested_exception::nested_exception() noexcept
: __ptr_(current_exception())
{
}

View File

@ -24,35 +24,35 @@ __ExceptionPtrCopyException(void*, const void*, const void*);
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 @@ exception_ptr __copy_exception_ptr(void* __except, const void* __ptr) {
return __ret;
}
exception_ptr current_exception() _NOEXCEPT {
exception_ptr current_exception() noexcept {
exception_ptr __ret;
__ExceptionPtrCurrentException(&__ret);
return __ret;
@ -72,9 +72,9 @@ exception_ptr current_exception() _NOEXCEPT {
_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 {

View File

@ -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 @@ exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
::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 @@ nested_exception::rethrow_nested() const
#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");

View File

@ -12,13 +12,13 @@ namespace std {
_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);
}

View File

@ -23,9 +23,9 @@ logic_error::logic_error(const string& msg) : __imp_(msg.c_str()) {}
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 string& msg) : __imp_(msg.c_str()) {}
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

View File

@ -28,29 +28,29 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// 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 @@ class _LIBCPP_HIDDEN __generic_error_category
: 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 @@ __generic_error_category::message(int ev) const
}
const error_category&
generic_category() _NOEXCEPT
generic_category() noexcept
{
static __generic_error_category s;
return s;
@ -172,13 +172,13 @@ class _LIBCPP_HIDDEN __system_error_category
: 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 @@ __system_error_category::message(int ev) const
}
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 @@ __system_error_category::default_error_condition(int ev) const _NOEXCEPT
}
const error_category&
system_category() _NOEXCEPT
system_category() noexcept
{
static __system_error_category s;
return s;
@ -276,7 +276,7 @@ system_error::system_error(int ev, const error_category& ecat)
{
}
system_error::~system_error() _NOEXCEPT
system_error::~system_error() noexcept
{
}

View File

@ -70,7 +70,7 @@ thread::detach()
}
unsigned
thread::hardware_concurrency() _NOEXCEPT
thread::hardware_concurrency() noexcept
{
#if defined(_SC_NPROCESSORS_ONLN)
long result = sysconf(_SC_NPROCESSORS_ONLN);

View File

@ -11,18 +11,18 @@
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_ABI_VCRUNTIME)
#include <string.h>
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;

View File

@ -108,7 +108,7 @@ namespace std
{
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 @@ set_unexpected(unexpected_handler func) _NOEXCEPT
}
terminate_handler
set_terminate(terminate_handler func) _NOEXCEPT
set_terminate(terminate_handler func) noexcept
{
if (func == 0)
func = default_terminate_handler;

View File

@ -23,7 +23,7 @@ namespace std
{
unexpected_handler
get_unexpected() _NOEXCEPT
get_unexpected() noexcept
{
return __libcpp_atomic_load(&__cxa_unexpected_handler, _AO_Acquire);
}
@ -44,13 +44,13 @@ unexpected()
}
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 @@ __terminate(terminate_handler func) _NOEXCEPT
__attribute__((noreturn))
void
terminate() _NOEXCEPT
terminate() noexcept
{
#ifndef _LIBCXXABI_NO_EXCEPTIONS
// If there might be an uncaught exception
@ -97,13 +97,13 @@ new_handler __cxa_new_handler = 0;
}
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);
}

View File

@ -25,7 +25,7 @@ __unexpected(unexpected_handler func);
_LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN
void
__terminate(terminate_handler func) _NOEXCEPT;
__terminate(terminate_handler func) noexcept;
} // std

View File

@ -14,22 +14,22 @@ namespace std
// 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 @@ const char* bad_exception::what() const _NOEXCEPT
// 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";
}

View File

@ -12,8 +12,8 @@
#include <new>
#include <cstdlib>
#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 @@ operator new(std::size_t size) _THROW_BAD_ALLOC
_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 @@ operator new[](size_t size) _THROW_BAD_ALLOC
_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 @@ operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
_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 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
_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 @@ operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
_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 @@ operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _
_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);
}

View File

@ -21,29 +21,29 @@ static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), "");
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

View File

@ -19,32 +19,32 @@ type_info::~type_info()
// 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";
}