aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2011-12-06 20:03:25 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2011-12-06 20:03:25 +0000
commit8535715d0fb7c430787c257a9fc14cb34794e676 (patch)
treed7d90c64c9fb734a886b94cbda14b7158939c565 /libstdc++-v3/include/std
parent0e642d0671db79acb4bccc4268e461fdcf5c1cdf (diff)
downloadgcc-8535715d0fb7c430787c257a9fc14cb34794e676.zip
gcc-8535715d0fb7c430787c257a9fc14cb34794e676.tar.gz
gcc-8535715d0fb7c430787c257a9fc14cb34794e676.tar.bz2
re PR libstdc++/51438 (std::exception and derived classes are not compatible with std::nested_exception and C++11 in general)
2011-12-06 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/51438 * libsupc++/nested_exception.h (nested_exception::~nested_exception): Declare noexcept. * libsupc++/nested_exception.cc: Adjust. * testsuite/18_support/nested_exception/51438.cc: New. * testsuite/18_support/nested_exception/throw_with_nested.cc: Adjust. * testsuite/18_support/nested_exception/rethrow_if_nested.cc: Likewise. * src/shared_ptr.cc: Use noexcept where appropriate. * include/std/system_error: Likewise. * include/std/functional: Likewise. * include/bits/shared_ptr_base.h: Likewise. * src/stdexcept.cc: Use _GLIBCXX_USE_NOEXCEPT where appropriate. * include/std/stdexcept: Likewise. * libsupc++/bad_cast.cc: Likewise. * libsupc++/bad_typeid.cc: Likewise. * libsupc++/eh_exception.cc: Likewise. * libsupc++/typeinfo: Likewise. * libsupc++/exception: Likewise. * libsupc++/eh_ptr.cc: Likewise. * libsupc++/bad_alloc.cc: Likewise. * libsupc++/exception_ptr.h: Likewise. * include/std/chrono: Use noexcept where appropriate. * src/chrono.cc: Likewise. From-SVN: r182064
Diffstat (limited to 'libstdc++-v3/include/std')
-rw-r--r--libstdc++-v3/include/std/chrono8
-rw-r--r--libstdc++-v3/include/std/functional2
-rw-r--r--libstdc++-v3/include/std/stdexcept22
-rw-r--r--libstdc++-v3/include/std/system_error2
4 files changed, 17 insertions, 17 deletions
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index 6a087f5..0806a5d 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -686,18 +686,18 @@ _GLIBCXX_END_NAMESPACE_VERSION
static constexpr bool is_steady = false;
static time_point
- now() throw ();
+ now() noexcept;
// Map to C API
static std::time_t
- to_time_t(const time_point& __t)
+ to_time_t(const time_point& __t) noexcept
{
return std::time_t(duration_cast<chrono::seconds>
(__t.time_since_epoch()).count());
}
static time_point
- from_time_t(std::time_t __t)
+ from_time_t(std::time_t __t) noexcept
{
typedef chrono::time_point<system_clock, seconds> __from;
return time_point_cast<system_clock::duration>
@@ -717,7 +717,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
static constexpr bool is_steady = true;
static time_point
- now();
+ now() noexcept;
};
#else
typedef system_clock steady_clock;
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index 465fc56..4be1bc7 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -1633,7 +1633,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
class bad_function_call : public std::exception
{
public:
- virtual ~bad_function_call() throw();
+ virtual ~bad_function_call() noexcept;
};
/**
diff --git a/libstdc++-v3/include/std/stdexcept b/libstdc++-v3/include/std/stdexcept
index a461795..2cbf207 100644
--- a/libstdc++-v3/include/std/stdexcept
+++ b/libstdc++-v3/include/std/stdexcept
@@ -62,12 +62,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
explicit
logic_error(const string& __arg);
- virtual ~logic_error() throw();
+ virtual ~logic_error() _GLIBCXX_USE_NOEXCEPT;
/** Returns a C-style character string describing the general cause of
* the current error (the same string passed to the ctor). */
virtual const char*
- what() const throw();
+ what() const _GLIBCXX_USE_NOEXCEPT;
};
/** Thrown by the library, or by you, to report domain errors (domain in
@@ -76,7 +76,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
public:
explicit domain_error(const string& __arg);
- virtual ~domain_error() throw();
+ virtual ~domain_error() _GLIBCXX_USE_NOEXCEPT;
};
/** Thrown to report invalid arguments to functions. */
@@ -84,7 +84,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
public:
explicit invalid_argument(const string& __arg);
- virtual ~invalid_argument() throw();
+ virtual ~invalid_argument() _GLIBCXX_USE_NOEXCEPT;
};
/** Thrown when an object is constructed that would exceed its maximum
@@ -93,7 +93,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
public:
explicit length_error(const string& __arg);
- virtual ~length_error() throw();
+ virtual ~length_error() _GLIBCXX_USE_NOEXCEPT;
};
/** This represents an argument whose value is not within the expected
@@ -102,7 +102,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
public:
explicit out_of_range(const string& __arg);
- virtual ~out_of_range() throw();
+ virtual ~out_of_range() _GLIBCXX_USE_NOEXCEPT;
};
/** Runtime errors represent problems outside the scope of a program;
@@ -119,12 +119,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
explicit
runtime_error(const string& __arg);
- virtual ~runtime_error() throw();
+ virtual ~runtime_error() _GLIBCXX_USE_NOEXCEPT;
/** Returns a C-style character string describing the general cause of
* the current error (the same string passed to the ctor). */
virtual const char*
- what() const throw();
+ what() const _GLIBCXX_USE_NOEXCEPT;
};
/** Thrown to indicate range errors in internal computations. */
@@ -132,7 +132,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
public:
explicit range_error(const string& __arg);
- virtual ~range_error() throw();
+ virtual ~range_error() _GLIBCXX_USE_NOEXCEPT;
};
/** Thrown to indicate arithmetic overflow. */
@@ -140,7 +140,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
public:
explicit overflow_error(const string& __arg);
- virtual ~overflow_error() throw();
+ virtual ~overflow_error() _GLIBCXX_USE_NOEXCEPT;
};
/** Thrown to indicate arithmetic underflow. */
@@ -148,7 +148,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
public:
explicit underflow_error(const string& __arg);
- virtual ~underflow_error() throw();
+ virtual ~underflow_error() _GLIBCXX_USE_NOEXCEPT;
};
// @} group exceptions
diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error
index 19482bc..129cbeef 100644
--- a/libstdc++-v3/include/std/system_error
+++ b/libstdc++-v3/include/std/system_error
@@ -337,7 +337,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: runtime_error(__what + ": " + error_code(__v, __ecat).message()),
_M_code(__v, __ecat) { }
- virtual ~system_error() throw();
+ virtual ~system_error() noexcept;
const error_code&
code() const noexcept { return _M_code; }