This fails due to small_vector's move constructor noexcept specification being boost::container::dtl::is_nothrow_move_assignable<value_type>::value which defers to BOOST_MOVE_IS_NOTHROW_MOVE_ASSIGNABLE(T).
It appears that a recent update in 9a77e69b only added definitions of BOOST_MOVE_HAS_NOTHROW_MOVE_{ASSIGN,CONSTRUCT} for MSVC++, but not for other compilers including clang, which causes them to use a simplified and imprecise emulation based on triviality.
After adding
# define BOOST_MOVE_HAS_NOTHROW_MOVE_ASSIGN(T) (__is_assignable(T, T &&) && __is_nothrow_assignable(T, T &&))
after BOOST_MOVE_HAS_NOTHROW_ASSIGN and
# define BOOST_MOVE_HAS_NOTHROW_MOVE_CONSTRUCT(T) (__is_constructible(T, T &&) && __is_nothrow_constructible(T, T &&))
after BOOST_MOVE_HAS_NOTHROW_COPY it still doesn't work.
Turns out, the way BOOST_MOVE_HAS_TRAIT is defined for Clang is wrong. As stated in https://clang.llvm.org/docs/LanguageExtensions.html#type-trait-primitives__has_feature (which is what __has_extension essentially is) only detects a listed subset of traits, not including is_assignable and others which Boost.Move tests. A universal test exists for Clang 6+ via !__is_identifier(__trait), but since __is_identifier itself appeared earlier and AppleClang presumably has a different versioning scheme, I opted to replace
The following fails to compile with boost 1.75, and recent clang+libc++ in C++17+:
This fails due to
small_vector
's move constructor noexcept specification beingboost::container::dtl::is_nothrow_move_assignable<value_type>::value
which defers toBOOST_MOVE_IS_NOTHROW_MOVE_ASSIGNABLE(T)
.It appears that a recent update in 9a77e69b only added definitions of
BOOST_MOVE_HAS_NOTHROW_MOVE_{ASSIGN,CONSTRUCT}
for MSVC++, but not for other compilers including clang, which causes them to use a simplified and imprecise emulation based on triviality.After adding
after
BOOST_MOVE_HAS_NOTHROW_ASSIGN
andafter
BOOST_MOVE_HAS_NOTHROW_COPY
it still doesn't work.Turns out, the way
BOOST_MOVE_HAS_TRAIT
is defined for Clang is wrong. As stated in https://clang.llvm.org/docs/LanguageExtensions.html#type-trait-primitives__has_feature
(which is what__has_extension
essentially is) only detects a listed subset of traits, not includingis_assignable
and others which Boost.Move tests. A universal test exists for Clang 6+ via!__is_identifier(__trait)
, but since__is_identifier
itself appeared earlier and AppleClang presumably has a different versioning scheme, I opted to replacewith
and this finally fixed this for me.
This fixes it only for clang, other compilers would need something similar too.