From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1888) id B54ED3858D1E; Fri, 2 Sep 2022 19:17:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B54ED3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662146244; bh=2/D2kIAtlEKwwUgjCX4BJAtQLtj3vOJG1EM7qkzEWIE=; h=From:To:Subject:Date:From; b=w1jExBv0fxrB0uYIGWV2rDan75Xs3PtFao1rBvEFj0DtflVfha1OYtBSgvpU/NeR+ PfRGGUCCVXTDh9/EDoPJ9pMx7YqRoCY3C+jc5+1GVUXZ1Et8/bI8io27RUGvsDkKiZ JmamGcLHzmA8qI/2ohXOVPxyYHPwDJPAPaSiQLSQ= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Patrick Palka To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-2383] libstdc++: Consistently use ::type when deriving from __and/or/not_ X-Act-Checkin: gcc X-Git-Author: Patrick Palka X-Git-Refname: refs/heads/master X-Git-Oldrev: b6aa7d45b502c01f8703c8d2cee2690f9aa8e282 X-Git-Newrev: 68c23af0dd7403c95c43310edc15669d4dacb005 Message-Id: <20220902191724.B54ED3858D1E@sourceware.org> Date: Fri, 2 Sep 2022 19:17:24 +0000 (GMT) List-Id: https://gcc.gnu.org/g:68c23af0dd7403c95c43310edc15669d4dacb005 commit r13-2383-g68c23af0dd7403c95c43310edc15669d4dacb005 Author: Patrick Palka Date: Fri Sep 2 15:16:37 2022 -0400 libstdc++: Consistently use ::type when deriving from __and/or/not_ Now that these internal type traits are (again) class templates, it's better to derive from the trait's ::type instead of from the trait itself, for sake of a shallower inheritance chain. libstdc++-v3/ChangeLog: * include/std/tuple (tuple::_UseOtherCtor): Use ::type when deriving from __and_, __or_ or __not_. * include/std/type_traits (negation): Likewise. (is_unsigned): Likewise. (__is_implicitly_default_constructible): Likewise. (is_trivially_destructible): Likewise. (__is_nt_invocable_impl): Likewise. Diff: --- libstdc++-v3/include/std/tuple | 2 +- libstdc++-v3/include/std/type_traits | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index ddd7c226d80..26e248431ec 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -826,7 +826,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // then TUPLE should match tuple(UTypes&&...) instead. template struct _UseOtherCtor<_Tuple, tuple<_Tp>, tuple<_Up>> - : __or_, is_constructible<_Tp, _Tuple>> + : __or_, is_constructible<_Tp, _Tuple>>::type { }; // If TUPLE and *this each have a single element of the same type, // then TUPLE should match a copy/move constructor instead. diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 2f5fe80b98a..c7a96079ebf 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -235,7 +235,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct negation - : __not_<_Pp> + : __not_<_Pp>::type { }; /** @ingroup variable_templates @@ -845,7 +845,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_unsigned template struct is_unsigned - : public __and_, __not_>> + : public __and_, __not_>>::type { }; /// @cond undocumented @@ -1222,7 +1222,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __is_implicitly_default_constructible : public __and_<__is_constructible_impl<_Tp>, - __is_implicitly_default_constructible_safe<_Tp>> + __is_implicitly_default_constructible_safe<_Tp>>::type { }; /// is_trivially_copy_constructible @@ -1282,7 +1282,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct is_trivially_destructible : public __and_<__is_destructible_safe<_Tp>, - __bool_constant<__has_trivial_destructor(_Tp)>> + __bool_constant<__has_trivial_destructor(_Tp)>>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -2975,7 +2975,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_nt_invocable_impl<_Result, _Ret, __void_t> : __or_, - __is_nothrow_convertible> + __is_nothrow_convertible>::type { }; /// @endcond