From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 9CE26385843A; Wed, 5 Jan 2022 13:47:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9CE26385843A 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 r12-6260] libstdc++: Simplify std::allocator_traits>::construct X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: cebe875f6f44b905a0d56a2007b5a638a33a893c X-Git-Newrev: 917c7b136e8b556b0027223058006a6caeb56871 Message-Id: <20220105134748.9CE26385843A@sourceware.org> Date: Wed, 5 Jan 2022 13:47:48 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2022 13:47:48 -0000 https://gcc.gnu.org/g:917c7b136e8b556b0027223058006a6caeb56871 commit r12-6260-g917c7b136e8b556b0027223058006a6caeb56871 Author: Jonathan Wakely Date: Tue Jan 4 16:39:01 2022 +0000 libstdc++: Simplify std::allocator_traits>::construct We don't need a preprocessor condition to decide whether to use placement new or std::construct_at, because std::_Construct already does that. libstdc++-v3/ChangeLog: * include/bits/alloc_traits.h (allocator_traits>): Use std::_Construct for construct. Diff: --- libstdc++-v3/include/bits/alloc_traits.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h index f51049f4a51..fa93feb7198 100644 --- a/libstdc++-v3/include/bits/alloc_traits.h +++ b/libstdc++-v3/include/bits/alloc_traits.h @@ -632,13 +632,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static _GLIBCXX20_CONSTEXPR void construct(allocator_type&, _Up* __p, _Args&&... __args) noexcept(std::is_nothrow_constructible<_Up, _Args...>::value) - { -#if __cplusplus <= 201703L - ::new((void *)__p) _Up(std::forward<_Args>(__args)...); -#else - std::construct_at(__p, std::forward<_Args>(__args)...); -#endif - } + { std::_Construct(__p, std::forward<_Args>(__args)...); } /** * @brief Destroy an object of type `_Up`