Skip to content

Commit b2a96c6

Browse files
committed
Stop doing heroics for pathological user code
1 parent 45f230b commit b2a96c6

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

include/fmt/base.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ FMT_PRAGMA_GCC(push_options)
235235
FMT_PRAGMA_GCC(optimize("Og"))
236236
#endif
237237
FMT_PRAGMA_CLANG(diagnostic push)
238-
FMT_PRAGMA_GCC(diagnostic push)
239238

240239
#ifdef FMT_ALWAYS_INLINE
241240
// Use the provided definition.
@@ -2794,8 +2793,6 @@ template <typename Context = context, typename... T,
27942793
ullong DESC = detail::make_descriptor<Context, T...>()>
27952794
constexpr FMT_ALWAYS_INLINE auto make_format_args(T&... args)
27962795
-> detail::format_arg_store<Context, NUM_ARGS, NUM_NAMED_ARGS, DESC> {
2797-
// Suppress warnings for pathological types convertible to detail::value.
2798-
FMT_PRAGMA_GCC(diagnostic ignored "-Wconversion")
27992796
return {{args...}};
28002797
}
28012798

@@ -2968,7 +2965,6 @@ FMT_INLINE void println(format_string<T...> fmt, T&&... args) {
29682965
return fmt::println(stdout, fmt, static_cast<T&&>(args)...);
29692966
}
29702967

2971-
FMT_PRAGMA_GCC(diagnostic pop)
29722968
FMT_PRAGMA_CLANG(diagnostic pop)
29732969
FMT_PRAGMA_GCC(pop_options)
29742970
FMT_END_EXPORT

test/base-test.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#include "test-assert.h"
1111
// clang-format on
1212

13+
// Suppress warnings for pathological types convertible to detail::value.
14+
#pragma GCC diagnostic ignored "-Wconversion"
15+
1316
#include "fmt/base.h"
1417

1518
#include <limits.h> // INT_MAX

0 commit comments

Comments
 (0)