From b2a96c60873788078aab0459700841cad9413ae7 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 29 Jan 2026 20:44:16 -0800 Subject: [PATCH] Stop doing heroics for pathological user code --- include/fmt/base.h | 4 ---- test/base-test.cc | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index 8540f3d3..5151232c 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -235,7 +235,6 @@ FMT_PRAGMA_GCC(push_options) FMT_PRAGMA_GCC(optimize("Og")) #endif FMT_PRAGMA_CLANG(diagnostic push) -FMT_PRAGMA_GCC(diagnostic push) #ifdef FMT_ALWAYS_INLINE // Use the provided definition. @@ -2794,8 +2793,6 @@ template ()> constexpr FMT_ALWAYS_INLINE auto make_format_args(T&... args) -> detail::format_arg_store { - // Suppress warnings for pathological types convertible to detail::value. - FMT_PRAGMA_GCC(diagnostic ignored "-Wconversion") return {{args...}}; } @@ -2968,7 +2965,6 @@ FMT_INLINE void println(format_string fmt, T&&... args) { return fmt::println(stdout, fmt, static_cast(args)...); } -FMT_PRAGMA_GCC(diagnostic pop) FMT_PRAGMA_CLANG(diagnostic pop) FMT_PRAGMA_GCC(pop_options) FMT_END_EXPORT diff --git a/test/base-test.cc b/test/base-test.cc index 0231e422..7f5c5c7b 100644 --- a/test/base-test.cc +++ b/test/base-test.cc @@ -10,6 +10,9 @@ #include "test-assert.h" // clang-format on +// Suppress warnings for pathological types convertible to detail::value. +#pragma GCC diagnostic ignored "-Wconversion" + #include "fmt/base.h" #include // INT_MAX