Add Wfloat-equal to default-enabled warnings

This is kinda messy, because there is no good way to signal to
the compiler that some code uses direct comparison of floating
point numbers intentionally, so instead we have to use diagnostic
pragmas.

We also have to over-suppress the test files, because Clang (and
possibly GCC) still issue warnings from template instantiation
even if the instantion site is under warning suppression, so the
template definition has to be under warning suppression as well.

Closes #2406
This commit is contained in:
Martin Hořeňovský committed 2022-05-14 15:47:20 +02:00
1 parent 1ef65d60f1
commit fc3d11b1d1
16 files changed
+157 -110

No files matched your search

+2 -2
View File
@@ -845,10 +845,10 @@ TEST_CASE( "Combining concrete matchers does not use templated matchers",
struct MatcherA : Catch::Matchers::MatcherGenericBase {
std::string describe() const override {
return "equals: (int) 1 or (float) 1.0f";
return "equals: (int) 1 or (string) \"1\"";
}
bool match( int i ) const { return i == 1; }
bool match( float f ) const { return f == 1.0f; }
bool match( std::string s ) const { return s == "1"; }
};
struct MatcherB : Catch::Matchers::MatcherGenericBase {