This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] PR libstdc++/80446 cope with libc defining __has_builtin
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 19 Apr 2017 16:18:24 +0100
- Subject: Re: [PATCH] PR libstdc++/80446 cope with libc defining __has_builtin
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jwakely at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 076B92CAF04
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 076B92CAF04
- References: <20170419104907.GA9769@redhat.com>
On 19/04/17 11:49 +0100, Jonathan Wakely wrote:
Both newlib and FreeBSD have this in libc headers:
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
This means our attempts to use #ifdef __has_builtin aren't reliable,
so we need a different approach. With this patch we don't care whether
it's defined or not, only its value.
PR libstdc++/80446
* include/std/type_traits (is_aggregate): Change __has_builtin checks.
* libsupc++/new (launder): Likewise.
Tested ppc64le-linux and x86_64-freebsd11.0, committed to trunk.
Jakub pointed out I forgot to update the macro name in a comment.
Smoke-tested and committed to trunk.
commit be2fd5feb898fefac9f97ffca6691b232d18fa5b
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Wed Apr 19 16:11:34 2017 +0100
* libsupc++/new: Update comment on #endif directive.
diff --git a/libstdc++-v3/libsupc++/new b/libstdc++-v3/libsupc++/new
index 2de7752..04f172c 100644
--- a/libstdc++-v3/libsupc++/new
+++ b/libstdc++-v3/libsupc++/new
@@ -209,7 +209,7 @@ namespace std
void launder(volatile void*) = delete;
void launder(const volatile void*) = delete;
}
-#endif // _GLIBCXX_NO_BUILTIN_LAUNDER
+#endif // _GLIBCXX_HAVE_BUILTIN_LAUNDER
#undef _GLIBCXX_HAVE_BUILTIN_LAUNDER
#endif // C++17