[libcxx-commits] [libcxx] [libc++] Cast 0 to `__locale_t` in `text_encoding.cpp` (PR #205882)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jun 25 12:57:51 PDT 2026
================
@@ -31,7 +31,7 @@ static text_encoding __make_text_encoding(const char* __name) {
std::text_encoding __get_locale_encoding(const char* __name) {
if (__name == nullptr)
- return __make_text_encoding(__locale::__get_locale_encoding(static_cast<__locale::__locale_t>(nullptr)));
+ return __make_text_encoding(__locale::__get_locale_encoding(static_cast<__locale::__locale_t>(0)));
----------------
ldionne wrote:
Any reason for not using `__locale::__locale_t()` instead (value constructed `locale_t`)?
https://github.com/llvm/llvm-project/pull/205882
More information about the libcxx-commits
mailing list