From ba747e554489263046a67e6a4a551c8f080e1c0f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 1 May 2023 21:10:18 -0400 Subject: [PATCH] suppress bogus warnings with gcc 13.0 and later --- src/fmt/core.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fmt/core.h b/src/fmt/core.h index 0634f94412..86d60485f2 100644 --- a/src/fmt/core.h +++ b/src/fmt/core.h @@ -1742,7 +1742,14 @@ constexpr auto encode_types() -> unsigned long long { template FMT_CONSTEXPR FMT_INLINE auto make_value(T&& val) -> value { +#if FMT_GCC_VERSION && FMT_GCC_VERSION >= 1300 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdangling-reference" const auto& arg = arg_mapper().map(FMT_FORWARD(val)); +# pragma GCC diagnostic pop +#else + const auto& arg = arg_mapper().map(FMT_FORWARD(val)); +#endif constexpr bool formattable_char = !std::is_same::value;