From 30319d667861649b3465e605f54064b783654499 Mon Sep 17 00:00:00 2001 From: Ed Catmur Date: Tue, 21 Nov 2023 15:54:39 -0700 Subject: [PATCH] Remove empty destructors (redundant since C++11) (#104) * Use BOOST_DEFAULTED_FUNCTION on empty destructors The compiler-generated copy constructor and copy assignment operator are deprecated since C++11 on classes with user-declared destructors. This change allows clean compilation with the -Wdeprecated-copy-dtor/-Wdeprecated-copy-with-user-provided-dtor flag. * require C++11 * Remove dtor declarations entirely the default dtor is fine --- .../detail/exception_implementation.hpp | 12 ------------ .../boost/property_tree/detail/file_parser_error.hpp | 8 +------- include/boost/property_tree/detail/rapidxml.hpp | 2 +- include/boost/property_tree/exceptions.hpp | 6 ------ 4 files changed, 2 insertions(+), 26 deletions(-) diff --git a/include/boost/property_tree/detail/exception_implementation.hpp b/include/boost/property_tree/detail/exception_implementation.hpp index bb39135fd9..cd3434ae42 100644 --- a/include/boost/property_tree/detail/exception_implementation.hpp +++ b/include/boost/property_tree/detail/exception_implementation.hpp @@ -35,10 +35,6 @@ namespace boost { namespace property_tree { } - inline ptree_error::~ptree_error() throw() - { - } - /////////////////////////////////////////////////////////////////////////// // ptree_bad_data @@ -48,10 +44,6 @@ namespace boost { namespace property_tree { } - inline ptree_bad_data::~ptree_bad_data() throw() - { - } - template inline D ptree_bad_data::data() const { @@ -68,10 +60,6 @@ namespace boost { namespace property_tree } - inline ptree_bad_path::~ptree_bad_path() throw() - { - } - template inline P ptree_bad_path::path() const { diff --git a/include/boost/property_tree/detail/file_parser_error.hpp b/include/boost/property_tree/detail/file_parser_error.hpp index 1a0e49aade..c0c7ef4cd6 100644 --- a/include/boost/property_tree/detail/file_parser_error.hpp +++ b/include/boost/property_tree/detail/file_parser_error.hpp @@ -23,7 +23,7 @@ namespace boost { namespace property_tree public: /////////////////////////////////////////////////////////////////////// - // Construction & destruction + // Construction // Construct error file_parser_error(const std::string &msg, @@ -34,12 +34,6 @@ namespace boost { namespace property_tree { } - ~file_parser_error() throw() BOOST_OVERRIDE - // gcc 3.4.2 complains about lack of throw specifier on compiler - // generated dtor - { - } - /////////////////////////////////////////////////////////////////////// // Data access diff --git a/include/boost/property_tree/detail/rapidxml.hpp b/include/boost/property_tree/detail/rapidxml.hpp index 5c297de702..7afc0a6005 100644 --- a/include/boost/property_tree/detail/rapidxml.hpp +++ b/include/boost/property_tree/detail/rapidxml.hpp @@ -59,7 +59,7 @@ namespace boost { namespace property_tree { namespace detail {namespace rapidxml //! Gets human readable description of error. //! \return Pointer to null terminated description of the error. - const char *what() const throw() BOOST_OVERRIDE + const char *what() const throw() override { return m_what; } diff --git a/include/boost/property_tree/exceptions.hpp b/include/boost/property_tree/exceptions.hpp index ab4a9511b4..853f0a12a3 100644 --- a/include/boost/property_tree/exceptions.hpp +++ b/include/boost/property_tree/exceptions.hpp @@ -30,8 +30,6 @@ namespace boost { namespace property_tree /// Instantiate a ptree_error instance with the given message. /// @param what The message to associate with this error. ptree_error(const std::string &what); - - ~ptree_error() throw() BOOST_OVERRIDE; }; @@ -48,8 +46,6 @@ namespace boost { namespace property_tree template ptree_bad_data(const std::string &what, const T &data); - ~ptree_bad_data() throw() BOOST_OVERRIDE; - /// Retrieve the data associated with this error. This is the source /// value that failed to be translated. You need to explicitly /// specify its type. @@ -70,8 +66,6 @@ namespace boost { namespace property_tree template ptree_bad_path(const std::string &what, const T &path); - ~ptree_bad_path() throw() BOOST_OVERRIDE; - /// Retrieve the invalid path. You need to explicitly specify the /// type of path. template T path() const;