Skip to content

Commit

Permalink
Explicitly outline TestRegistry destructor into .cpp file
Browse files Browse the repository at this point in the history
This fixes compilation issue with C++23 mode against libstdc++.

Closes #2852
  • Loading branch information
horenmar committed Apr 8, 2024
1 parent 05fb437 commit cd8f97e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/catch2/internal/catch_test_case_registry_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ namespace Catch {
return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config );
}

TestRegistry::~TestRegistry() = default;

void TestRegistry::registerTest(Detail::unique_ptr<TestCaseInfo> testInfo, Detail::unique_ptr<ITestInvoker> testInvoker) {
m_handles.emplace_back(testInfo.get(), testInvoker.get());
m_viewed_test_infos.push_back(testInfo.get());
Expand Down
2 changes: 2 additions & 0 deletions src/catch2/internal/catch_test_case_registry_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace Catch {
std::vector<TestCaseHandle> const& getAllTests() const override;
std::vector<TestCaseHandle> const& getAllTestsSorted( IConfig const& config ) const override;

~TestRegistry() override; // = default

private:
std::vector<Detail::unique_ptr<TestCaseInfo>> m_owned_test_infos;
// Keeps a materialized vector for `getAllInfos`.
Expand Down

0 comments on commit cd8f97e

Please sign in to comment.