From 497b6d5854b5f4d1becf16ea0124430c370b3521 Mon Sep 17 00:00:00 2001 From: trav90 Date: Wed, 21 May 2025 10:37:30 -0500 Subject: [PATCH] Issue #2749 - Part 8 - Put mfbt/casting.h pragmas behind GCC conditional. --- mfbt/Casting.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mfbt/Casting.h b/mfbt/Casting.h index 4a2e4a1411..518208ebe1 100644 --- a/mfbt/Casting.h +++ b/mfbt/Casting.h @@ -75,10 +75,13 @@ constexpr uint64_t safe_integer_unsigned() { return std::pow(2, std::numeric_limits::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 bool IsInBounds(In aIn) { constexpr bool inSigned = std::is_signed_v; @@ -161,7 +164,10 @@ bool IsInBounds(In aIn) { } return true; } + +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif } // namespace detail