mirror of
https://github.com/boostorg/type_traits.git
synced 2025-07-29 20:17:21 +02:00
Add tests and tentative fix for issue with clang mis-identifying pairs of non-constructible types. See github #51.
This commit is contained in:
@ -16,6 +16,9 @@
|
||||
#if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
|
||||
#include <boost/type_traits/is_abstract.hpp>
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#include <utility> // std::pair
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500)
|
||||
|
||||
@ -55,6 +58,9 @@ namespace boost{
|
||||
template <class T, std::size_t N> struct is_default_constructible<T[N]> : public is_default_constructible<T>{};
|
||||
template <class T> struct is_default_constructible<T[]> : public is_default_constructible<T>{};
|
||||
template <class T> struct is_default_constructible<T&> : public integral_constant<bool, false>{};
|
||||
#ifdef __clang__
|
||||
template <class T, class U> struct is_default_constructible<std::pair<T,U> > : public integral_constant<bool, is_default_constructible<T>::value && is_default_constructible<U>::value>{};
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template <class T> struct is_default_constructible<T&&> : public integral_constant<bool, false>{};
|
||||
#endif
|
||||
|
@ -207,6 +207,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<bug11324_derived>::v
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<private_construct>::value, false);
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<deleted_construct>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::has_trivial_constructor<std::pair<deleted_construct, int> >::value), false);
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
@ -197,9 +197,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<test_abc1>::value,
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<bug11324_derived>::value, false);
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<deleted_default_construct>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_default_constructible<std::pair<deleted_default_construct, int> >::value), false);
|
||||
#endif
|
||||
#if !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40800)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<private_default_construct>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_default_constructible<std::pair<private_default_construct, int> >::value), false);
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
Reference in New Issue
Block a user