This revision was automatically updated to reflect the committed changes. Closed by commit rL320604: [libcxx] Fix basic_stringbuf constructor (authored by lichray, committed by ).
Changed prior to commit: https://reviews.llvm.org/D40707?vs=126739&id=126779#toc Repository: rL LLVM https://reviews.llvm.org/D40707 Files: libcxx/trunk/include/sstream libcxx/trunk/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp Index: libcxx/trunk/include/sstream =================================================================== --- libcxx/trunk/include/sstream +++ libcxx/trunk/include/sstream @@ -243,7 +243,6 @@ : __hm_(0), __mode_(__wch) { - str(string_type()); } template <class _CharT, class _Traits, class _Allocator> Index: libcxx/trunk/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp =================================================================== --- libcxx/trunk/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp +++ libcxx/trunk/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 @@ std::wstringbuf buf; assert(buf.str() == L""); } + { + testbuf<char> buf; + buf.check(); + } + { + testbuf<wchar_t> buf; + buf.check(); + } }
Index: libcxx/trunk/include/sstream =================================================================== --- libcxx/trunk/include/sstream +++ libcxx/trunk/include/sstream @@ -243,7 +243,6 @@ : __hm_(0), __mode_(__wch) { - str(string_type()); } template <class _CharT, class _Traits, class _Allocator> Index: libcxx/trunk/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp =================================================================== --- libcxx/trunk/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp +++ libcxx/trunk/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 @@ std::wstringbuf buf; assert(buf.str() == L""); } + { + testbuf<char> buf; + buf.check(); + } + { + testbuf<wchar_t> buf; + buf.check(); + } }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits