diff --git a/Jamfile b/Jamfile index 9cf39c88b..44a70b86c 100644 --- a/Jamfile +++ b/Jamfile @@ -247,10 +247,6 @@ rule warnings ( properties * ) result += -Wno-c++11-long-long ; result += -Wno-variadic-macros ; -# in C++98 mode there's no way to silence this warning -# in the code (without final) - result += -Wno-non-virtual-dtor ; - # enable these warnings again, once the other ones are dealt with result += -Wno-weak-vtables ; result += -Wno-sign-compare ; diff --git a/include/libtorrent/aux_/allocating_handler.hpp b/include/libtorrent/aux_/allocating_handler.hpp index 3c221ed60..0da1fac9f 100644 --- a/include/libtorrent/aux_/allocating_handler.hpp +++ b/include/libtorrent/aux_/allocating_handler.hpp @@ -62,10 +62,13 @@ namespace libtorrent { namespace aux handler_storage(handler_storage const&); }; - struct error_handler_interface + struct TORRENT_EXTRA_EXPORT error_handler_interface { virtual void on_exception(std::exception const&) = 0; virtual void on_error(error_code const&) = 0; + + protected: + ~error_handler_interface() {} }; // this class is a wrapper for an asio handler object. Its main purpose diff --git a/include/libtorrent/disk_io_job.hpp b/include/libtorrent/disk_io_job.hpp index df4afc641..3221f767f 100644 --- a/include/libtorrent/disk_io_job.hpp +++ b/include/libtorrent/disk_io_job.hpp @@ -44,7 +44,6 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { struct storage_interface; - using storage_interface = storage_interface; struct cached_piece_entry; class torrent_info; struct add_torrent_params; @@ -69,7 +68,6 @@ namespace libtorrent // a lot of heap allocation churn of using general purpose // containers. struct TORRENT_EXTRA_EXPORT disk_io_job : tailqueue_node - , boost::noncopyable { disk_io_job(); ~disk_io_job(); diff --git a/include/libtorrent/storage.hpp b/include/libtorrent/storage.hpp index 82d349740..4e8761501 100644 --- a/include/libtorrent/storage.hpp +++ b/include/libtorrent/storage.hpp @@ -565,6 +565,9 @@ namespace libtorrent { virtual int file_op(int const file_index, std::int64_t const file_offset , span bufs, storage_error& ec) = 0; + + protected: + ~fileop() {} }; // this function is responsible for turning read and write operations in the diff --git a/src/storage.cpp b/src/storage.cpp index 7cf5ef83d..77f03ff1a 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -212,7 +212,7 @@ namespace libtorrent } // anonymous namespace - struct write_fileop : fileop + struct write_fileop final : fileop { write_fileop(default_storage& st, int flags) : m_storage(st) @@ -300,7 +300,7 @@ namespace libtorrent int m_flags; }; - struct read_fileop : fileop + struct read_fileop final : fileop { read_fileop(default_storage& st, int const flags) : m_storage(st)