[libcxx-commits] [PATCH] D72465: [libcxx] [test] Portability fix of std::strstreambuf constructor test.

Andrey Maksimov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 9 10:23:52 PST 2020


amakc11 created this revision.
Herald added a reviewer: EricWF.
Herald added subscribers: libcxx-commits, ldionne, christof.
Herald added a project: libc++.

The standard does not require the constructor `strstreambuf(streamsize alsize_arg = 0)` leave the stream array unallocated when called with parameter `alsize_arg > 0`. Conformant implementations of this constructor may allocate minimal `alsize_arg` number of bytes forcing `str()` method to return non-null pointer.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72465

Files:
  libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp


Index: libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp
===================================================================
--- libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp
+++ libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp
@@ -26,7 +26,7 @@
     }
     {
         std::strstreambuf s(1024);
-        assert(s.str() == nullptr);
+        LIBCPP_ASSERT(s.str() == nullptr);
         assert(s.pcount() == 0);
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72465.237118.patch
Type: text/x-patch
Size: 572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200109/9e3b0421/attachment.bin>


More information about the libcxx-commits mailing list