[libcxx-commits] [libcxx] [libc++] Fix initialization-order-fiasco with iostream.cpp constructors (PR #126995)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 13 00:04:16 PST 2025


================
@@ -18,8 +18,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class StreamT, class BufferT>
 union stream_data {
-  stream_data() {}
-  ~stream_data() {}
+  constexpr stream_data() {}
+  constexpr ~stream_data() {}
   struct {
     // The stream has to be the first element, since that's referenced by the stream declarations in <iostream>
----------------
philnik777 wrote:

Can we mark the stream objects below as `constinit`?

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


More information about the libcxx-commits mailing list