[libcxx-commits] [libcxx] [libc++][test] Fixes constexpr nasty_char_traits. (PR #90981)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 8 11:49:53 PDT 2024


================
@@ -98,23 +122,21 @@ constexpr_char_traits<CharT>::find(const char_type* s, std::size_t n, const char
 }
 
 template <class CharT>
-TEST_CONSTEXPR_CXX14 CharT*
-constexpr_char_traits<CharT>::move(char_type* s1, const char_type* s2, std::size_t n)
-{
-    char_type* r = s1;
-    if (s1 < s2)
-    {
-        for (; n; --n, ++s1, ++s2)
-            assign(*s1, *s2);
-    }
-    else if (s2 < s1)
-    {
-        s1 += n;
-        s2 += n;
-        for (; n; --n)
-            assign(*--s1, *--s2);
-    }
-    return r;
+TEST_CONSTEXPR_CXX14 CharT* constexpr_char_traits<CharT>::move(char_type* s1, const char_type* s2, std::size_t n) {
----------------
mordante wrote:

I like short titles, so I made the title more generic and updated the commit message.

https://github.com/llvm/llvm-project/pull/90981


More information about the libcxx-commits mailing list