Assert on incomplete types: begin fixing test failures for msvc-12.0, 14.0, and clang.

This commit is contained in:
jzmaddock
2018-02-04 12:52:24 +00:00
parent ac351390b2
commit bfb6384a0a
2 changed files with 11 additions and 4 deletions

View File

@@ -27,7 +27,7 @@
namespace boost {
#ifndef BOOST_NO_SFINAE_EXPR
#if !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_MSVC, <= 1900)
namespace detail{
@@ -43,7 +43,7 @@ namespace boost {
template <class T> struct is_complete
: public integral_constant<bool, ::boost::is_function<typename boost::remove_reference<T>::type>::value || (sizeof(detail::check_is_complete<T>(0)) != sizeof(char))> {};
#elif !defined(BOOST_NO_SFINAE)
#elif !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
namespace detail
{

View File

@@ -14,11 +14,11 @@
#include <boost/type_traits/intrinsics.hpp>
#include <boost/type_traits/integral_constant.hpp>
#ifndef BOOST_IS_CONVERTIBLE
#include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/static_assert.hpp>
#ifndef BOOST_IS_CONVERTIBLE
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/type_traits/detail/config.hpp>
#include <boost/type_traits/is_array.hpp>
@@ -487,7 +487,14 @@ struct is_convertible : public integral_constant<bool, ::boost::detail::is_conve
#else
template <class From, class To>
struct is_convertible : public integral_constant<bool, BOOST_IS_CONVERTIBLE(From, To)> {};
struct is_convertible : public integral_constant<bool, BOOST_IS_CONVERTIBLE(From, To)>
{
#ifdef __clang__
// clang's intrinsic doesn't assert on incomplete types:
BOOST_STATIC_ASSERT_MSG(boost::is_complete<To>::value || boost::is_void<To>::value || boost::is_array<To>::value, "Destination argument type to is_convertible must be a complete type");
BOOST_STATIC_ASSERT_MSG(boost::is_complete<From>::value || boost::is_void<From>::value || boost::is_array<From>::value, "From argument type to is_convertible must be a complete type");
#endif
};
#endif