From 087471a23219e2ed9e7ffd840934d0b407b98cee Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 23 Aug 2017 09:16:35 +0300 Subject: [PATCH 1/2] Bump msvc version checks from <= 1910 to < 1920 --- test/atomic_sp_constexpr_test.cpp | 2 +- test/sp_constexpr_test.cpp | 2 +- test/sp_constexpr_test2.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/atomic_sp_constexpr_test.cpp b/test/atomic_sp_constexpr_test.cpp index d81822d..f6e7248 100644 --- a/test/atomic_sp_constexpr_test.cpp +++ b/test/atomic_sp_constexpr_test.cpp @@ -17,7 +17,7 @@ # undef HAVE_CONSTEXPR_INIT #endif -#if BOOST_WORKAROUND( BOOST_MSVC, <= 1910 ) +#if BOOST_WORKAROUND( BOOST_MSVC, < 1920 ) # undef HAVE_CONSTEXPR_INIT #endif diff --git a/test/sp_constexpr_test.cpp b/test/sp_constexpr_test.cpp index 7238e26..38c96f4 100644 --- a/test/sp_constexpr_test.cpp +++ b/test/sp_constexpr_test.cpp @@ -17,7 +17,7 @@ # undef HAVE_CONSTEXPR_INIT #endif -#if BOOST_WORKAROUND( BOOST_MSVC, <= 1910 ) +#if BOOST_WORKAROUND( BOOST_MSVC, < 1920 ) # undef HAVE_CONSTEXPR_INIT #endif diff --git a/test/sp_constexpr_test2.cpp b/test/sp_constexpr_test2.cpp index e508fa1..dd6e4ac 100644 --- a/test/sp_constexpr_test2.cpp +++ b/test/sp_constexpr_test2.cpp @@ -17,7 +17,7 @@ # undef HAVE_CONSTEXPR_INIT #endif -#if BOOST_WORKAROUND( BOOST_MSVC, <= 1910 ) +#if BOOST_WORKAROUND( BOOST_MSVC, < 1920 ) # undef HAVE_CONSTEXPR_INIT #endif From 966786e7f90d20f029d0f330a658d23c4f39d6d9 Mon Sep 17 00:00:00 2001 From: Benjamin Worpitz Date: Mon, 28 Aug 2017 08:12:48 +0200 Subject: [PATCH 2/2] fix compilation for nvcc+clang nvcc seems to use the host compiler for preprocessing the source for the device and host compilation. When compiling the host code with the host compiler (clang), `__builtin_assume` is detected correctly and is also available during compilation. When compiling the device code with nvcc, this builtin function is not available. --- include/boost/smart_ptr/detail/local_counted_base.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/boost/smart_ptr/detail/local_counted_base.hpp b/include/boost/smart_ptr/detail/local_counted_base.hpp index 398b46d..fdfe2c6 100644 --- a/include/boost/smart_ptr/detail/local_counted_base.hpp +++ b/include/boost/smart_ptr/detail/local_counted_base.hpp @@ -60,12 +60,14 @@ public: void add_ref() BOOST_SP_NOEXCEPT { +#if !defined(__NVCC__) #if defined( __has_builtin ) # if __has_builtin( __builtin_assume ) __builtin_assume( local_use_count_ >= 1 ); # endif +#endif #endif local_use_count_ = static_cast( local_use_count_ + 1 );