Skip to content

Commit 548e14a

Browse files
committed
Mark some extra classes final
1 parent b670de4 commit 548e14a

11 files changed

Lines changed: 14 additions & 14 deletions

src/catch2/benchmark/detail/catch_benchmark_function.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace Catch {
4141
callable& operator=(callable&&) = default;
4242
};
4343
template <typename Fun>
44-
struct model : public callable {
44+
struct model final : public callable {
4545
model(Fun&& fun_) : fun(CATCH_MOVE(fun_)) {}
4646
model(Fun const& fun_) : fun(fun_) {}
4747

src/catch2/benchmark/detail/catch_run_for_at_least.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace Catch {
1515
namespace Benchmark {
1616
namespace Detail {
17-
struct optimized_away_error : std::exception {
17+
struct optimized_away_error final : std::exception {
1818
const char* what() const noexcept override;
1919
};
2020

src/catch2/catch_translate_exception.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Catch {
2222

2323
class ExceptionTranslatorRegistrar {
2424
template<typename T>
25-
class ExceptionTranslator : public IExceptionTranslator {
25+
class ExceptionTranslator final : public IExceptionTranslator {
2626
public:
2727

2828
constexpr ExceptionTranslator( std::string(*translateFunction)( T const& ) )

src/catch2/internal/catch_decomposer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ namespace Catch {
193193
void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs );
194194

195195
template<typename LhsT, typename RhsT>
196-
class BinaryExpr : public ITransientExpression {
196+
class BinaryExpr final : public ITransientExpression {
197197
LhsT m_lhs;
198198
StringRef m_op;
199199
RhsT m_rhs;
@@ -269,7 +269,7 @@ namespace Catch {
269269
};
270270

271271
template<typename LhsT>
272-
class UnaryExpr : public ITransientExpression {
272+
class UnaryExpr final : public ITransientExpression {
273273
LhsT m_lhs;
274274

275275
void streamReconstructedExpression( std::ostream &os ) const override {

src/catch2/internal/catch_enum_values_registry.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Catch {
2020

2121
Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values );
2222

23-
class EnumValuesRegistry : public IMutableEnumValuesRegistry {
23+
class EnumValuesRegistry final : public IMutableEnumValuesRegistry {
2424

2525
std::vector<Catch::Detail::unique_ptr<EnumInfo>> m_enumInfos;
2626

src/catch2/internal/catch_exception_translator_registry.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
namespace Catch {
1717

18-
class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry {
18+
class ExceptionTranslatorRegistry final : public IExceptionTranslatorRegistry {
1919
public:
2020
~ExceptionTranslatorRegistry() override;
2121
void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator );

src/catch2/internal/catch_output_redirect.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace Catch {
3333
namespace {
3434
//! A no-op implementation, used if no reporter wants output
3535
//! redirection.
36-
class NoopRedirect : public OutputRedirect {
36+
class NoopRedirect final : public OutputRedirect {
3737
void activateImpl() override {}
3838
void deactivateImpl() override {}
3939
std::string getStdout() override { return {}; }
@@ -70,7 +70,7 @@ namespace Catch {
7070
* Redirects the `std::cout`, `std::cerr`, `std::clog` streams,
7171
* but does not touch the actual `stdout`/`stderr` file descriptors.
7272
*/
73-
class StreamRedirect : public OutputRedirect {
73+
class StreamRedirect final : public OutputRedirect {
7474
ReusableStringStream m_redirectedOut, m_redirectedErr;
7575
RedirectedStreamNew m_cout, m_cerr, m_clog;
7676

@@ -181,7 +181,7 @@ namespace Catch {
181181
* Works by replacing the file descriptors numbered 1 and 2
182182
* with an open temporary file.
183183
*/
184-
class FileRedirect : public OutputRedirect {
184+
class FileRedirect final : public OutputRedirect {
185185
TempFile m_outFile, m_errFile;
186186
int m_originalOut = -1;
187187
int m_originalErr = -1;

src/catch2/internal/catch_singletons.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Catch {
2020

2121

2222
template<typename SingletonImplT, typename InterfaceT = SingletonImplT, typename MutableInterfaceT = InterfaceT>
23-
class Singleton : SingletonImplT, public ISingleton {
23+
class Singleton final : SingletonImplT, public ISingleton {
2424

2525
static auto getInternal() -> Singleton* {
2626
static Singleton* s_instance = nullptr;

src/catch2/internal/catch_tag_alias_registry.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace Catch {
1818
struct SourceLineInfo;
1919

20-
class TagAliasRegistry : public ITagAliasRegistry {
20+
class TagAliasRegistry final : public ITagAliasRegistry {
2121
public:
2222
~TagAliasRegistry() override;
2323
TagAlias const* find( std::string const& alias ) const override;

src/catch2/internal/catch_test_case_registry_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace Catch {
2828
std::vector<TestCaseHandle> filterTests( std::vector<TestCaseHandle> const& testCases, TestSpec const& testSpec, IConfig const& config );
2929
std::vector<TestCaseHandle> const& getAllTestCasesSorted( IConfig const& config );
3030

31-
class TestRegistry : public ITestCaseRegistry {
31+
class TestRegistry final : public ITestCaseRegistry {
3232
public:
3333
void registerTest( Detail::unique_ptr<TestCaseInfo> testInfo, Detail::unique_ptr<ITestInvoker> testInvoker );
3434

0 commit comments

Comments
 (0)