Workaround ABI incompatibility between clang ang gcc

This commit is contained in:
Victor Zverovich
2025-10-18 07:39:31 -07:00
parent 85f6ecc7a0
commit e2aa06cd0a
2 changed files with 5 additions and 2 deletions

View File

@@ -924,7 +924,10 @@ class locale_ref {
constexpr locale_ref() : locale_(nullptr) {}
template <typename Locale, FMT_ENABLE_IF(sizeof(Locale::collate) != 0)>
locale_ref(const Locale& loc);
locale_ref(const Locale& loc) : locale_(&loc) {
// Check if std::isalpha is found via ADL to reduce the chance of misuse.
isalpha('x', loc);
}
inline explicit operator bool() const noexcept { return locale_ != nullptr; }
#endif // FMT_USE_LOCALE

View File

@@ -10,7 +10,7 @@
FMT_BEGIN_NAMESPACE
#if FMT_USE_LOCALE
template FMT_API locale_ref::locale_ref(const std::locale& loc);
template FMT_API locale_ref::locale_ref(const std::locale& loc); // DEPRECATED!
template FMT_API auto locale_ref::get<std::locale>() const -> std::locale;
#endif