diff --git a/include/boost/type_traits/is_complete.hpp b/include/boost/type_traits/is_complete.hpp index 55dbbbf..af9a1ef 100644 --- a/include/boost/type_traits/is_complete.hpp +++ b/include/boost/type_traits/is_complete.hpp @@ -27,6 +27,12 @@ namespace boost { + +// +// We will undef this if the trait isn't fully functional: +// +#define BOOST_TT_HAS_WORKING_IS_COMPLETE + #if !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_MSVC, <= 1900) namespace detail{ @@ -74,6 +80,8 @@ namespace boost { template struct is_complete : public integral_constant {}; +#undef BOOST_TT_HAS_WORKING_IS_COMPLETE + #endif } // namespace boost diff --git a/include/boost/type_traits/is_convertible.hpp b/include/boost/type_traits/is_convertible.hpp index 058301f..bf648fc 100644 --- a/include/boost/type_traits/is_convertible.hpp +++ b/include/boost/type_traits/is_convertible.hpp @@ -489,7 +489,10 @@ struct is_convertible : public integral_constant struct is_convertible : public integral_constant { -#ifdef __clang__ +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1900) + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value || boost::is_void::value || boost::is_array::value || boost::is_reference::value, "From argument type to is_convertible must be a complete type"); +#endif +#if defined(__clang__) // clang's intrinsic doesn't assert on incomplete types: BOOST_STATIC_ASSERT_MSG(boost::is_complete::value || boost::is_void::value || boost::is_array::value, "Destination argument type to is_convertible must be a complete type"); BOOST_STATIC_ASSERT_MSG(boost::is_complete::value || boost::is_void::value || boost::is_array::value, "From argument type to is_convertible must be a complete type"); diff --git a/test/compile_fail/is_assignable_fail.cpp b/test/compile_fail/is_assignable_fail.cpp index b745443..2ea6ac2 100644 --- a/test/compile_fail/is_assignable_fail.cpp +++ b/test/compile_fail/is_assignable_fail.cpp @@ -7,6 +7,10 @@ # include #include "../test.hpp" +#ifndef BOOST_TT_HAS_WORKING_IS_COMPLETE +#error "Sorry can't test this." +#endif + int main() { return boost::is_assignable::value; diff --git a/test/compile_fail/is_convertible2_fail.cpp b/test/compile_fail/is_convertible2_fail.cpp index 0afd996..8a4a051 100644 --- a/test/compile_fail/is_convertible2_fail.cpp +++ b/test/compile_fail/is_convertible2_fail.cpp @@ -7,8 +7,8 @@ # include #include "../test.hpp" -#if defined(CI_SUPPRESS_KNOWN_ISSUES) && defined(BOOST_MSVC) && (BOOST_MSVC <= 1800) -#error "Sorry check doesn't work" +#ifndef BOOST_TT_HAS_WORKING_IS_COMPLETE +#error "Sorry can't test this." #endif int main() diff --git a/test/compile_fail/is_list_constructible_fail.cpp b/test/compile_fail/is_list_constructible_fail.cpp index 429f8de..eb69bd1 100644 --- a/test/compile_fail/is_list_constructible_fail.cpp +++ b/test/compile_fail/is_list_constructible_fail.cpp @@ -7,6 +7,10 @@ # include #include "../test.hpp" +#ifndef BOOST_TT_HAS_WORKING_IS_COMPLETE +#error "Sorry can't test this." +#endif + int main() { return boost::is_list_constructible::value; diff --git a/test/is_complete_test.cpp b/test/is_complete_test.cpp index b981f18..075e70d 100644 --- a/test/is_complete_test.cpp +++ b/test/is_complete_test.cpp @@ -31,7 +31,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); -#ifndef BOOST_NO_SFINAE +#ifdef BOOST_TT_HAS_WORKING_IS_COMPLETE BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, false); #endif @@ -43,7 +43,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); -#ifndef BOOST_NO_SFINAE +#ifdef BOOST_TT_HAS_WORKING_IS_COMPLETE BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true);