Issue #2749 - Part 8 - Put mfbt/casting.h pragmas behind GCC conditional.

This commit is contained in:
trav90 2025-05-21 10:37:30 -05:00 committed by roytam1
commit 497b6d5854

View file

@ -75,10 +75,13 @@ constexpr uint64_t safe_integer_unsigned() {
return std::pow(2, std::numeric_limits<T>::digits);
}
#ifdef __GNUC__
// This is working around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81676,
// fixed in gcc-10
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
template <typename In, typename Out>
bool IsInBounds(In aIn) {
constexpr bool inSigned = std::is_signed_v<In>;
@ -161,7 +164,10 @@ bool IsInBounds(In aIn) {
}
return true;
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
} // namespace detail