From f61f15cc5b11582d50d02ba0514c5344f7b2600e Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 6 May 2023 06:32:10 -0700 Subject: [PATCH] Suppress a false positive in gcc --- include/fmt/core.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 7cc60924..06477a81 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -785,7 +785,7 @@ FMT_MODULE_EXPORT template class basic_format_args; FMT_MODULE_EXPORT template class dynamic_format_arg_store; // A formatter for objects of type T. -FMT_MODULE_EXPORT +FMT_MODULE_EXPORT template struct formatter { // A deleted default constructor indicates a disabled formatter. @@ -1671,22 +1671,22 @@ constexpr auto encode_types() -> unsigned long long { template FMT_CONSTEXPR FMT_INLINE auto make_value(T&& val) -> value { - const auto& arg = arg_mapper().map(FMT_FORWARD(val)); + auto&& arg = arg_mapper().map(FMT_FORWARD(val)); + using arg_type = remove_cvref_t; constexpr bool formattable_char = - !std::is_same::value; + !std::is_same::value; static_assert(formattable_char, "Mixing character types is disallowed."); // Formatting of arbitrary pointers is disallowed. If you want to format a // pointer cast it to `void*` or `const void*`. In particular, this forbids // formatting of `[const] volatile char*` printed as bool by iostreams. constexpr bool formattable_pointer = - !std::is_same::value; + !std::is_same::value; static_assert(formattable_pointer, "Formatting of non-void pointers is disallowed."); - constexpr bool formattable = - !std::is_same::value; + constexpr bool formattable = !std::is_same::value; static_assert( formattable, "Cannot format an argument. To make type T formattable provide a "