summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2011-05-26 19:48:01 +0000
committerHoward Hinnant <hhinnant@apple.com>2011-05-26 19:48:01 +0000
commit1e15fd1856a34a4bc0f7c1d649d2e22df9033326 (patch)
treed261016c966ba692d7a4533ece575cc699bc5e39 /src
parent19ce6a4792d0ed6027655dadf3ca3b93884a29ef (diff)
Applied noexcept to everything in [diagnostics] (Chapter 19)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src')
-rw-r--r--src/future.cpp4
-rw-r--r--src/ios.cpp4
-rw-r--r--src/stdexcept.cpp34
-rw-r--r--src/system_error.cpp28
4 files changed, 35 insertions, 35 deletions
diff --git a/src/future.cpp b/src/future.cpp
index 0b8628f37..8e79f3e3c 100644
--- a/src/future.cpp
+++ b/src/future.cpp
@@ -16,12 +16,12 @@ class _LIBCPP_HIDDEN __future_error_category
: public __do_message
{
public:
- virtual const char* name() const;
+ virtual const char* name() const _NOEXCEPT;
virtual string message(int ev) const;
};
const char*
-__future_error_category::name() const
+__future_error_category::name() const _NOEXCEPT
{
return "future";
}
diff --git a/src/ios.cpp b/src/ios.cpp
index e7153cba2..bca15fb79 100644
--- a/src/ios.cpp
+++ b/src/ios.cpp
@@ -38,12 +38,12 @@ class _LIBCPP_HIDDEN __iostream_category
: public __do_message
{
public:
- virtual const char* name() const;
+ virtual const char* name() const _NOEXCEPT;
virtual string message(int ev) const;
};
const char*
-__iostream_category::name() const
+__iostream_category::name() const _NOEXCEPT
{
return "iostream";
}
diff --git a/src/stdexcept.cpp b/src/stdexcept.cpp
index 9d9b4d94e..289178875 100644
--- a/src/stdexcept.cpp
+++ b/src/stdexcept.cpp
@@ -34,13 +34,13 @@ private:
static const std::ptrdiff_t offset = static_cast<std::ptrdiff_t>(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
diff --git a/src/system_error.cpp b/src/system_error.cpp
index 2886a15c9..caafc32a7 100644
--- a/src/system_error.cpp
+++ b/src/system_error.cpp
@@ -15,28 +15,28 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// class error_category
-error_category::error_category()
+error_category::error_category() _NOEXCEPT
{
}
-error_category::~error_category()
+error_category::~error_category() _NOEXCEPT
{
}
error_condition
-error_category::default_error_condition(int ev) const
+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
+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
+error_category::equivalent(const error_code& code, int condition) const _NOEXCEPT
{
return *this == code.category() && code.value() == condition;
}
@@ -51,12 +51,12 @@ class _LIBCPP_HIDDEN __generic_error_category
: public __do_message
{
public:
- virtual const char* name() const;
+ virtual const char* name() const _NOEXCEPT;
virtual string message(int ev) const;
};
const char*
-__generic_error_category::name() const
+__generic_error_category::name() const _NOEXCEPT
{
return "generic";
}
@@ -72,7 +72,7 @@ __generic_error_category::message(int ev) const
}
const error_category&
-generic_category()
+generic_category() _NOEXCEPT
{
static __generic_error_category s;
return s;
@@ -82,13 +82,13 @@ class _LIBCPP_HIDDEN __system_error_category
: public __do_message
{
public:
- virtual const char* name() const;
+ virtual const char* name() const _NOEXCEPT;
virtual string message(int ev) const;
- virtual error_condition default_error_condition(int ev) const;
+ virtual error_condition default_error_condition(int ev) const _NOEXCEPT;
};
const char*
-__system_error_category::name() const
+__system_error_category::name() const _NOEXCEPT
{
return "system";
}
@@ -104,7 +104,7 @@ __system_error_category::message(int ev) const
}
error_condition
-__system_error_category::default_error_condition(int ev) const
+__system_error_category::default_error_condition(int ev) const _NOEXCEPT
{
#ifdef ELAST
if (ev > ELAST)
@@ -114,7 +114,7 @@ __system_error_category::default_error_condition(int ev) const
}
const error_category&
-system_category()
+system_category() _NOEXCEPT
{
static __system_error_category s;
return s;
@@ -186,7 +186,7 @@ system_error::system_error(int ev, const error_category& ecat)
{
}
-system_error::~system_error() throw()
+system_error::~system_error() _NOEXCEPT
{
}