From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 4B5323857B99; Thu, 7 Jul 2022 16:38:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B5323857B99 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-1561] libstdc++: Remove workaround in __gnu_cxx::char_traits::move [PR89074] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 9de8fbe1507d8c6e7c9657657a3c05337b8fde23 X-Git-Newrev: ad6135e261ced29972e5aa33404e45bcdd99440f Message-Id: <20220707163829.4B5323857B99@sourceware.org> Date: Thu, 7 Jul 2022 16:38:29 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2022 16:38:29 -0000 https://gcc.gnu.org/g:ad6135e261ced29972e5aa33404e45bcdd99440f commit r13-1561-gad6135e261ced29972e5aa33404e45bcdd99440f Author: Jonathan Wakely Date: Thu Jul 7 13:40:20 2022 +0100 libstdc++: Remove workaround in __gnu_cxx::char_traits::move [PR89074] The front-end bug that prevented this constexpr loop from working has been fixed since GCC 12.1 so we can remove the workaround. libstdc++-v3/ChangeLog: PR c++/89074 * include/bits/char_traits.h (__gnu_cxx::char_traits::move): Remove workaround for front-end bug. Diff: --- libstdc++-v3/include/bits/char_traits.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h index b856b1da320..965ff29b75c 100644 --- a/libstdc++-v3/include/bits/char_traits.h +++ b/libstdc++-v3/include/bits/char_traits.h @@ -215,14 +215,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (__s1 == __s2) // unlikely, but saves a lot of work return __s1; -#if __cpp_constexpr_dynamic_alloc - // The overlap detection below fails due to PR c++/89074, - // so use a temporary buffer instead. - char_type* __tmp = new char_type[__n]; - copy(__tmp, __s2, __n); - copy(__s1, __tmp, __n); - delete[] __tmp; -#else const auto __end = __s2 + __n - 1; bool __overlap = false; for (std::size_t __i = 0; __i < __n - 1; ++__i) @@ -244,7 +236,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } else copy(__s1, __s2, __n); -#endif return __s1; } #endif