Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress formattable hides the global definition warning #4378

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,10 @@ FMT_CONSTEXPR inline auto check_char_specs(const format_specs& specs) -> bool {
// A base class for compile-time strings.
struct compile_string {};

#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4459) // declaration hides global declaration
#endif
template <typename T, typename Char>
FMT_VISIBILITY("hidden") // Suppress an ld warning on macOS (#3769).
FMT_CONSTEXPR auto invoke_parse(parse_context<Char>& ctx) -> const Char* {
Expand All @@ -1668,6 +1672,9 @@ FMT_CONSTEXPR auto invoke_parse(parse_context<Char>& ctx) -> const Char* {
using formatted_type = conditional_t<formattable, mapped_type, int>;
return formatter<formatted_type, Char>().parse(ctx);
}
#ifdef _MSC_VER
#pragma warning(pop) // Restore 4459
#endif

template <typename... T> struct arg_pack {};

Expand Down
Loading