From patchwork Thu Jul 27 07:27:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Katsuhiko Nishimra X-Patchwork-Id: 794237 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-459099-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="gdY915LY"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xJ3Tc6nffz9s7M for ; Thu, 27 Jul 2017 17:27:31 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=BQPSBWXeI+n57fcWy+zLMFYJeZJZ84oH2BtdWP/X7Fyojf/X8N xrYJVAbjKyhSKRpJyQkmXj5zy+T7F/V73F1KeVcbrHlYqpYPwoXxywPpZ9P3t9c0 8/H5KUHm68Mv7siS6tqryPwRLiSTO7OyCrwdSiZN6IT1YB7QZK/AEzQFg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=2o/vvJz4jLJeurVGoDJlliIyjY0=; b=gdY915LYRu7a/6p5uMjC otEVQ5Pvj/wbcx+K3UXdhTVC24acHN6cybwKHxtIivYqp+NlJOsyq8Ub5e1C/qY2 JkBHge7Ws6hVJubTi9vq7mkw0k1QvsyyYeh3qW5iFfP74wKyaLlE94L+GWCGh8Ts yoOjzOFg02HaNyjpS0MVjr8= Received: (qmail 46292 invoked by alias); 27 Jul 2017 07:27:24 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 46267 invoked by uid 89); 27 Jul 2017 07:27:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:Thu, H*r:sk:37.2017, H*M:info, H*MI:info X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-pg0-f54.google.com Received: from mail-pg0-f54.google.com (HELO mail-pg0-f54.google.com) (74.125.83.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Jul 2017 07:27:21 +0000 Received: by mail-pg0-f54.google.com with SMTP id 125so94522529pgi.3; Thu, 27 Jul 2017 00:27:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=+zFc4XEIidTSk84GByGN2eNnz0ofx1XlALpZNuDNIy0=; b=JVlDASJyb24D4LPZxodLhf8Aoe+B5gsPBiMxG7uKupKfuSIs5ksNd6Z64mW8mkdVx6 X6a17QnldNoPKNeknGyVz+1zTm0h8gPMzw4tE2ASXDoJQmdpDIZ9r20pQGATT8Vvv9md ktTe4zZ6CgSTIXLYp0aKszdCmSFIgUmcGEJh1P40BpTpVn4GlIxfJ5/ln1Hxl46M2rSe mH/goFHxWXFWdNXgYuWvgd3pXjnz4DMwSVc9zneiUGmWjsDd7uCXtuvjnJ+Ylr7pKD52 H31xxh4WnzDE+Tk5eMgucaMZWkHiuLfWbdSnTItAScTgbNtqTol+NBprZHcJIYM9Ag03 u8LQ== X-Gm-Message-State: AIVw113+Yrz7f8ARsES2o6hMdtBUz14aY12hePIOfhYK2ZNgt0KhbgHz UC+vEL8I6VQYe7KpV48= X-Received: by 10.99.56.5 with SMTP id f5mr3279720pga.14.1501140439287; Thu, 27 Jul 2017 00:27:19 -0700 (PDT) Received: from netzach ([240b:10:9080:2700:ea2a:eaff:fe09:7306]) by smtp.gmail.com with ESMTPSA id a125sm28617066pgc.37.2017.07.27.00.27.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Jul 2017 00:27:18 -0700 (PDT) Received: from ktns by netzach with local (Exim 4.89) (envelope-from ) id 1dadCV-0006tE-5d; Thu, 27 Jul 2017 16:27:15 +0900 Date: Thu, 27 Jul 2017 16:27:15 +0900 From: Katsuhiko Nishimra To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Cc: cfe-dev@lists.llvm.org Subject: [PATCH] libstdc++: Support std::is_aggregate on clang++ (was [cfe-dev] clang++: std::is_aggregate unusable with clang-5.0/libstdc++-7) Message-ID: <20170727072715.43fqiep4nawwvzlc@netzach.ktns.kdns.info> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170609 (1.8.3) 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)