summaryrefslogtreecommitdiff
path: root/include/type_traits
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-10-10 05:34:18 +0000
committerEric Fiselier <eric@efcs.ca>2016-10-10 05:34:18 +0000
commita244bb9d18007e51833759a26dc3a29e3616c952 (patch)
tree5241760b2525d563ed97caa879d9778d1cafd7af /include/type_traits
parent051593845dfa97a9787cdf9297e7f47cfeb6cde5 (diff)
Provide a constexpr addressof with GCC 7.
__builtin_addressof was added to the GCC trunk in the past week. This patch teaches libc++ about it so it can correctly provide constexpr addressof. Unfortunately this patch will break users of earlier GCC 7 builds, since we expect __builtin_addressof but one won't be provided. One option would be to only use __builtin_addressof for GCC 7.1 and above, but that means waiting for another release. Instead I've specifically chosen to break older GCC 7 versions. Since GCC 7 has yet to be released, and the 7.0 release is a development release, I believe that anybody currently using GCC 7.0 will have no issue upgrading. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283715 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/type_traits')
-rw-r--r--include/type_traits2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/type_traits b/include/type_traits
index c63dea481..735eab790 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -425,7 +425,7 @@ template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp
#endif
// addressof
-#if __has_builtin(__builtin_addressof)
+#if __has_builtin(__builtin_addressof) || _GNUC_VER >= 700
template <class _Tp>
inline _LIBCPP_CONSTEXPR_AFTER_CXX14