Skip to content

Commit 65a7b3b

Browse files
authored
Update base.h
1 parent b8a0273 commit 65a7b3b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

include/fmt/base.h

+10-3
Original file line numberDiff line numberDiff line change
@@ -1658,16 +1658,23 @@ FMT_CONSTEXPR inline auto check_char_specs(const format_specs& specs) -> bool {
16581658
// A base class for compile-time strings.
16591659
struct compile_string {};
16601660

1661+
#if defined(_MSC_VER)
1662+
#pragma warning(push)
1663+
#pragma warning(disable : 4459) // declaration hides global declaration
1664+
#endif
16611665
template <typename T, typename Char>
16621666
FMT_VISIBILITY("hidden") // Suppress an ld warning on macOS (#3769).
16631667
FMT_CONSTEXPR auto invoke_parse(parse_context<Char>& ctx) -> const Char* {
16641668
using mapped_type = remove_cvref_t<mapped_t<T, Char>>;
1665-
constexpr bool is_formattable =
1669+
constexpr bool formattable =
16661670
std::is_constructible<formatter<mapped_type, Char>>::value;
1667-
if (!is_formattable) return ctx.begin(); // Error is reported in the value ctor.
1668-
using formatted_type = conditional_t<is_formattable, mapped_type, int>;
1671+
if (!formattable) return ctx.begin(); // Error is reported in the value ctor.
1672+
using formatted_type = conditional_t<formattable, mapped_type, int>;
16691673
return formatter<formatted_type, Char>().parse(ctx);
16701674
}
1675+
#ifdef _MSC_VER
1676+
#pragma warning(pop) // Restore 4459
1677+
#endif
16711678

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

0 commit comments

Comments
 (0)