[libcxx-commits] [libcxx] [libc++][stringbuf] Test and document LWG2995. (PR #100879)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 30 09:45:56 PDT 2024


================
@@ -354,9 +354,13 @@ private:
 
 public:
   // [stringbuf.cons] constructors:
-  _LIBCPP_HIDE_FROM_ABI basic_stringbuf() : __hm_(nullptr), __mode_(ios_base::in | ios_base::out) {}
+  _LIBCPP_HIDE_FROM_ABI basic_stringbuf() : __hm_(nullptr), __mode_(ios_base::in | ios_base::out) {
+    __init_buf_ptrs(); // this call is implementation defined.
----------------
ldionne wrote:

```suggestion
    __init_buf_ptrs(); // it is implementation-defined whether we initialize eback() & friends to nullptr, and libc++ doesn't
```

Maybe a bit clearer?

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


More information about the libcxx-commits mailing list