From 2d763763ed94ae4ebf3f16e578531a0173a99ce8 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 9 Aug 2017 22:38:05 +0100 Subject: [PATCH] Fix test for __has_unique_object_representations support in Clang * include/std/type_traits (_GLIBCXX_NO_BUILTIN_HAS_UNIQ_OBJ_REP): Replace with _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP and use __is_identifier to set it. From-SVN: r251009 --- libstdc++-v3/ChangeLog | 6 ++++++ libstdc++-v3/include/std/type_traits | 14 ++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index db0d38e78cb..8ebe21c9c11 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2017-08-09 Jonathan Wakely + + * include/std/type_traits (_GLIBCXX_NO_BUILTIN_HAS_UNIQ_OBJ_REP): + Replace with _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP and use + __is_identifier to set it. + 2017-08-09 Katsuhiko Nishimra * include/std/type_traits (_GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE): Use diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index ee9c75bafbd..f021c42396c 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2873,14 +2873,16 @@ template template inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value; -#ifdef __has_builtin -# if !__has_builtin(__has_unique_object_representations) -// Try not to break non-GNU compilers that don't support the built-in: -# define _GLIBCXX_NO_BUILTIN_HAS_UNIQ_OBJ_REP 1 +#if __GNUC__ >= 7 +# define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1 +#elif defined(__is_identifier) +// For non-GNU compilers: +# if ! __is_identifier(__has_unique_object_representations) +# define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1 # endif #endif -#ifndef _GLIBCXX_NO_BUILTIN_HAS_UNIQ_OBJ_REP +#ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP # define __cpp_lib_has_unique_object_representations 201606 /// has_unique_object_representations template @@ -2890,7 +2892,7 @@ template )> { }; #endif -#undef _GLIBCXX_NO_BUILTIN_HAS_UNIQ_OBJ_REP +#undef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP #if __GNUC__ >= 7 # define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1 -- 2.30.2