diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/gsl/narrow | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/gsl/narrow b/include/gsl/narrow index bad581c..2c3c518 100644 --- a/include/gsl/narrow +++ b/include/gsl/narrow @@ -43,10 +43,17 @@ GSL_SUPPRESS(p.2) // NO-FORMAT: attribute // don't rely on undefined behavior // and cannot fit into the destination integral type), the resultant behavior is benign on the platforms
// that we target (i.e., no hardware trap representations are hit).
+#if defined(__clang__) || defined(__GNUC__)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
if (static_cast<U>(t) != u || (is_different_signedness && ((t < T{}) != (u < U{}))))
{
throw narrowing_error{};
}
+#if defined(__clang__) || defined(__GNUC__)
+ #pragma GCC diagnostic pop
+#endif
return t;
}
|