[libcxx-commits] [libcxx] [openmp] [libc++] basic_ios<wchar_t> cannot store fill character WCHAR_MAX (PR #89305)

David Tenty via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 10 13:34:55 PDT 2024


================
@@ -91,6 +91,16 @@
 #  define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_STRING_VIEW
 // Dont' add an inline namespace for `std::filesystem`
 #    define _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE
+// libcxx std::basic_ios uses WEOF to indicate that the fill value is
+// uninitialized. However, on platforms where the size of char_type is
+// equal to or greater than the size of int_type and char_type is unsigned,
+// std::char_traits<char_type>::eq_int_type() cannot distinguish between WEOF
+// and WCHAR_MAX. New helper class _FillHelper uses a boolean variable to indicate
+// whether the fill value has been initialized so that a fill value WEOF set
+// by the user won't be treated as indicating the fill value is uninitialized.
+// Undefining macro _LIBCXX_IOS_USE_FILL_HELPER to keep the ABI verson 1
+// behavior if needed.
----------------
daltenty wrote:

I think this comment is a bit confusing (there is no undef here, nor is it need at the moment) and probably redundant (of course you can not def the macro to opt out, that's generally the same for every macro in this config file)
```suggestion
```

https://github.com/llvm/llvm-project/pull/89305


More information about the libcxx-commits mailing list