Skip to content

Commit 782a91e

Browse files
authored
[libc++][C++03] Cherry-pick #100879 (#163370)
1 parent 6fc2318 commit 782a91e

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

libcxx/include/__cxx03/sstream

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,15 @@ private:
354354

355355
public:
356356
// [stringbuf.cons] constructors:
357-
_LIBCPP_HIDE_FROM_ABI basic_stringbuf() : __hm_(nullptr), __mode_(ios_base::in | ios_base::out) {}
357+
_LIBCPP_HIDE_FROM_ABI basic_stringbuf() : __hm_(nullptr), __mode_(ios_base::in | ios_base::out) {
358+
// it is implementation-defined whether we initialize eback() & friends to nullptr, and libc++ doesn't
359+
__init_buf_ptrs();
360+
}
358361

359-
_LIBCPP_HIDE_FROM_ABI explicit basic_stringbuf(ios_base::openmode __wch) : __hm_(nullptr), __mode_(__wch) {}
362+
_LIBCPP_HIDE_FROM_ABI explicit basic_stringbuf(ios_base::openmode __wch) : __hm_(nullptr), __mode_(__wch) {
363+
// it is implementation-defined whether we initialize eback() & friends to nullptr, and libc++ doesn't
364+
__init_buf_ptrs();
365+
}
360366

361367
_LIBCPP_HIDE_FROM_ABI explicit basic_stringbuf(const string_type& __s,
362368
ios_base::openmode __wch = ios_base::in | ios_base::out)

libcxx/test/libcxx-03/input.output/string.streams/stringbuf/const_sso_buffer.pass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
// <sstream>
1010

11-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
12-
1311
// How the constructors of basic_stringbuf initialize the buffer pointers is
1412
// not specified. For some constructors it's implementation defined whether the
1513
// pointers are set to nullptr. Libc++'s implementation directly uses the SSO

libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
// basic_stringbuf() : basic_stringbuf(ios_base::in | ios_base::out) {} // C++20
1616
// explicit basic_stringbuf(ios_base::openmode which); // C++20
1717

18-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
19-
2018
#include <sstream>
2119
#include <cassert>
2220

0 commit comments

Comments
 (0)