From a62f28994c1b70083338e5f61c1e36db33d49b18 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 26 May 2011 19:48:01 +0000 Subject: Applied noexcept to everything in [diagnostics] (Chapter 19) llvm-svn: 132137 --- libcxx/src/stdexcept.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'libcxx/src/stdexcept.cpp') diff --git a/libcxx/src/stdexcept.cpp b/libcxx/src/stdexcept.cpp index 9d9b4d9..2891788 100644 --- a/libcxx/src/stdexcept.cpp +++ b/libcxx/src/stdexcept.cpp @@ -34,13 +34,13 @@ private: static const std::ptrdiff_t offset = static_cast(2*sizeof(unused_t) + sizeof(count_t)); - count_t& count() const throw() {return (count_t&)(*(str_ - sizeof(count_t)));} + count_t& count() const _NOEXCEPT {return (count_t&)(*(str_ - sizeof(count_t)));} public: explicit __libcpp_nmstr(const char* msg); __libcpp_nmstr(const __libcpp_nmstr& s) _LIBCPP_CANTTHROW; __libcpp_nmstr& operator=(const __libcpp_nmstr& s) _LIBCPP_CANTTHROW; ~__libcpp_nmstr() _LIBCPP_CANTTHROW; - const char* c_str() const throw() {return str_;} + const char* c_str() const _NOEXCEPT {return str_;} }; __libcpp_nmstr::__libcpp_nmstr(const char* msg) @@ -98,14 +98,14 @@ logic_error::logic_error(const char* msg) ::new(&s) __libcpp_nmstr(msg); } -logic_error::logic_error(const logic_error& le) throw() +logic_error::logic_error(const logic_error& le) _NOEXCEPT { __libcpp_nmstr& s = (__libcpp_nmstr&)__imp_; ::new(&s) __libcpp_nmstr((const __libcpp_nmstr&)le.__imp_); } logic_error& -logic_error::operator=(const logic_error& le) throw() +logic_error::operator=(const logic_error& le) _NOEXCEPT { __libcpp_nmstr& s1 = (__libcpp_nmstr&)__imp_; const __libcpp_nmstr& s2 = (const __libcpp_nmstr&)le.__imp_; @@ -113,14 +113,14 @@ logic_error::operator=(const logic_error& le) throw() return *this; } -logic_error::~logic_error() throw() +logic_error::~logic_error() _NOEXCEPT { __libcpp_nmstr& s = (__libcpp_nmstr&)__imp_; s.~__libcpp_nmstr(); } const char* -logic_error::what() const throw() +logic_error::what() const _NOEXCEPT { __libcpp_nmstr& s = (__libcpp_nmstr&)__imp_; return s.c_str(); @@ -138,14 +138,14 @@ runtime_error::runtime_error(const char* msg) ::new(&s) __libcpp_nmstr(msg); } -runtime_error::runtime_error(const runtime_error& le) throw() +runtime_error::runtime_error(const runtime_error& le) _NOEXCEPT { __libcpp_nmstr& s = (__libcpp_nmstr&)__imp_; ::new(&s) __libcpp_nmstr((const __libcpp_nmstr&)le.__imp_); } runtime_error& -runtime_error::operator=(const runtime_error& le) throw() +runtime_error::operator=(const runtime_error& le) _NOEXCEPT { __libcpp_nmstr& s1 = (__libcpp_nmstr&)__imp_; const __libcpp_nmstr& s2 = (const __libcpp_nmstr&)le.__imp_; @@ -153,26 +153,26 @@ runtime_error::operator=(const runtime_error& le) throw() return *this; } -runtime_error::~runtime_error() throw() +runtime_error::~runtime_error() _NOEXCEPT { __libcpp_nmstr& s = (__libcpp_nmstr&)__imp_; s.~__libcpp_nmstr(); } const char* -runtime_error::what() const throw() +runtime_error::what() const _NOEXCEPT { __libcpp_nmstr& s = (__libcpp_nmstr&)__imp_; return s.c_str(); } -domain_error::~domain_error() throw() {} -invalid_argument::~invalid_argument() throw() {} -length_error::~length_error() throw() {} -out_of_range::~out_of_range() throw() {} +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() throw() {} -overflow_error::~overflow_error() throw() {} -underflow_error::~underflow_error() throw() {} +range_error::~range_error() _NOEXCEPT {} +overflow_error::~overflow_error() _NOEXCEPT {} +underflow_error::~underflow_error() _NOEXCEPT {} } // std -- cgit v1.1