From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15884 invoked by alias); 2 Apr 2017 05:35:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 15845 invoked by uid 89); 2 Apr 2017 05:35:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=HX-Greylist:Sun X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 02 Apr 2017 05:35:30 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3957083F3E; Sun, 2 Apr 2017 05:35:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3957083F3E Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3957083F3E Received: from tucnak.zalov.cz (ovpn-116-72.ams2.redhat.com [10.36.116.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B6EEE62922; Sun, 2 Apr 2017 05:35:17 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v325ZFv6011001; Sun, 2 Apr 2017 07:35:15 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v325ZEkD011000; Sun, 2 Apr 2017 07:35:14 +0200 Date: Sun, 02 Apr 2017 05:35:00 -0000 From: Jakub Jelinek To: Ville Voutilainen Cc: libstdc++ , "gcc-patches@gcc.gnu.org" Subject: Re: [v3 PATCH] Implement std::is_aggregate. Message-ID: <20170402053514.GZ17461@tucnak> Reply-To: Jakub Jelinek References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00035.txt.bz2 On Sun, Apr 02, 2017 at 01:18:58AM +0300, Ville Voutilainen wrote: > Tested on Linux-x64. > > 2017-04-02 Ville Voutilainen > > Implement std::is_aggregate. > * include/std/type_traits (is_aggregate): New. > * testsuite/20_util/is_aggregate/requirements/explicit_instantiation.cc: > New. > * testsuite/20_util/is_aggregate/requirements/typedefs.cc: Likewise. > * testsuite/20_util/is_aggregate/value.cc: Likewise. > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits > index 6707caa..89a3738 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -3062,6 +3062,25 @@ template > #endif > #undef _GLIBCXX_NO_BUILTIN_HAS_UNIQ_OBJ_REP > > +#ifdef __has_builtin > +# if !__has_builtin(__is_aggregate) > +// Try not to break non-GNU compilers that don't support the built-in: > +# define _GLIBCXX_NO_BUILTIN_IS_AGGREGATE 1 > +# endif > +#endif > + > +#ifndef _GLIBCXX_NO_BUILTIN_IS_AGGREGATE > +#define __cpp_lib_is_aggregate 201703 > + /// is_aggregate > + template > + struct is_aggregate > + : bool_constant<__is_aggregate( > + remove_cv_t<_Tp> > + )> Any reason for the wrapping? > + : bool_constant<__is_aggregate(remove_cv_t<_Tp>)> Would fit on one line. I admit I know next to nothing about libstdc++ code formatting. > + { }; Also, shouldn't there be also: /// is_aggregate_v template _GLIBCXX17_INLINE constexpr bool is_aggregate_v = is_aggregate<_Tp>::value; somewhere with appropriate guards (or within the same ones)? > +#endif > +#undef _GLIBCXX_NO_BUILTIN_IS_AGGREGATE > + > #endif // C++17 > > _GLIBCXX_END_NAMESPACE_VERSION I'm surprised tests for the is_*_v variable templates are only in experimental/type_traits/value.cc when they are now apparently part of C++17. Jakub