From b03c2df9c37c6bc72af1bdbe7646e638b166d4a0 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 10 Jul 2015 13:15:00 +0100 Subject: [PATCH] Disable __alignof usage by clang when it emulating GCC and GCC's behavior is buggy. --- include/boost/type_traits/intrinsics.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index eae359d..14a3ee8 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -218,7 +218,12 @@ # 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) # endif -# define BOOST_ALIGNMENT_OF(T) __alignof(T) +# if (!defined(unix) && !defined(__unix__)) || defined(__LP64__) || !defined(__GNUC__) +// GCC sometimes lies about alignment requirements +// of type double on 32-bit unix platforms, use the +// old implementation instead in that case: +# define BOOST_ALIGNMENT_OF(T) __alignof(T) +# endif # if __has_feature(is_final) # define BOOST_IS_FINAL(T) __is_final(T) # endif