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.
This commit is contained in:
Cristian Morales Vega 2024-03-11 11:33:29 +00:00 committed by Martin Hořeňovský
parent 8ac8190e49
commit 459ac8562b

View File

@ -164,14 +164,13 @@ namespace Catch {
ITransientExpression(ITransientExpression const&) = default; ITransientExpression(ITransientExpression const&) = default;
ITransientExpression& operator=(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) { friend std::ostream& operator<<(std::ostream& out, ITransientExpression const& expr) {
expr.streamReconstructedExpression(out); expr.streamReconstructedExpression(out);
return out; return out;
} }
protected:
~ITransientExpression() = default;
}; };
void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ); void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs );