From fe5d8d61cc3048a378752a99dac77664949bf0f9 Mon Sep 17 00:00:00 2001 From: Hannes Friederich Date: Fri, 5 Aug 2022 01:02:48 -0700 Subject: [PATCH] suppress unused typedef warning Summary: We're seeing the following compiler warnings: ``` unused type alias 'char_type' [-Werror,-Wunused-local-typedef] ``` and this breaks compilation since we build with `-Werror`. I haven't fully understood why & when this warning is triggered (it doesn't always trigger), but by adding a `[[maybe_unused]]` we can suppress the warning. Reviewed By: vitaut Differential Revision: D38387281 fbshipit-source-id: a12c9791fcf3eb6bae72a78310ed461f882a9eb7 --- deps/fmt/include/fmt/format.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/deps/fmt/include/fmt/format.h b/deps/fmt/include/fmt/format.h index ee23ad76..b48fb48a 100644 --- a/deps/fmt/include/fmt/format.h +++ b/deps/fmt/include/fmt/format.h @@ -2360,18 +2360,18 @@ FMT_CONSTEXPR void handle_dynamic_spec(int& value, } } -#define FMT_STRING_IMPL(s, base, explicit) \ - [] { \ - /* Use the hidden visibility as a workaround for a GCC bug (#1973). */ \ - /* Use a macro-like name to avoid shadowing warnings. */ \ - struct FMT_GCC_VISIBILITY_HIDDEN FMT_COMPILE_STRING : base { \ - using char_type = fmt::remove_cvref_t; \ - FMT_MAYBE_UNUSED FMT_CONSTEXPR explicit \ - operator fmt::basic_string_view() const { \ - return fmt::detail_exported::compile_string_to_view(s); \ - } \ - }; \ - return FMT_COMPILE_STRING(); \ +#define FMT_STRING_IMPL(s, base, explicit) \ + [] { \ + /* Use the hidden visibility as a workaround for a GCC bug (#1973). */ \ + /* Use a macro-like name to avoid shadowing warnings. */ \ + struct FMT_GCC_VISIBILITY_HIDDEN FMT_COMPILE_STRING : base { \ + using char_type FMT_MAYBE_UNUSED = fmt::remove_cvref_t; \ + FMT_MAYBE_UNUSED FMT_CONSTEXPR explicit \ + operator fmt::basic_string_view() const { \ + return fmt::detail_exported::compile_string_to_view(s); \ + } \ + }; \ + return FMT_COMPILE_STRING(); \ }() /**