Applied noexcept to everything in [language.support] (Chapter 18) git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132129 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/exception b/include/exception index 87f6552..00fc6b8 100644 --- a/include/exception +++ b/include/exception
@@ -20,56 +20,56 @@ class exception { public: - exception() throw(); - exception(const exception&) throw(); - exception& operator=(const exception&) throw(); - virtual ~exception() throw(); - virtual const char* what() const throw(); + exception() noexcept; + exception(const exception&) noexcept; + exception& operator=(const exception&) noexcept; + virtual ~exception() noexcept; + virtual const char* what() const noexcept; }; class bad_exception : public exception { public: - bad_exception() throw(); - bad_exception(const bad_exception&) throw(); - bad_exception& operator=(const bad_exception&) throw(); - virtual ~bad_exception() throw(); - virtual const char* what() const throw(); + bad_exception() noexcept; + bad_exception(const bad_exception&) noexcept; + bad_exception& operator=(const bad_exception&) noexcept; + virtual ~bad_exception() noexcept; + virtual const char* what() const noexcept; }; typedef void (*unexpected_handler)(); -unexpected_handler set_unexpected(unexpected_handler f ) throw(); -unexpected_handler get_unexpected() throw(); -void unexpected [[noreturn]] (); +unexpected_handler set_unexpected(unexpected_handler f ) noexcept; +unexpected_handler get_unexpected() noexcept; +[[noreturn]] void unexpected(); typedef void (*terminate_handler)(); -terminate_handler set_terminate(terminate_handler f ) throw(); -terminate_handler get_terminate() throw(); -void terminate [[noreturn]] (); +terminate_handler set_terminate(terminate_handler f ) noexcept; +terminate_handler get_terminate() noexcept; +[[noreturn]] void terminate() noexcept; -bool uncaught_exception() throw(); +bool uncaught_exception() noexcept; typedef unspecified exception_ptr; -exception_ptr current_exception(); +exception_ptr current_exception() noexcept; void rethrow_exception [[noreturn]] (exception_ptr p); -template<class E> exception_ptr make_exception_ptr(E e); +template<class E> exception_ptr make_exception_ptr(E e) noexcept; class nested_exception { public: - nested_exception() throw(); - nested_exception(const nested_exception&) throw() = default; - nested_exception& operator=(const nested_exception&) throw() = default; + nested_exception() noexcept; + nested_exception(const nested_exception&) noexcept = default; + nested_exception& operator=(const nested_exception&) noexcept = default; virtual ~nested_exception() = default; // access functions - void rethrow_nested [[noreturn]] () const; - exception_ptr nested_ptr() const; + [[noreturn]] void rethrow_nested() const; + exception_ptr nested_ptr() const noexcept; }; -template <class T> void throw_with_nested [[noreturn]] (T&& t); +template <class T> [[noreturn]] void throw_with_nested(T&& t); template <class E> void rethrow_if_nested(const E& e); } // std @@ -88,65 +88,65 @@ class _LIBCPP_EXCEPTION_ABI exception { public: - _LIBCPP_INLINE_VISIBILITY exception() throw() {} - virtual ~exception() throw(); - virtual const char* what() const throw(); + _LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {} + virtual ~exception() _NOEXCEPT; + virtual const char* what() const _NOEXCEPT; }; class _LIBCPP_EXCEPTION_ABI bad_exception : public exception { public: - _LIBCPP_INLINE_VISIBILITY bad_exception() throw() {} - virtual ~bad_exception() throw(); - virtual const char* what() const throw(); + _LIBCPP_INLINE_VISIBILITY bad_exception() _NOEXCEPT {} + virtual ~bad_exception() _NOEXCEPT; + virtual const char* what() const _NOEXCEPT; }; typedef void (*unexpected_handler)(); -_LIBCPP_VISIBLE unexpected_handler set_unexpected(unexpected_handler) throw(); -_LIBCPP_VISIBLE unexpected_handler get_unexpected() throw(); +_LIBCPP_VISIBLE unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT; +_LIBCPP_VISIBLE unexpected_handler get_unexpected() _NOEXCEPT; _ATTRIBUTE(noreturn) _LIBCPP_VISIBLE void unexpected(); typedef void (*terminate_handler)(); -_LIBCPP_VISIBLE terminate_handler set_terminate(terminate_handler) throw(); -_LIBCPP_VISIBLE terminate_handler get_terminate() throw(); +_LIBCPP_VISIBLE terminate_handler set_terminate(terminate_handler) _NOEXCEPT; +_LIBCPP_VISIBLE terminate_handler get_terminate() _NOEXCEPT; _ATTRIBUTE(noreturn) _LIBCPP_VISIBLE void terminate() _NOEXCEPT; -_LIBCPP_VISIBLE bool uncaught_exception() throw(); +_LIBCPP_VISIBLE bool uncaught_exception() _NOEXCEPT; class exception_ptr; -exception_ptr current_exception(); +exception_ptr current_exception() _NOEXCEPT; _ATTRIBUTE(noreturn) void rethrow_exception(exception_ptr); class _LIBCPP_VISIBLE exception_ptr { void* __ptr_; public: - _LIBCPP_INLINE_VISIBILITY exception_ptr() : __ptr_() {} - _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) : __ptr_() {} - exception_ptr(const exception_ptr&); - exception_ptr& operator=(const exception_ptr&); - ~exception_ptr(); + _LIBCPP_INLINE_VISIBILITY exception_ptr() _NOEXCEPT : __ptr_() {} + _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {} + exception_ptr(const exception_ptr&) _NOEXCEPT; + exception_ptr& operator=(const exception_ptr&) _NOEXCEPT; + ~exception_ptr() _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY // explicit - operator bool() const {return __ptr_ != nullptr;} + operator bool() const _NOEXCEPT {return __ptr_ != nullptr;} friend _LIBCPP_INLINE_VISIBILITY - bool operator==(const exception_ptr& __x, const exception_ptr& __y) + bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT {return __x.__ptr_ == __y.__ptr_;} friend _LIBCPP_INLINE_VISIBILITY - bool operator!=(const exception_ptr& __x, const exception_ptr& __y) + bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT {return !(__x == __y);} - friend exception_ptr current_exception(); + friend exception_ptr current_exception() _NOEXCEPT; _ATTRIBUTE(noreturn) friend void rethrow_exception(exception_ptr); }; template<class _E> exception_ptr -make_exception_ptr(_E __e) +make_exception_ptr(_E __e) _NOEXCEPT { #ifndef _LIBCPP_NO_EXCEPTIONS try @@ -166,14 +166,14 @@ { exception_ptr __ptr_; public: - nested_exception(); -// nested_exception(const nested_exception&) throw() = default; -// nested_exception& operator=(const nested_exception&) throw() = default; - virtual ~nested_exception(); + nested_exception() _NOEXCEPT; +// nested_exception(const nested_exception&) noexcept = default; +// nested_exception& operator=(const nested_exception&) noexcept = default; + virtual ~nested_exception() _NOEXCEPT; // access functions _ATTRIBUTE(noreturn) void rethrow_nested() const; - _LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const {return __ptr_;} + _LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const _NOEXCEPT {return __ptr_;} }; template <class _Tp>
diff --git a/include/initializer_list b/include/initializer_list index 83eb8f4..f1bea94 100644 --- a/include/initializer_list +++ b/include/initializer_list
@@ -29,15 +29,15 @@ typedef const E* iterator; typedef const E* const_iterator; - initializer_list(); + initializer_list() noexcept; - size_t size() const; - const E* begin() const; - const E* end() const; + size_t size() const noexcept; + const E* begin() const noexcept; + const E* end() const noexcept; }; -template<class E> const E* begin(initializer_list<E> il); -template<class E> const E* end(initializer_list<E> il); +template<class E> const E* begin(initializer_list<E> il) noexcept; +template<class E> const E* end(initializer_list<E> il) noexcept; } // std @@ -58,7 +58,7 @@ size_t __size_; _LIBCPP_ALWAYS_INLINE - initializer_list(const _E* __b, size_t __s) + initializer_list(const _E* __b, size_t __s) _NOEXCEPT : __begin_(__b), __size_(__s) {} @@ -71,17 +71,17 @@ typedef const _E* iterator; typedef const _E* const_iterator; - _LIBCPP_ALWAYS_INLINE initializer_list() : __begin_(nullptr), __size_(0) {} + _LIBCPP_ALWAYS_INLINE initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {} - _LIBCPP_ALWAYS_INLINE size_t size() const {return __size_;} - _LIBCPP_ALWAYS_INLINE const _E* begin() const {return __begin_;} - _LIBCPP_ALWAYS_INLINE const _E* end() const {return __begin_ + __size_;} + _LIBCPP_ALWAYS_INLINE size_t size() const _NOEXCEPT {return __size_;} + _LIBCPP_ALWAYS_INLINE const _E* begin() const _NOEXCEPT {return __begin_;} + _LIBCPP_ALWAYS_INLINE const _E* end() const _NOEXCEPT {return __begin_ + __size_;} }; template<class _E> inline _LIBCPP_INLINE_VISIBILITY const _E* -begin(initializer_list<_E> __il) +begin(initializer_list<_E> __il) _NOEXCEPT { return __il.begin(); } @@ -89,7 +89,7 @@ template<class _E> inline _LIBCPP_INLINE_VISIBILITY const _E* -end(initializer_list<_E> __il) +end(initializer_list<_E> __il) _NOEXCEPT { return __il.end(); }
diff --git a/include/limits b/include/limits index f3d42f7..989964e 100644 --- a/include/limits +++ b/include/limits
@@ -22,9 +22,9 @@ { public: static const bool is_specialized = false; - static T min() throw(); - static T max() throw(); - static T lowest() throw(); + static T min() noexcept; + static T max() noexcept; + static T lowest() noexcept; static const int digits = 0; static const int digits10 = 0; @@ -33,8 +33,8 @@ static const bool is_integer = false; static const bool is_exact = false; static const int radix = 0; - static T epsilon() throw(); - static T round_error() throw(); + static T epsilon() noexcept; + static T round_error() noexcept; static const int min_exponent = 0; static const int min_exponent10 = 0; @@ -46,10 +46,10 @@ static const bool has_signaling_NaN = false; static const float_denorm_style has_denorm = denorm_absent; static const bool has_denorm_loss = false; - static T infinity() throw(); - static T quiet_NaN() throw(); - static T signaling_NaN() throw(); - static T denorm_min() throw(); + static T infinity() noexcept; + static T quiet_NaN() noexcept; + static T signaling_NaN() noexcept; + static T denorm_min() noexcept; static const bool is_iec559 = false; static const bool is_bounded = false; @@ -132,9 +132,9 @@ typedef _Tp type; static const bool is_specialized = false; - _LIBCPP_INLINE_VISIBILITY static type min() throw() {return type();} - _LIBCPP_INLINE_VISIBILITY static type max() throw() {return type();} - _LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return type();} + _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return type();} + _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return type();} + _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return type();} static const int digits = 0; static const int digits10 = 0; @@ -143,8 +143,8 @@ static const bool is_integer = false; static const bool is_exact = false; static const int radix = 0; - _LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return type();} - _LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return type();} + _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return type();} + _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return type();} static const int min_exponent = 0; static const int min_exponent10 = 0; @@ -156,10 +156,10 @@ static const bool has_signaling_NaN = false; static const float_denorm_style has_denorm = denorm_absent; static const bool has_denorm_loss = false; - _LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return type();} - _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return type();} - _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return type();} - _LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return type();} + _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return type();} + _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return type();} + _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return type();} + _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return type();} static const bool is_iec559 = false; static const bool is_bounded = false; @@ -196,15 +196,15 @@ static const int max_digits10 = 0; static const type __min = __libcpp_compute_min<type, digits, is_signed>::value; static const type __max = is_signed ? type(type(~0) ^ __min) : type(~0); - _LIBCPP_INLINE_VISIBILITY static type min() throw() {return __min;} - _LIBCPP_INLINE_VISIBILITY static type max() throw() {return __max;} - _LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return min();} + _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __min;} + _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __max;} + _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return min();} static const bool is_integer = true; static const bool is_exact = true; static const int radix = 2; - _LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return type(0);} - _LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return type(0);} + _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return type(0);} + _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return type(0);} static const int min_exponent = 0; static const int min_exponent10 = 0; @@ -216,10 +216,10 @@ static const bool has_signaling_NaN = false; static const float_denorm_style has_denorm = denorm_absent; static const bool has_denorm_loss = false; - _LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return type(0);} - _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return type(0);} - _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return type(0);} - _LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return type(0);} + _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return type(0);} + _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return type(0);} + _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return type(0);} + _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return type(0);} static const bool is_iec559 = false; static const bool is_bounded = true; @@ -248,15 +248,15 @@ static const int max_digits10 = 0; static const type __min = false; static const type __max = true; - _LIBCPP_INLINE_VISIBILITY static type min() throw() {return __min;} - _LIBCPP_INLINE_VISIBILITY static type max() throw() {return __max;} - _LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return min();} + _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __min;} + _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __max;} + _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return min();} static const bool is_integer = true; static const bool is_exact = true; static const int radix = 2; - _LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return type(0);} - _LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return type(0);} + _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return type(0);} + _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return type(0);} static const int min_exponent = 0; static const int min_exponent10 = 0; @@ -268,10 +268,10 @@ static const bool has_signaling_NaN = false; static const float_denorm_style has_denorm = denorm_absent; static const bool has_denorm_loss = false; - _LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return type(0);} - _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return type(0);} - _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return type(0);} - _LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return type(0);} + _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return type(0);} + _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return type(0);} + _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return type(0);} + _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return type(0);} static const bool is_iec559 = false; static const bool is_bounded = true; @@ -294,15 +294,15 @@ static const int digits = __FLT_MANT_DIG__; static const int digits10 = __FLT_DIG__; static const int max_digits10 = 2+(digits * 30103)/100000; - _LIBCPP_INLINE_VISIBILITY static type min() throw() {return __FLT_MIN__;} - _LIBCPP_INLINE_VISIBILITY static type max() throw() {return __FLT_MAX__;} - _LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return -max();} + _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __FLT_MIN__;} + _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __FLT_MAX__;} + _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return -max();} static const bool is_integer = false; static const bool is_exact = false; static const int radix = __FLT_RADIX__; - _LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __FLT_EPSILON__;} - _LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return 0.5F;} + _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __FLT_EPSILON__;} + _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return 0.5F;} static const int min_exponent = __FLT_MIN_EXP__; static const int min_exponent10 = __FLT_MIN_10_EXP__; @@ -314,10 +314,10 @@ static const bool has_signaling_NaN = true; static const float_denorm_style has_denorm = denorm_present; static const bool has_denorm_loss = false; - _LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __builtin_huge_valf();} - _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __builtin_nanf("");} - _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __builtin_nansf("");} - _LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __FLT_DENORM_MIN__;} + _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __builtin_huge_valf();} + _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __builtin_nanf("");} + _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __builtin_nansf("");} + _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __FLT_DENORM_MIN__;} static const bool is_iec559 = true; static const bool is_bounded = true; @@ -340,15 +340,15 @@ static const int digits = __DBL_MANT_DIG__; static const int digits10 = __DBL_DIG__; static const int max_digits10 = 2+(digits * 30103)/100000; - _LIBCPP_INLINE_VISIBILITY static type min() throw() {return __DBL_MIN__;} - _LIBCPP_INLINE_VISIBILITY static type max() throw() {return __DBL_MAX__;} - _LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return -max();} + _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __DBL_MIN__;} + _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __DBL_MAX__;} + _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return -max();} static const bool is_integer = false; static const bool is_exact = false; static const int radix = __FLT_RADIX__; - _LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __DBL_EPSILON__;} - _LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return 0.5;} + _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __DBL_EPSILON__;} + _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return 0.5;} static const int min_exponent = __DBL_MIN_EXP__; static const int min_exponent10 = __DBL_MIN_10_EXP__; @@ -360,10 +360,10 @@ static const bool has_signaling_NaN = true; static const float_denorm_style has_denorm = denorm_present; static const bool has_denorm_loss = false; - _LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __builtin_huge_val();} - _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __builtin_nan("");} - _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __builtin_nans("");} - _LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __DBL_DENORM_MIN__;} + _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __builtin_huge_val();} + _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __builtin_nan("");} + _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __builtin_nans("");} + _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __DBL_DENORM_MIN__;} static const bool is_iec559 = true; static const bool is_bounded = true; @@ -386,15 +386,15 @@ static const int digits = __LDBL_MANT_DIG__; static const int digits10 = __LDBL_DIG__; static const int max_digits10 = 2+(digits * 30103)/100000; - _LIBCPP_INLINE_VISIBILITY static type min() throw() {return __LDBL_MIN__;} - _LIBCPP_INLINE_VISIBILITY static type max() throw() {return __LDBL_MAX__;} - _LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return -max();} + _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __LDBL_MIN__;} + _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __LDBL_MAX__;} + _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return -max();} static const bool is_integer = false; static const bool is_exact = false; static const int radix = __FLT_RADIX__; - _LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __LDBL_EPSILON__;} - _LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return 0.5;} + _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __LDBL_EPSILON__;} + _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return 0.5;} static const int min_exponent = __LDBL_MIN_EXP__; static const int min_exponent10 = __LDBL_MIN_10_EXP__; @@ -406,10 +406,10 @@ static const bool has_signaling_NaN = true; static const float_denorm_style has_denorm = denorm_present; static const bool has_denorm_loss = false; - _LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __builtin_huge_vall();} - _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __builtin_nanl("");} - _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __builtin_nansl("");} - _LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __LDBL_DENORM_MIN__;} + _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __builtin_huge_vall();} + _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __builtin_nanl("");} + _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");} + _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;} #if (defined(__ppc__) || defined(__ppc64__)) static const bool is_iec559 = false; @@ -432,9 +432,9 @@ typedef typename __base::type type; public: static const bool is_specialized = __base::is_specialized; - _LIBCPP_INLINE_VISIBILITY static type min() throw() {return __base::min();} - _LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();} - _LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return __base::lowest();} + _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();} + _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();} + _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();} static const int digits = __base::digits; static const int digits10 = __base::digits10; @@ -443,8 +443,8 @@ static const bool is_integer = __base::is_integer; static const bool is_exact = __base::is_exact; static const int radix = __base::radix; - _LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __base::epsilon();} - _LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return __base::round_error();} + _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();} + _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();} static const int min_exponent = __base::min_exponent; static const int min_exponent10 = __base::min_exponent10; @@ -456,10 +456,10 @@ static const bool has_signaling_NaN = __base::has_signaling_NaN; static const float_denorm_style has_denorm = __base::has_denorm; static const bool has_denorm_loss = __base::has_denorm_loss; - _LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __base::infinity();} - _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __base::quiet_NaN();} - _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __base::signaling_NaN();} - _LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __base::denorm_min();} + _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();} + _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();} + _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();} + _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();} static const bool is_iec559 = __base::is_iec559; static const bool is_bounded = __base::is_bounded; @@ -478,9 +478,9 @@ typedef _Tp type; public: static const bool is_specialized = __base::is_specialized; - _LIBCPP_INLINE_VISIBILITY static type min() throw() {return __base::min();} - _LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();} - _LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return __base::lowest();} + _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();} + _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();} + _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();} static const int digits = __base::digits; static const int digits10 = __base::digits10; @@ -489,8 +489,8 @@ static const bool is_integer = __base::is_integer; static const bool is_exact = __base::is_exact; static const int radix = __base::radix; - _LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __base::epsilon();} - _LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return __base::round_error();} + _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();} + _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();} static const int min_exponent = __base::min_exponent; static const int min_exponent10 = __base::min_exponent10; @@ -502,10 +502,10 @@ static const bool has_signaling_NaN = __base::has_signaling_NaN; static const float_denorm_style has_denorm = __base::has_denorm; static const bool has_denorm_loss = __base::has_denorm_loss; - _LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __base::infinity();} - _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __base::quiet_NaN();} - _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __base::signaling_NaN();} - _LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __base::denorm_min();} + _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();} + _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();} + _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();} + _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();} static const bool is_iec559 = __base::is_iec559; static const bool is_bounded = __base::is_bounded; @@ -524,9 +524,9 @@ typedef _Tp type; public: static const bool is_specialized = __base::is_specialized; - _LIBCPP_INLINE_VISIBILITY static type min() throw() {return __base::min();} - _LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();} - _LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return __base::lowest();} + _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();} + _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();} + _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();} static const int digits = __base::digits; static const int digits10 = __base::digits10; @@ -535,8 +535,8 @@ static const bool is_integer = __base::is_integer; static const bool is_exact = __base::is_exact; static const int radix = __base::radix; - _LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __base::epsilon();} - _LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return __base::round_error();} + _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();} + _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();} static const int min_exponent = __base::min_exponent; static const int min_exponent10 = __base::min_exponent10; @@ -548,10 +548,10 @@ static const bool has_signaling_NaN = __base::has_signaling_NaN; static const float_denorm_style has_denorm = __base::has_denorm; static const bool has_denorm_loss = __base::has_denorm_loss; - _LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __base::infinity();} - _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __base::quiet_NaN();} - _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __base::signaling_NaN();} - _LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __base::denorm_min();} + _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();} + _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();} + _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();} + _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();} static const bool is_iec559 = __base::is_iec559; static const bool is_bounded = __base::is_bounded; @@ -570,9 +570,9 @@ typedef _Tp type; public: static const bool is_specialized = __base::is_specialized; - _LIBCPP_INLINE_VISIBILITY static type min() throw() {return __base::min();} - _LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();} - _LIBCPP_INLINE_VISIBILITY static type lowest() throw() {return __base::lowest();} + _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();} + _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();} + _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();} static const int digits = __base::digits; static const int digits10 = __base::digits10; @@ -581,8 +581,8 @@ static const bool is_integer = __base::is_integer; static const bool is_exact = __base::is_exact; static const int radix = __base::radix; - _LIBCPP_INLINE_VISIBILITY static type epsilon() throw() {return __base::epsilon();} - _LIBCPP_INLINE_VISIBILITY static type round_error() throw() {return __base::round_error();} + _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();} + _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();} static const int min_exponent = __base::min_exponent; static const int min_exponent10 = __base::min_exponent10; @@ -594,10 +594,10 @@ static const bool has_signaling_NaN = __base::has_signaling_NaN; static const float_denorm_style has_denorm = __base::has_denorm; static const bool has_denorm_loss = __base::has_denorm_loss; - _LIBCPP_INLINE_VISIBILITY static type infinity() throw() {return __base::infinity();} - _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() throw() {return __base::quiet_NaN();} - _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() throw() {return __base::signaling_NaN();} - _LIBCPP_INLINE_VISIBILITY static type denorm_min() throw() {return __base::denorm_min();} + _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();} + _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();} + _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();} + _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();} static const bool is_iec559 = __base::is_iec559; static const bool is_bounded = __base::is_bounded;
diff --git a/include/new b/include/new index 68f0274..fac9f85 100644 --- a/include/new +++ b/include/new
@@ -21,35 +21,34 @@ : public exception { public: - bad_alloc() throw(); - bad_alloc(const bad_alloc&) throw(); - bad_alloc& operator=(const bad_alloc&) throw(); - virtual ~bad_alloc() throw(); - virtual const char* what() const throw(); + bad_alloc() noexcept; + bad_alloc(const bad_alloc&) noexcept; + bad_alloc& operator=(const bad_alloc&) noexcept; + virtual const char* what() const noexcept; }; struct nothrow_t {}; extern const nothrow_t nothrow; typedef void (*new_handler)(); -new_handler set_new_handler(new_handler new_p) throw(); -new_handler get_new_handler() throw(); +new_handler set_new_handler(new_handler new_p) noexcept; +new_handler get_new_handler() noexcept; } // std -void* operator new(std::size_t size) throw(std::bad_alloc); // replaceable -void* operator new(std::size_t size, const std::nothrow_t&) throw(); // replaceable -void operator delete(void* ptr) throw(); // replaceable -void operator delete(void* ptr, const std::nothrow_t&) throw(); // replaceable +void* operator new(std::size_t size); // replaceable +void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable +void operator delete(void* ptr) noexcept; // replaceable +void operator delete(void* ptr, const std::nothrow_t&) noexcept; // replaceable -void* operator new[](std::size_t size) throw(std::bad_alloc); // replaceable -void* operator new[](std::size_t size, const std::nothrow_t&) throw(); // replaceable -void operator delete[](void* ptr) throw(); // replaceable -void operator delete[](void* ptr, const std::nothrow_t&) throw(); // replaceable +void* operator new[](std::size_t size); // replaceable +void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable +void operator delete[](void* ptr) noexcept; // replaceable +void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // replaceable -void* operator new (std::size_t size, void* ptr) throw(); -void* operator new[](std::size_t size, void* ptr) throw(); -void operator delete (void* ptr, void*) throw(); -void operator delete[](void* ptr, void*) throw(); +void* operator new (std::size_t size, void* ptr) noexcept; +void* operator new[](std::size_t size, void* ptr) noexcept; +void operator delete (void* ptr, void*) noexcept; +void operator delete[](void* ptr, void*) noexcept; */ @@ -66,18 +65,18 @@ : public exception { public: - bad_alloc() throw(); - virtual ~bad_alloc() throw(); - virtual const char* what() const throw(); + bad_alloc() _NOEXCEPT; + virtual ~bad_alloc() _NOEXCEPT; + virtual const char* what() const _NOEXCEPT; }; class _LIBCPP_EXCEPTION_ABI bad_array_new_length : public bad_alloc { public: - bad_array_new_length() throw(); - virtual ~bad_array_new_length() throw(); - virtual const char* what() const throw(); + bad_array_new_length() _NOEXCEPT; + virtual ~bad_array_new_length() _NOEXCEPT; + virtual const char* what() const _NOEXCEPT; }; void __throw_bad_alloc(); // not in C++ spec @@ -85,24 +84,32 @@ struct _LIBCPP_VISIBLE nothrow_t {}; extern _LIBCPP_VISIBLE const nothrow_t nothrow; typedef void (*new_handler)(); -_LIBCPP_VISIBLE new_handler set_new_handler(new_handler) throw(); -_LIBCPP_VISIBLE new_handler get_new_handler() throw(); +_LIBCPP_VISIBLE new_handler set_new_handler(new_handler) _NOEXCEPT; +_LIBCPP_VISIBLE new_handler get_new_handler() _NOEXCEPT; } // std -_LIBCPP_VISIBLE void* operator new(std::size_t) throw(std::bad_alloc); -_LIBCPP_VISIBLE void* operator new(std::size_t, const std::nothrow_t&) throw(); -_LIBCPP_VISIBLE void operator delete(void*) throw(); -_LIBCPP_VISIBLE void operator delete(void*, const std::nothrow_t&) throw(); +_LIBCPP_VISIBLE void* operator new(std::size_t) +#if !__has_feature(cxx_noexcept) + throw(std::bad_alloc) +#endif +; +_LIBCPP_VISIBLE void* operator new(std::size_t, const std::nothrow_t&) _NOEXCEPT; +_LIBCPP_VISIBLE void operator delete(void*) _NOEXCEPT; +_LIBCPP_VISIBLE void operator delete(void*, const std::nothrow_t&) _NOEXCEPT; -_LIBCPP_VISIBLE void* operator new[](std::size_t) throw(std::bad_alloc); -_LIBCPP_VISIBLE void* operator new[](std::size_t, const std::nothrow_t&) throw(); -_LIBCPP_VISIBLE void operator delete[](void*) throw(); -_LIBCPP_VISIBLE void operator delete[](void*, const std::nothrow_t&) throw(); +_LIBCPP_VISIBLE void* operator new[](std::size_t) +#if !__has_feature(cxx_noexcept) + throw(std::bad_alloc) +#endif +; +_LIBCPP_VISIBLE void* operator new[](std::size_t, const std::nothrow_t&) _NOEXCEPT; +_LIBCPP_VISIBLE void operator delete[](void*) _NOEXCEPT; +_LIBCPP_VISIBLE void operator delete[](void*, const std::nothrow_t&) _NOEXCEPT; -_LIBCPP_INLINE_VISIBILITY inline void* operator new (std::size_t, void* __p) throw() {return __p;} -_LIBCPP_INLINE_VISIBILITY inline void* operator new[](std::size_t, void* __p) throw() {return __p;} -_LIBCPP_INLINE_VISIBILITY inline void operator delete (void*, void*) throw() {} -_LIBCPP_INLINE_VISIBILITY inline void operator delete[](void*, void*) throw() {} +_LIBCPP_INLINE_VISIBILITY inline void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;} +_LIBCPP_INLINE_VISIBILITY inline void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;} +_LIBCPP_INLINE_VISIBILITY inline void operator delete (void*, void*) _NOEXCEPT {} +_LIBCPP_INLINE_VISIBILITY inline void operator delete[](void*, void*) _NOEXCEPT {} #endif // _LIBCPP_NEW
diff --git a/include/typeinfo b/include/typeinfo index 8bbd559..310c482 100644 --- a/include/typeinfo +++ b/include/typeinfo
@@ -22,12 +22,12 @@ public: virtual ~type_info(); - bool operator==(const type_info& rhs) const; - bool operator!=(const type_info& rhs) const; + bool operator==(const type_info& rhs) const noexcept; + bool operator!=(const type_info& rhs) const noexcept; - bool before(const type_info& rhs) const; - size_t hash_code() const throw(); - const char* name() const; + bool before(const type_info& rhs) const noexcept; + size_t hash_code() const noexcept; + const char* name() const noexcept; type_info(const type_info& rhs) = delete; type_info& operator=(const type_info& rhs) = delete; @@ -37,20 +37,20 @@ : public exception { public: - bad_cast() throw(); - bad_cast(const bad_cast&) throw(); - bad_cast& operator=(const bad_cast&) throw(); - virtual const char* what() const throw(); + bad_cast() noexcept; + bad_cast(const bad_cast&) noexcept; + bad_cast& operator=(const bad_cast&) noexcept; + virtual const char* what() const noexcept; }; class bad_typeid : public exception { public: - bad_typeid() throw(); - bad_typeid(const bad_typeid&) throw(); - bad_typeid& operator=(const bad_typeid&) throw(); - virtual const char* what() const throw(); + bad_typeid() noexcept; + bad_typeid(const bad_typeid&) noexcept; + bad_typeid& operator=(const bad_typeid&) noexcept; + virtual const char* what() const noexcept; }; } // std @@ -81,20 +81,20 @@ virtual ~type_info(); _LIBCPP_INLINE_VISIBILITY - const char* name() const {return __type_name;} + const char* name() const _NOEXCEPT {return __type_name;} _LIBCPP_INLINE_VISIBILITY - bool before(const type_info& __arg) const + bool before(const type_info& __arg) const _NOEXCEPT {return __type_name < __arg.__type_name;} _LIBCPP_INLINE_VISIBILITY - size_t hash_code() const throw() + size_t hash_code() const _NOEXCEPT {return *reinterpret_cast<const size_t*>(&__type_name);} _LIBCPP_INLINE_VISIBILITY - bool operator==(const type_info& __arg) const + bool operator==(const type_info& __arg) const _NOEXCEPT {return __type_name == __arg.__type_name;} _LIBCPP_INLINE_VISIBILITY - bool operator!=(const type_info& __arg) const + bool operator!=(const type_info& __arg) const _NOEXCEPT {return !operator==(__arg);} }; @@ -103,18 +103,18 @@ : public exception { public: - bad_cast() throw(); - virtual ~bad_cast() throw(); - virtual const char* what() const throw(); + bad_cast() _NOEXCEPT; + virtual ~bad_cast() _NOEXCEPT; + virtual const char* what() const _NOEXCEPT; }; class _LIBCPP_EXCEPTION_ABI bad_typeid : public exception { public: - bad_typeid() throw(); - virtual ~bad_typeid() throw(); - virtual const char* what() const throw(); + bad_typeid() _NOEXCEPT; + virtual ~bad_typeid() _NOEXCEPT; + virtual const char* what() const _NOEXCEPT; }; } // std