From 243a6be085fe6a7ce49169864c68a8839735e49b Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 23 Oct 2019 17:52:30 +0000 Subject: Vendor import of stripped libc++ trunk r375505, the last commit before the upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/libcxx/trunk@375505 --- include/__string | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/__string') diff --git a/include/__string b/include/__string index a88b976be3c9..b4c8815f72d2 100644 --- a/include/__string +++ b/include/__string @@ -351,6 +351,18 @@ char_traits::compare(const char_type* __s1, const char_type* __s2, size #endif } + +template +_LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR +inline size_t __char_traits_length_checked(const typename _Traits::char_type* __s) _NOEXCEPT { +#if _LIBCPP_DEBUG_LEVEL >= 1 + return __s ? _Traits::length(__s) : (_VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, "p == nullptr", "null pointer pass to non-null argument of char_traits<...>::length")), 0); +#else + return _Traits::length(__s); +#endif +} + inline _LIBCPP_CONSTEXPR_AFTER_CXX14 size_t char_traits::length(const char_type* __s) _NOEXCEPT -- cgit v1.2.3