diff --git a/Builds/CMake/CMakeFuncs.cmake b/Builds/CMake/CMakeFuncs.cmake index c10a5f0e1d..8e3cac4eea 100644 --- a/Builds/CMake/CMakeFuncs.cmake +++ b/Builds/CMake/CMakeFuncs.cmake @@ -641,7 +641,7 @@ macro(setup_build_boilerplate) if (NOT WIN32) add_definitions(-D_FILE_OFFSET_BITS=64) - append_flags(CMAKE_CXX_FLAGS -frtti -std=c++14 -Wno-invalid-offsetof -Wdeprecated + append_flags(CMAKE_CXX_FLAGS -frtti -std=c++14 -Wno-invalid-offsetof -Wdeprecated -Wnon-virtual-dtor -DBOOST_COROUTINE_NO_DEPRECATION_WARNING -DBOOST_COROUTINES_NO_DEPRECATION_WARNING) add_compile_options(-Wall -Wno-sign-compare -Wno-char-subscripts -Wno-format -Wno-unused-local-typedefs -g) diff --git a/src/beast/extras/beast/unit_test/suite.hpp b/src/beast/extras/beast/unit_test/suite.hpp index d0ded8b6d4..571a910b64 100644 --- a/src/beast/extras/beast/unit_test/suite.hpp +++ b/src/beast/extras/beast/unit_test/suite.hpp @@ -183,6 +183,10 @@ public: { } + virtual ~suite() = default; + suite(suite const&) = delete; + suite& operator=(suite const&) = delete; + /** Invokes the test using the specified runner. Data members are set up here instead of the constructor as a diff --git a/src/ripple/beast/clock/basic_seconds_clock.h b/src/ripple/beast/clock/basic_seconds_clock.h index 6cd42b9be3..441e20da24 100644 --- a/src/ripple/beast/clock/basic_seconds_clock.h +++ b/src/ripple/beast/clock/basic_seconds_clock.h @@ -37,6 +37,10 @@ class seconds_clock_worker { public: virtual void sample () = 0; + virtual ~seconds_clock_worker() = default; + seconds_clock_worker() = default; + seconds_clock_worker(seconds_clock_worker const&) = delete; + seconds_clock_worker& operator=(seconds_clock_worker const&) = delete; }; //------------------------------------------------------------------------------ diff --git a/src/ripple/beast/crypto/secure_erase.h b/src/ripple/beast/crypto/secure_erase.h index 48280108a7..279fa8748c 100644 --- a/src/ripple/beast/crypto/secure_erase.h +++ b/src/ripple/beast/crypto/secure_erase.h @@ -35,6 +35,10 @@ private: { virtual void operator()( void* dest, std::size_t bytes) const = 0; + virtual ~base() = default; + base() = default; + base(base const&) = delete; + base& operator=(base const&) = delete; }; struct impl : base diff --git a/src/ripple/beast/insight/impl/StatsDCollector.cpp b/src/ripple/beast/insight/impl/StatsDCollector.cpp index 4a1ac17b04..89aa9a2cbb 100644 --- a/src/ripple/beast/insight/impl/StatsDCollector.cpp +++ b/src/ripple/beast/insight/impl/StatsDCollector.cpp @@ -53,6 +53,10 @@ class StatsDMetricBase : public List ::Node { public: virtual void do_process () = 0; + virtual ~StatsDMetricBase() = default; + StatsDMetricBase() = default; + StatsDMetricBase(StatsDMetricBase const&) = delete; + StatsDMetricBase& operator=(StatsDMetricBase const&) = delete; }; //------------------------------------------------------------------------------ diff --git a/src/ripple/beast/utility/PropertyStream.h b/src/ripple/beast/utility/PropertyStream.h index 6ed47f251e..b9bf1dc147 100644 --- a/src/ripple/beast/utility/PropertyStream.h +++ b/src/ripple/beast/utility/PropertyStream.h @@ -282,7 +282,7 @@ private: public: explicit Source (std::string const& name); - ~Source (); + virtual ~Source (); Source (Source const&) = delete; Source& operator= (Source const&) = delete; diff --git a/src/ripple/core/impl/Workers.h b/src/ripple/core/impl/Workers.h index ae67d8ff7e..3ea2716797 100644 --- a/src/ripple/core/impl/Workers.h +++ b/src/ripple/core/impl/Workers.h @@ -44,6 +44,11 @@ public: /** Called to perform tasks as needed. */ struct Callback { + virtual ~Callback () = default; + Callback() = default; + Callback(Callback const&) = delete; + Callback& operator=(Callback const&) = delete; + /** Perform a task. The call is made on a thread owned by Workers. It is important diff --git a/src/ripple/nodestore/Manager.h b/src/ripple/nodestore/Manager.h index c4ccc94a11..eb95b3b223 100644 --- a/src/ripple/nodestore/Manager.h +++ b/src/ripple/nodestore/Manager.h @@ -31,6 +31,11 @@ namespace NodeStore { class Manager { public: + virtual ~Manager () = default; + Manager() = default; + Manager(Manager const&) = delete; + Manager& operator=(Manager const&) = delete; + /** Returns the instance of the manager singleton. */ static Manager& diff --git a/src/ripple/nodestore/impl/BatchWriter.h b/src/ripple/nodestore/impl/BatchWriter.h index 1b7e2c1d6b..57bc486fea 100644 --- a/src/ripple/nodestore/impl/BatchWriter.h +++ b/src/ripple/nodestore/impl/BatchWriter.h @@ -43,6 +43,11 @@ public: /** This callback does the actual writing. */ struct Callback { + virtual ~Callback () = default; + Callback() = default; + Callback(Callback const&) = delete; + Callback& operator=(Callback const&) = delete; + virtual void writeBatch (Batch const& batch) = 0; }; diff --git a/src/ripple/protocol/InnerObjectFormats.h b/src/ripple/protocol/InnerObjectFormats.h index c799841283..50b05dd9d2 100755 --- a/src/ripple/protocol/InnerObjectFormats.h +++ b/src/ripple/protocol/InnerObjectFormats.h @@ -32,6 +32,10 @@ private: void addCommonFields (Item& item); public: + virtual ~InnerObjectFormats () = default; + InnerObjectFormats(InnerObjectFormats const&) = delete; + InnerObjectFormats& operator=(InnerObjectFormats const&) = delete; + /** Create the object. This will load the object will all the known inner object formats. */ diff --git a/src/ripple/protocol/KnownFormats.h b/src/ripple/protocol/KnownFormats.h index 173dcd7d6b..d8d88d9908 100644 --- a/src/ripple/protocol/KnownFormats.h +++ b/src/ripple/protocol/KnownFormats.h @@ -87,17 +87,15 @@ public: Derived classes will load the object will all the known formats. */ - KnownFormats () - { - } + KnownFormats () = default; /** Destroy the known formats object. The defined formats are deleted. */ - ~KnownFormats () - { - } + virtual ~KnownFormats () = default; + KnownFormats(KnownFormats const&) = delete; + KnownFormats& operator=(KnownFormats const&) = delete; /** Retrieve the type for a format specified by name. @@ -180,9 +178,6 @@ protected: virtual void addCommonFields (Item& item) = 0; private: - KnownFormats(KnownFormats const&) = delete; - KnownFormats& operator=(KnownFormats const&) = delete; - std::vector > m_formats; NameMap m_names; TypeMap m_types; diff --git a/src/ripple/server/Session.h b/src/ripple/server/Session.h index db0d359567..102b0094c3 100644 --- a/src/ripple/server/Session.h +++ b/src/ripple/server/Session.h @@ -42,6 +42,8 @@ class Session public: Session() = default; Session (Session const&) = delete; + Session& operator=(Session const&) = delete; + virtual ~Session () = default; /** A user-definable pointer. The initial value is always zero. diff --git a/src/ripple/server/WSSession.h b/src/ripple/server/WSSession.h index b89e5d3cc4..0cd685a637 100644 --- a/src/ripple/server/WSSession.h +++ b/src/ripple/server/WSSession.h @@ -110,6 +110,11 @@ struct WSSession { std::shared_ptr appDefined; + virtual ~WSSession () = default; + WSSession() = default; + WSSession(WSSession const&) = delete; + WSSession& operator=(WSSession const&) = delete; + virtual void run() = 0;