[libcxx-commits] [PATCH] D145981: [libc++] Assert that lengths fit in difference_type

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 16 09:48:22 PDT 2023


Mordante accepted this revision.
Mordante added a comment.
This revision is now accepted and ready to land.

LGTM, but can you reupload this revision to see that it passes the Windows CI, these errors look odd so I like to have a rerun. It seems the exception issue is unrelated.

Can you provide "your name" <your at e.mail> then we can commit on your behalf when the CI is happy.



================
Comment at: libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp:10-12
+// UNSUPPORTED: c++11, c++14
+
+// UNSUPPORTED: c++03
----------------
davidben wrote:
> davidben wrote:
> > Mordante wrote:
> > > Why is this not supported in these language versions? We have enabled `string_view` in older language versions.
> > I just copied that from `assert.ctor.pointer.pass.cpp`. :-) Removed.
> Looks like that didn't work because the assertion is only allowed in constexpr starting C++14. I'll make this match the other assert and disable the test in C++11.
Oke sounds good.


================
Comment at: libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp:15
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
+
+#include <string_view>
----------------
davidben wrote:
> Mordante wrote:
> > Please add the function's synopsis here, best look for other tests for examples.
> Something like this?
Yes thanks!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145981/new/

https://reviews.llvm.org/D145981



More information about the libcxx-commits mailing list