This is an automated email from the ASF dual-hosted git repository. astitcher pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-proton.git
The following commit(s) were added to refs/heads/main by this push: new 0217dc4 PROTON-2354: Fix to the new destructors that works with C++03 0217dc4 is described below commit 0217dc472986b1290ba92db59a2d5f130bf82f5e Author: Andrew Stitcher <astitc...@apache.org> AuthorDate: Mon Apr 5 17:29:16 2021 -0400 PROTON-2354: Fix to the new destructors that works with C++03 We do still support C++03 and the previous fix had the wrong exception specification for pre C++11 destructors: The base exception (std::runtime_error) is specified to not throw any exeptions so we need to specify the new destructors the same way. C++11 defaults to non throwing destructors so omitting the exception specification works there. However earlier C++ doesn't default like this and so we need to do this explicitly for C++03. The explicit specification works fine for C++11 as it doesn't actually change anything there. --- cpp/include/proton/error.hpp | 6 +++--- cpp/include/proton/url.hpp | 2 +- cpp/src/error.cpp | 6 +++--- cpp/src/url.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cpp/include/proton/error.hpp b/cpp/include/proton/error.hpp index b1e9d68..5ac409f 100644 --- a/cpp/include/proton/error.hpp +++ b/cpp/include/proton/error.hpp @@ -41,7 +41,7 @@ struct PN_CPP_CLASS_EXTERN error : public std::runtime_error { /// Construct the error with a message. PN_CPP_EXTERN explicit error(const std::string&); - PN_CPP_EXTERN ~error(); + PN_CPP_EXTERN ~error() throw(); }; /// An operation timed out. @@ -49,7 +49,7 @@ struct PN_CPP_CLASS_EXTERN timeout_error : public error { /// Construct the error with a message. PN_CPP_EXTERN explicit timeout_error(const std::string&); - PN_CPP_EXTERN ~timeout_error(); + PN_CPP_EXTERN ~timeout_error() throw(); }; /// An error converting between AMQP and C++ data. @@ -57,7 +57,7 @@ struct PN_CPP_CLASS_EXTERN conversion_error : public error { /// Construct the error with a message. PN_CPP_EXTERN explicit conversion_error(const std::string&); - PN_CPP_EXTERN ~conversion_error(); + PN_CPP_EXTERN ~conversion_error() throw(); }; } // proton diff --git a/cpp/include/proton/url.hpp b/cpp/include/proton/url.hpp index 02472b2..2d7c127 100644 --- a/cpp/include/proton/url.hpp +++ b/cpp/include/proton/url.hpp @@ -45,7 +45,7 @@ PN_CPP_CLASS_EXTERN url_error : public error { /// @cond INTERNAL /// Construct a URL error with a message. PN_CPP_EXTERN explicit url_error(const std::string&); - PN_CPP_EXTERN ~url_error(); + PN_CPP_EXTERN ~url_error() throw(); /// @endcond }; diff --git a/cpp/src/error.cpp b/cpp/src/error.cpp index 31ab706..62655bb 100644 --- a/cpp/src/error.cpp +++ b/cpp/src/error.cpp @@ -22,12 +22,12 @@ namespace proton { error::error(const std::string& msg) : std::runtime_error(msg) {} -error::~error() {} +error::~error() throw() {} timeout_error::timeout_error(const std::string& msg) : error(msg) {} -timeout_error::~timeout_error() {} +timeout_error::~timeout_error() throw() {} conversion_error::conversion_error(const std::string& msg) : error(msg) {} -conversion_error::~conversion_error() {} +conversion_error::~conversion_error() throw() {} } diff --git a/cpp/src/url.cpp b/cpp/src/url.cpp index a23935a..4cd66c7 100644 --- a/cpp/src/url.cpp +++ b/cpp/src/url.cpp @@ -220,7 +220,7 @@ const char* const url::impl::default_host = "localhost"; url_error::url_error(const std::string& s) : error(s) {} -url_error::~url_error() {} +url_error::~url_error() throw() {} url::url(const std::string &s) : impl_(new impl(s)) { impl_->defaults(); } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org