From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54086 invoked by alias); 31 Jul 2017 14:53:50 -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 54036 invoked by uid 89); 31 Jul 2017 14:53:46 -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=unstable, Hx-languages-length:1569, unusable 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; Mon, 31 Jul 2017 14:53:45 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 87ED7108D2A; Mon, 31 Jul 2017 14:53:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 87ED7108D2A Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jwakely@redhat.com Received: from localhost (unknown [10.33.36.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id C59CC60C2D; Mon, 31 Jul 2017 14:53:43 +0000 (UTC) Date: Mon, 31 Jul 2017 14:53:00 -0000 From: Jonathan Wakely To: Katsuhiko Nishimra Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org, cfe-dev@lists.llvm.org Subject: Re: [PATCH] libstdc++: Support std::is_aggregate on clang++ (was [cfe-dev] clang++: std::is_aggregate unusable with clang-5.0/libstdc++-7) Message-ID: <20170731145342.GW15340@redhat.com> References: <20170727072715.43fqiep4nawwvzlc@netzach.ktns.kdns.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20170727072715.43fqiep4nawwvzlc@netzach.ktns.kdns.info> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.8.0 (2017-02-23) X-SW-Source: 2017-07/txt/msg02032.txt.bz2 On 27/07/17 16:27 +0900, Katsuhiko Nishimra wrote: >From 56c4a18d0d8c8ce7aa1239880138775e4db06645 Mon Sep 17 00:00:00 2001 >From: Katsuhiko Nishimra >Date: Thu, 27 Jul 2017 16:03:54 +0900 >Subject: [PATCH] libstdc++: Support std::is_aggregate on clang++ > >Currently, libstdc++ tries to detect __is_aggregate built-in macro using >__has_builtin, but this fails on clang++ because __has_builtin on >clang++ detects only built-in functions, not built-in macros. This patch >adds a test using __is_identifier. Tested on clang++ >5.0.0-svn308422-1~exp1 and g++ 7.1.0-10 from Debian unstable. >--- > libstdc++-v3/include/std/type_traits | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits >index 390b6f40a..e7ec402fb 100644 >--- a/libstdc++-v3/include/std/type_traits >+++ b/libstdc++-v3/include/std/type_traits >@@ -2894,6 +2894,11 @@ template > > #if __GNUC__ >= 7 > # define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1 >+#elif defined(__is_identifier) >+// For clang >+# if ! __is_identifier(__is_aggregate) >+# define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1 >+# endif > #elif defined __has_builtin > // For non-GNU compilers: > # if __has_builtin(__is_aggregate) This __has_bultin check only exists for Clang, so should be replaced by the correct __is_identifier check, not left there in addition to it.