mirror of
https://github.com/boostorg/type_traits.git
synced 2025-08-03 14:34:34 +02:00
Assert on incomplete types: begin fixing test failures for msvc-12.0, 14.0, and clang.
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user