diff --git a/src/catch2/internal/catch_console_colour.cpp b/src/catch2/internal/catch_console_colour.cpp index 099a6c59..e1238816 100644 --- a/src/catch2/internal/catch_console_colour.cpp +++ b/src/catch2/internal/catch_console_colour.cpp @@ -85,7 +85,7 @@ namespace Catch { namespace { //! A do-nothing implementation of colour, used as fallback for unknown //! platforms, and when the user asks to deactivate all colours. - class NoColourImpl : public ColourImpl { + class NoColourImpl final : public ColourImpl { public: NoColourImpl( IStream* stream ): ColourImpl( stream ) {} @@ -103,7 +103,7 @@ namespace Catch { namespace Catch { namespace { - class Win32ColourImpl : public ColourImpl { + class Win32ColourImpl final : public ColourImpl { public: Win32ColourImpl(IStream* stream): ColourImpl(stream) { @@ -169,7 +169,7 @@ namespace { namespace Catch { namespace { - class ANSIColourImpl : public ColourImpl { + class ANSIColourImpl final : public ColourImpl { public: ANSIColourImpl( IStream* stream ): ColourImpl( stream ) {} diff --git a/src/catch2/internal/catch_istream.cpp b/src/catch2/internal/catch_istream.cpp index 489396ec..bf0f66e4 100644 --- a/src/catch2/internal/catch_istream.cpp +++ b/src/catch2/internal/catch_istream.cpp @@ -24,7 +24,7 @@ namespace Catch { namespace Detail { namespace { template - class StreamBufImpl : public std::streambuf { + class StreamBufImpl final : public std::streambuf { char data[bufferSize]; WriterF m_writer; @@ -72,7 +72,7 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// - class FileStream : public IStream { + class FileStream final : public IStream { std::ofstream m_ofs; public: FileStream( std::string const& filename ) { @@ -89,7 +89,7 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// - class CoutStream : public IStream { + class CoutStream final : public IStream { std::ostream m_os; public: // Store the streambuf from cout up-front because @@ -118,7 +118,7 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// - class DebugOutStream : public IStream { + class DebugOutStream final : public IStream { Detail::unique_ptr> m_streamBuf; std::ostream m_os; public: diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp index 8ffa7d47..11fcda45 100644 --- a/src/catch2/internal/catch_run_context.cpp +++ b/src/catch2/internal/catch_run_context.cpp @@ -27,7 +27,7 @@ namespace Catch { namespace Generators { namespace { - struct GeneratorTracker : TestCaseTracking::TrackerBase, + struct GeneratorTracker final : TestCaseTracking::TrackerBase, IGeneratorTracker { GeneratorBasePtr m_generator; @@ -36,7 +36,7 @@ namespace Catch { TrackerContext& ctx, ITracker* parent ): TrackerBase( CATCH_MOVE( nameAndLocation ), ctx, parent ) {} - ~GeneratorTracker() override; + ~GeneratorTracker() override = default; static GeneratorTracker* acquire( TrackerContext& ctx, @@ -161,7 +161,6 @@ namespace Catch { m_generator = CATCH_MOVE( generator ); } }; - GeneratorTracker::~GeneratorTracker() = default; } // namespace } diff --git a/src/catch2/internal/catch_run_context.hpp b/src/catch2/internal/catch_run_context.hpp index ea2ca7c8..de6999e5 100644 --- a/src/catch2/internal/catch_run_context.hpp +++ b/src/catch2/internal/catch_run_context.hpp @@ -29,7 +29,7 @@ namespace Catch { /////////////////////////////////////////////////////////////////////////// - class RunContext : public IResultCapture { + class RunContext final : public IResultCapture { public: RunContext( RunContext const& ) = delete;