From 8898c6d1bbf0f0c265c0b12d06035b0346088602 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 17 May 2018 18:26:31 +0100 Subject: [PATCH] clang intrinsics: Use __is_trivially_constructible and __is_trivially_assignable to test for trivial move construct and assign. See https://github.com/boostorg/type_traits/issues/73. --- include/boost/type_traits/intrinsics.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index f8c5639..41cd16b 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -222,11 +222,11 @@ # if __has_feature(is_polymorphic) # define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T) # endif -# if __has_feature(has_trivial_move_constructor) -# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__has_trivial_move_constructor(T) && is_constructible::value && !::boost::is_volatile::value) +# if __has_extension(is_trivially_constructible) +# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__is_trivially_constructible(T, T&&) && is_constructible::value && !::boost::is_volatile::value) # endif -# if __has_feature(has_trivial_move_assign) -# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__has_trivial_move_assign(T) && is_assignable::value && !::boost::is_volatile::value) +# if __has_extension(is_trivially_assignable) +# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__is_trivially_assignable(T&, T&&) && is_assignable::value && !::boost::is_volatile::value) # endif # if (!defined(unix) && !defined(__unix__)) || defined(__LP64__) || !defined(__GNUC__) // GCC sometimes lies about alignment requirements