mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-24 03:09:57 +01:00
Fix leaky diagnostic ignored pragma (#4588)
Ignoring the `-Wconversion` diagnostic in `make_format_args` was leaking out of the header, resulting in that warning being ignored in downstream code that includes `fmt/base.h`. Instead, we should `push`/`pop` the diagnostics to ensure this is cleaned up.
This commit is contained in:
@@ -236,6 +236,7 @@ FMT_PRAGMA_GCC(optimize("Og"))
|
||||
# define FMT_GCC_OPTIMIZED
|
||||
#endif
|
||||
FMT_PRAGMA_CLANG(diagnostic push)
|
||||
FMT_PRAGMA_GCC(diagnostic push)
|
||||
|
||||
#ifdef FMT_ALWAYS_INLINE
|
||||
// Use the provided definition.
|
||||
@@ -2997,6 +2998,7 @@ FMT_INLINE void println(format_string<T...> fmt, T&&... args) {
|
||||
return fmt::println(stdout, fmt, static_cast<T&&>(args)...);
|
||||
}
|
||||
|
||||
FMT_PRAGMA_GCC(diagnostic pop)
|
||||
FMT_PRAGMA_CLANG(diagnostic pop)
|
||||
FMT_PRAGMA_GCC(pop_options)
|
||||
FMT_END_EXPORT
|
||||
|
||||
Reference in New Issue
Block a user