diff --git a/fmt/format.cc b/fmt/format.cc index 339138f8..266f8702 100644 --- a/fmt/format.cc +++ b/fmt/format.cc @@ -58,6 +58,10 @@ # define FMT_CATCH(x) if (false) #endif +// Disable the warning about declaration shadowing because it affects too +// many valid cases. +#pragma GCC diagnostic ignored "-Wshadow" + #ifdef _MSC_VER # pragma warning(push) # pragma warning(disable: 4127) // conditional expression is constant diff --git a/fmt/format.h b/fmt/format.h index 6c32ecc1..b2f3e56a 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -3766,6 +3766,13 @@ operator"" _a(const wchar_t *s, std::size_t) { return {s}; } } // namespace fmt #endif // FMT_USE_USER_DEFINED_LITERALS +#ifdef FMT_HEADER_ONLY +# define FMT_FUNC inline +# include "format.cc" +#else +# define FMT_FUNC +#endif + // Restore warnings. #if FMT_GCC_VERSION >= 406 # pragma GCC diagnostic pop @@ -3775,11 +3782,4 @@ operator"" _a(const wchar_t *s, std::size_t) { return {s}; } # pragma clang diagnostic pop #endif -#ifdef FMT_HEADER_ONLY -# define FMT_FUNC inline -# include "format.cc" -#else -# define FMT_FUNC -#endif - #endif // FMT_FORMAT_H_