From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id C491D3858400; Mon, 5 Sep 2022 15:44:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C491D3858400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662392649; bh=wtpCfgmThZRqtYF8/zIeUmO9IF/p0zZ9lSX14aGDMcM=; h=From:To:Subject:Date:From; b=C46nWY4WSnxtpYuc0Fcr5scLU6tLON7aTE9PAVx/sLQhjvNxVc0gzp5NE2FSptx7A fLPH/8FWIN+Kzr71LiJpI2iRMgbL9e7mQyHTCXGmUuMTlb1fh6+nfafBmv0AIC1tdH TNDh7qDOorCdh3tb9pfdg58ns67qGqhYwe6ZWDQI= 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-2443] libstdc++: Use built-ins for more variable templates X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 0a9c0d4ae5519c404682425da9522c46c38712fd X-Git-Newrev: 7b3587b3c25d1ff806b43357132af352ea734f9c Message-Id: <20220905154409.C491D3858400@sourceware.org> Date: Mon, 5 Sep 2022 15:44:09 +0000 (GMT) List-Id: https://gcc.gnu.org/g:7b3587b3c25d1ff806b43357132af352ea734f9c commit r13-2443-g7b3587b3c25d1ff806b43357132af352ea734f9c Author: Jonathan Wakely Date: Thu Sep 1 21:12:40 2022 +0100 libstdc++: Use built-ins for more variable templates libstdc++-v3/ChangeLog: * include/std/type_traits (is_trivial_v, is_trivially_copyable_v) (is_standard_layout_v, is_pod_v, is_literal_type_v): Use built-in instead of class template. (is_same_v): Add partial specialization for true case. Diff: --- libstdc++-v3/include/std/type_traits | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index c7a96079ebf..e19d964fa9c 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -3077,22 +3077,19 @@ template inline constexpr bool is_volatile_v = false; template inline constexpr bool is_volatile_v = true; + template - inline constexpr bool is_trivial_v = is_trivial<_Tp>::value; + inline constexpr bool is_trivial_v = __is_trivial(_Tp); template - inline constexpr bool is_trivially_copyable_v = - is_trivially_copyable<_Tp>::value; + inline constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Tp); template - inline constexpr bool is_standard_layout_v = is_standard_layout<_Tp>::value; -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + inline constexpr bool is_standard_layout_v = __is_standard_layout(_Tp); template _GLIBCXX20_DEPRECATED("use is_standard_layout_v && is_trivial_v instead") - inline constexpr bool is_pod_v = is_pod<_Tp>::value; + inline constexpr bool is_pod_v = __is_pod(_Tp); template _GLIBCXX17_DEPRECATED - inline constexpr bool is_literal_type_v = is_literal_type<_Tp>::value; -#pragma GCC diagnostic pop + inline constexpr bool is_literal_type_v = __is_literal_type(_Tp); template inline constexpr bool is_empty_v = __is_empty(_Tp); template @@ -3101,6 +3098,7 @@ template inline constexpr bool is_abstract_v = __is_abstract(_Tp); template inline constexpr bool is_final_v = __is_final(_Tp); + template inline constexpr bool is_signed_v = is_signed<_Tp>::value; template @@ -3183,9 +3181,11 @@ template template inline constexpr bool is_nothrow_destructible_v = is_nothrow_destructible<_Tp>::value; + template - inline constexpr bool has_virtual_destructor_v = - has_virtual_destructor<_Tp>::value; + inline constexpr bool has_virtual_destructor_v + = __has_virtual_destructor(_Tp); + template inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value; @@ -3212,7 +3212,9 @@ template inline constexpr bool is_same_v = __is_same(_Tp, _Up); #else template - inline constexpr bool is_same_v = std::is_same<_Tp, _Up>::value; + inline constexpr bool is_same_v = false; +template + inline constexpr bool is_same_v<_Tp, _Tp> = true; #endif template inline constexpr bool is_base_of_v = __is_base_of(_Base, _Derived);