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

Xing Xue via Openmp-commits openmp-commits at lists.llvm.org
Tue Jun 4 04:01:54 PDT 2024


================
@@ -590,7 +616,24 @@ protected:
 
 private:
   basic_ostream<char_type, traits_type>* __tie_;
-  mutable int_type __fill_;
+
+#if defined(_AIX) || (defined(__MVS__) && defined(__64BIT__))
+// AIX and 64-bit MVS must use _OptionalFill for ABI backward compatibility.
+  using _FillType = _OptionalFill<_Traits>;
+#else
+#if defined(_WIN32)
+  static const bool _OptOutForABICompat = true;
+#else
+  static const bool _OptOutForABICompat = false;
+#endif
+
+  using _FillType = _If<
+      sizeof(char_type) >= sizeof(int_type) && !_OptOutForABICompat,
+      _OptionalFill<_Traits>,
+      _SentinelValueFill<_Traits>
+  >;
+#endif
----------------
xingxue-ibm wrote:

Thanks very much for the suggestion, @daltenty! This makes it fits nicely in the platform ABI logic.

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


More information about the Openmp-commits mailing list