contrib: epee: add exception spec to throwing destructors

The destructors get a noexcept(true) spec by default, but these
destructors in fact throw exceptions. An alternative fix might be to not
throw (most if not all of these throws are non-essential
error-reporting/logging).
This commit is contained in:
redfish 2016-05-18 00:59:07 -04:00
parent 68987416ad
commit c2d7300d2e
3 changed files with 3 additions and 3 deletions

View File

@ -88,7 +88,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
PRAGMA_WARNING_DISABLE_VS(4355) PRAGMA_WARNING_DISABLE_VS(4355)
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
template<class t_protocol_handler> template<class t_protocol_handler>
connection<t_protocol_handler>::~connection() connection<t_protocol_handler>::~connection() noexcept(false)
{ {
if(!m_was_shutdown) if(!m_was_shutdown)
{ {

View File

@ -119,7 +119,7 @@ namespace net_utils
virtual bool add_ref()=0; virtual bool add_ref()=0;
virtual bool release()=0; virtual bool release()=0;
protected: protected:
virtual ~i_service_endpoint(){} virtual ~i_service_endpoint() noexcept(false) {}
}; };

View File

@ -68,7 +68,7 @@ namespace epee
++m_counter_ref; ++m_counter_ref;
CHECK_AND_ASSERT_THROW_MES(m_counter_ref < EPEE_PORTABLE_STORAGE_RECURSION_LIMIT_INTERNAL, "Wrong blob data in portable storage: recursion limitation (" << EPEE_PORTABLE_STORAGE_RECURSION_LIMIT_INTERNAL << ") exceeded"); CHECK_AND_ASSERT_THROW_MES(m_counter_ref < EPEE_PORTABLE_STORAGE_RECURSION_LIMIT_INTERNAL, "Wrong blob data in portable storage: recursion limitation (" << EPEE_PORTABLE_STORAGE_RECURSION_LIMIT_INTERNAL << ") exceeded");
} }
~recursuion_limitation_guard() ~recursuion_limitation_guard() noexcept(false)
{ {
CHECK_AND_ASSERT_THROW_MES(m_counter_ref != 0, "Internal error: m_counter_ref == 0 while ~recursuion_limitation_guard()"); CHECK_AND_ASSERT_THROW_MES(m_counter_ref != 0, "Internal error: m_counter_ref == 0 while ~recursuion_limitation_guard()");
--m_counter_ref; --m_counter_ref;