diff options
| -rw-r--r-- | libcxx/include/sstream | 1 | ||||
| -rw-r--r-- | libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp | 23 |
2 files changed, 23 insertions, 1 deletions
diff --git a/libcxx/include/sstream b/libcxx/include/sstream index 31cb37a1e27..34b0014c14a 100644 --- a/libcxx/include/sstream +++ b/libcxx/include/sstream @@ -243,7 +243,6 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode : __hm_(0), __mode_(__wch) { - str(string_type()); } template <class _CharT, class _Traits, class _Allocator> diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp index 28007c8edf4..af2cccc9637 100644 --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp @@ -17,6 +17,21 @@ #include <sstream> #include <cassert> +template<typename CharT> +struct testbuf + : std::basic_stringbuf<CharT> +{ + void check() + { + assert(this->eback() == NULL); + assert(this->gptr() == NULL); + assert(this->egptr() == NULL); + assert(this->pbase() == NULL); + assert(this->pptr() == NULL); + assert(this->epptr() == NULL); + } +}; + int main() { { @@ -27,4 +42,12 @@ int main() std::wstringbuf buf; assert(buf.str() == L""); } + { + testbuf<char> buf; + buf.check(); + } + { + testbuf<wchar_t> buf; + buf.check(); + } } |

