From 459ac8562b4f4b23280003beabeca910e823627a Mon Sep 17 00:00:00 2001 From: Cristian Morales Vega Date: Mon, 11 Mar 2024 11:33:29 +0000 Subject: [PATCH] Fix build with gcc 5.4 The Core Guidelines state "A base class destructor should be either public and virtual, or protected and non-virtual" so, hopefully, no static analyser will complain. --- src/catch2/internal/catch_decomposer.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/catch2/internal/catch_decomposer.hpp b/src/catch2/internal/catch_decomposer.hpp index e693bf57..143ee3d3 100644 --- a/src/catch2/internal/catch_decomposer.hpp +++ b/src/catch2/internal/catch_decomposer.hpp @@ -164,14 +164,13 @@ namespace Catch { ITransientExpression(ITransientExpression const&) = default; ITransientExpression& operator=(ITransientExpression const&) = default; - // We don't actually need a virtual destructor, but many static analysers - // complain if it's not here :-( - virtual ~ITransientExpression() = default; - friend std::ostream& operator<<(std::ostream& out, ITransientExpression const& expr) { expr.streamReconstructedExpression(out); return out; } + + protected: + ~ITransientExpression() = default; }; void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs );