From 946221e5502802176755b72eb2b60738363163a0 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 9 Nov 2015 13:41:33 +0000 Subject: [PATCH 1/4] Fix has_nothrow_copy on Intel-16 / Windows. --- include/boost/type_traits/has_nothrow_copy.hpp | 4 ++++ include/boost/type_traits/intrinsics.hpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/include/boost/type_traits/has_nothrow_copy.hpp b/include/boost/type_traits/has_nothrow_copy.hpp index 8b92e43..0d9bb18 100644 --- a/include/boost/type_traits/has_nothrow_copy.hpp +++ b/include/boost/type_traits/has_nothrow_copy.hpp @@ -25,6 +25,10 @@ #elif defined(BOOST_MSVC) || defined(BOOST_INTEL) #include #include +#ifdef BOOST_INTEL +#include +#include +#endif #endif namespace boost { diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index 14a3ee8..e87bba2 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -10,6 +10,8 @@ #ifndef BOOST_TT_DISABLE_INTRINSICS +#include + #ifndef BOOST_TT_CONFIG_HPP_INCLUDED #include #endif @@ -103,7 +105,11 @@ # define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) || ( ::boost::is_pod::value && ! ::boost::is_const::value && !::boost::is_volatile::value)) # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || ::boost::is_pod::value) # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) || ::boost::has_trivial_constructor::value) +#if !defined(BOOST_INTEL) # define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) || ::boost::has_trivial_copy::value) && !is_array::value) +#else if (_MSC_VER >= 1900) +# define BOOST_HAS_NOTHROW_COPY(T) ((__is_nothrow_constructible(T, typename add_lvalue_reference::type>::type)) && !is_array::value) +#endif # define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) || ::boost::has_trivial_assign::value) # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T) From 4154c0026500a5ebc026339b2a6f69120ba17bd7 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 9 Nov 2015 18:48:21 +0000 Subject: [PATCH 2/4] Fix has_trivial_copy on Intel 16. --- include/boost/type_traits/has_trivial_copy.hpp | 5 +++++ include/boost/type_traits/intrinsics.hpp | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/boost/type_traits/has_trivial_copy.hpp b/include/boost/type_traits/has_trivial_copy.hpp index 26819b9..9d3265d 100644 --- a/include/boost/type_traits/has_trivial_copy.hpp +++ b/include/boost/type_traits/has_trivial_copy.hpp @@ -20,6 +20,11 @@ #define BOOST_TT_TRIVIAL_CONSTRUCT_FIX #endif +#ifdef BOOST_INTEL +#include +#include +#endif + namespace boost { template struct has_trivial_copy diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index e87bba2..db1b322 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -101,14 +101,15 @@ # define BOOST_IS_POD(T) (__is_pod(T) && __has_trivial_constructor(T)) # define BOOST_IS_EMPTY(T) __is_empty(T) # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T) -# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) || ::boost::is_pod::value) # define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) || ( ::boost::is_pod::value && ! ::boost::is_const::value && !::boost::is_volatile::value)) # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || ::boost::is_pod::value) # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) || ::boost::has_trivial_constructor::value) #if !defined(BOOST_INTEL) # define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) || ::boost::has_trivial_copy::value) && !is_array::value) +# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) || ::boost::is_pod::value) #else if (_MSC_VER >= 1900) # define BOOST_HAS_NOTHROW_COPY(T) ((__is_nothrow_constructible(T, typename add_lvalue_reference::type>::type)) && !is_array::value) +# define BOOST_HAS_TRIVIAL_COPY(T) (__is_trivially_constructible(T, typename add_lvalue_reference::type>::type)) #endif # define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) || ::boost::has_trivial_assign::value) # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T) From 40fada5956df4d757a87ed4c856eed49642b0461 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 11 Nov 2015 13:17:02 +0300 Subject: [PATCH 3/4] Fix a preprocessor warning on Intel compiler Replaced incorrect "#else if" sequence with "#elif". This fixes "warning #14: extra text after expected end of preprocessing directive". --- include/boost/type_traits/intrinsics.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index db1b322..e2246be 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -107,7 +107,7 @@ #if !defined(BOOST_INTEL) # define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) || ::boost::has_trivial_copy::value) && !is_array::value) # define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) || ::boost::is_pod::value) -#else if (_MSC_VER >= 1900) +#elif (_MSC_VER >= 1900) # define BOOST_HAS_NOTHROW_COPY(T) ((__is_nothrow_constructible(T, typename add_lvalue_reference::type>::type)) && !is_array::value) # define BOOST_HAS_TRIVIAL_COPY(T) (__is_trivially_constructible(T, typename add_lvalue_reference::type>::type)) #endif From f176e0a26d050dced1385a6c6de934d16553f6da Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 6 Dec 2015 11:58:11 +0000 Subject: [PATCH 4/4] Apply patch https://svn.boost.org/trac/boost/ticket/11831 for clang. --- include/boost/type_traits/type_with_alignment.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/type_traits/type_with_alignment.hpp b/include/boost/type_traits/type_with_alignment.hpp index bfd5476..ffa054a 100644 --- a/include/boost/type_traits/type_with_alignment.hpp +++ b/include/boost/type_traits/type_with_alignment.hpp @@ -84,7 +84,7 @@ struct type_with_alignment typedef typename boost::detail::char_alignment::value >= Align>::type type; }; -#if (defined(__GNUC__) || (defined (__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130))) && !defined(BOOST_TT_DISABLE_INTRINSICS) +#if (defined(__GNUC__) || (defined (__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)) || defined(__clang__)) && !defined(BOOST_TT_DISABLE_INTRINSICS) namespace tt_align_ns { struct __attribute__((__aligned__(2))) a2 {}; struct __attribute__((__aligned__(4))) a4 {};