Skip to content

Commit

Permalink
Fix build with gcc 5.4
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cmorve-te authored and horenmar committed Mar 12, 2024
1 parent 8ac8190 commit 459ac85
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/catch2/internal/catch_decomposer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 459ac85

Please sign in to comment.