Skip to content

Commit 7e68e8f

Browse files
committed
Suppress float-equal warning in narrow_cast
1 parent b9f4be0 commit 7e68e8f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

include/gsl/util

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,14 @@ GSL_NODISCARD auto finally(F&& f) noexcept
178178
template <class T, class U>
179179
GSL_SUPPRESS(type.1) constexpr T narrow_cast(U&& u) noexcept
180180
{
181+
#if defined(__clang__) || defined(__GNUC__)
182+
#pragma GCC diagnostic push
183+
#pragma GCC diagnostic ignored "-Wfloat-equal"
184+
#endif
181185
return static_cast<T>(std::forward<U>(u));
186+
#if defined(__clang__) || defined(__GNUC__)
187+
#pragma GCC diagnostic pop
188+
#endif
182189
}
183190

184191
//

0 commit comments

Comments
 (0)