From: Katsuhiko Nishimra <ktns.87@gmail.com>
To: Jonathan Wakely <jwakely@redhat.com>
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)
Date: Tue, 01 Aug 2017 15:06:00 -0000 [thread overview]
Message-ID: <20170801150551.lvxoru7kq46mueqt@netzach.ktns.kdns.info> (raw)
In-Reply-To: <20170731145342.GW15340@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 339 bytes --]
On Mon, Jul 31, 2017 at 03:53:42PM +0100, Jonathan Wakely wrote:
> 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.
I see. Actually I've guessed so, and thank you for clarifying it.
I'm attaching a replacing patch. Please take a look at it.
[-- Attachment #1.2: 0001-libstdc-Support-std-is_aggregate-on-clang.patch --]
[-- Type: text/x-diff, Size: 1260 bytes --]
From 1b22cc531027832cf1eb50b73354f1730edbba54 Mon Sep 17 00:00:00 2001
From: Katsuhiko Nishimra <ktns.87@gmail.com>
Date: Tue, 1 Aug 2017 20:36:58 +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 with clang++
6.0.0-svn309616-1~exp1 and g++ 7.1.0-11 on Debian unstable.
---
libstdc++-v3/include/std/type_traits | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 390b6f40a..ee9c75baf 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -2894,9 +2894,9 @@ template <typename _From, typename _To>
#if __GNUC__ >= 7
# define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
-#elif defined __has_builtin
+#elif defined(__is_identifier)
// For non-GNU compilers:
-# if __has_builtin(__is_aggregate)
+# if ! __is_identifier(__is_aggregate)
# define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
# endif
#endif
--
2.13.3
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-08-01 15:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-27 7:27 Katsuhiko Nishimra
2017-07-31 14:53 ` Jonathan Wakely
2017-07-31 15:14 ` Tim Song
2017-07-31 17:23 ` Tim Song
2017-08-01 15:06 ` Katsuhiko Nishimra [this message]
2017-08-09 23:17 ` Jonathan Wakely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170801150551.lvxoru7kq46mueqt@netzach.ktns.kdns.info \
--to=ktns.87@gmail.com \
--cc=cfe-dev@lists.llvm.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=jwakely@redhat.com \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).