Skip to content

Commit

Permalink
Fix codecvt warning (#2408) (#2725)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-volnov committed Jan 19, 2022
1 parent b8b037e commit cdf1a3b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions include/fmt/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,13 @@ constexpr const size_t codecvt_result<CodeUnit>::max_size;
template <typename CodeUnit>
void write_codecvt(codecvt_result<CodeUnit>& out, string_view in_buf,
const std::locale& loc) {
using codecvt = std::codecvt<CodeUnit, char, std::mbstate_t>;
#if FMT_CLANG_VERSION
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated"
auto& f = std::use_facet<codecvt>(loc);
auto& f = std::use_facet<std::codecvt<CodeUnit, char, std::mbstate_t>>(loc);
# pragma clang diagnostic pop
#else
auto& f = std::use_facet<codecvt>(loc);
auto& f = std::use_facet<std::codecvt<CodeUnit, char, std::mbstate_t>>(loc);
#endif
auto mb = std::mbstate_t();
const char* from_next = nullptr;
Expand Down

0 comments on commit cdf1a3b

Please sign in to comment.