From 43c805bb090cd5989e63b88d20489e929e7ca025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= Date: Mon, 1 May 2023 21:30:29 +0200 Subject: [PATCH] Suppress most likely false positive with GCC 13 --- include/fmt/core.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/fmt/core.h b/include/fmt/core.h index 7cc60924..80d04701 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1671,7 +1671,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;