From b789fb52dd84feb3bea47cead8a29d3c3169074d Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 6 Dec 2024 12:00:40 +0200 Subject: [PATCH] Added final keywords --- include/spdlog/common.h | 2 +- include/spdlog/sinks/dup_filter_sink.h | 2 +- include/spdlog/sinks/syslog_sink.h | 2 +- tests/test_errors.cpp | 2 +- tests/test_pattern_formatter.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 7a9aee2e..876d2cb9 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -120,7 +120,7 @@ enum class pattern_time_type { // // Log exception // -class SPDLOG_API spdlog_ex : public std::exception { +class SPDLOG_API spdlog_ex final : public std::exception { public: explicit spdlog_ex(std::string msg); diff --git a/include/spdlog/sinks/dup_filter_sink.h b/include/spdlog/sinks/dup_filter_sink.h index 896f6e0b..f0530d57 100644 --- a/include/spdlog/sinks/dup_filter_sink.h +++ b/include/spdlog/sinks/dup_filter_sink.h @@ -37,7 +37,7 @@ namespace spdlog { namespace sinks { template -class dup_filter_sink : public dist_sink { +class dup_filter_sink final : public dist_sink { public: template explicit dup_filter_sink(std::chrono::duration max_skip_duration, level notification_level = level::info) diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index cb724934..65f74bfa 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -17,7 +17,7 @@ namespace sinks { * Sink that write to syslog using the `syscall()` library call. */ template -class syslog_sink : public base_sink { +class syslog_sink final : public base_sink { public: syslog_sink(std::string ident, int syslog_option, int syslog_facility, bool enable_formatting) : enable_formatting_{enable_formatting}, diff --git a/tests/test_errors.cpp b/tests/test_errors.cpp index db7d43fe..0a73d68f 100644 --- a/tests/test_errors.cpp +++ b/tests/test_errors.cpp @@ -10,7 +10,7 @@ #define SIMPLE_LOG "test_logs/simple_log.txt" #define SIMPLE_ASYNC_LOG "test_logs/simple_async_log.txt" -class failing_sink : public spdlog::sinks::base_sink { +class failing_sink final : public spdlog::sinks::base_sink { protected: void sink_it_(const spdlog::details::log_msg &) final { throw std::runtime_error("some error happened during log"); } diff --git a/tests/test_pattern_formatter.cpp b/tests/test_pattern_formatter.cpp index fd75cb97..85f2114b 100644 --- a/tests/test_pattern_formatter.cpp +++ b/tests/test_pattern_formatter.cpp @@ -292,7 +292,7 @@ TEST_CASE("clone-formatter-2", "[pattern_formatter]") { REQUIRE(to_string_view(formatted_1) == to_string_view(formatted_2)); } -class custom_test_flag : public spdlog::custom_flag_formatter { +class custom_test_flag final : public spdlog::custom_flag_formatter { public: explicit custom_test_flag(std::string txt) : some_txt{std::move(txt)} {}