This commit is contained in:
Victor Zverovich 2024-09-11 16:05:34 -07:00
parent 28143dc99d
commit 689ec7a087
3 changed files with 3 additions and 5 deletions

View File

@ -1668,10 +1668,8 @@ class get_locale {
public:
get_locale(bool localized, locale_ref loc) : has_locale_(localized) {
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
if (localized)
::new (&locale_) std::locale(loc.template get<std::locale>());
#endif
}
~get_locale() {
if (has_locale_) locale_.~locale();

View File

@ -15,7 +15,7 @@
#ifndef FMT_MODULE
# include <cwchar>
# if !defined(FMT_STATIC_THOUSANDS_SEPARATOR)
# if FMT_USE_LOCALE
# include <locale>
# endif
#endif
@ -45,7 +45,7 @@ using format_string_char_t = typename format_string_char<S>::type;
inline auto write_loc(basic_appender<wchar_t> out, loc_value value,
const format_specs& specs, locale_ref loc) -> bool {
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
#if FMT_USE_LOCALE
auto& numpunct =
std::use_facet<std::numpunct<wchar_t>>(loc.get<std::locale>());
auto separator = std::wstring();

View File

@ -2514,7 +2514,7 @@ TEST(format_test, writer) {
}
#if FMT_USE_BITINT
# pragma clang diagnostic ignored "-Wbit-int-extension"
FMT_CLANG_PRAGMA(diagnostic ignored "-Wbit-int-extension")
TEST(format_test, bitint) {
using fmt::detail::bitint;