[libcxx-commits] [PATCH] D121407: Allow temporary string_view((const char*)nullptr) while cleanup occurs.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 11 05:55:47 PST 2022


ldionne added a comment.

I'll go ahead and land D121231 <https://reviews.llvm.org/D121231>, and we can land this patch on top if it makes your life easier in terms of upstream/downstream maintenance.



================
Comment at: libcxx/include/string_view:320
     basic_string_view(const _CharT* __s)
-        : __data(__s), __size(_VSTD::__char_traits_length_checked<_Traits>(__s)) {}
+        : __data(__s), __size(_LIBCPP_CHAR_TRAITS_LENGTH_HOOK(_Traits, __s)) {}
 
----------------
With this patch, we are not asserting that `__s != nullptr`. I'd be OK with the patch if that were addressed. TBH I'm mostly neutral on how we solve this problem, as long as we get rid of the naked call to `__libcpp_debug_function` and we retain the `_LIBCPP_ASSERT(__s != nullptr)` upstream.


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

https://reviews.llvm.org/D121407



More information about the libcxx-commits mailing list