From adfe8642afbd77f1739d00ee86dd2ee09f286f89 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Wed, 17 Jul 2013 14:38:39 +0000 Subject: [PATCH] Fix tests for is_copy_constructible triat and fix reference-to-reference issue (refs #8802). [SVN r85060] --- include/boost/type_traits/is_copy_constructible.hpp | 12 ++++++++---- test/is_copy_constructible_test.cpp | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/boost/type_traits/is_copy_constructible.hpp b/include/boost/type_traits/is_copy_constructible.hpp index 756c2e7..032ad2b 100644 --- a/include/boost/type_traits/is_copy_constructible.hpp +++ b/include/boost/type_traits/is_copy_constructible.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -65,9 +66,11 @@ struct is_copy_constructible_impl2 { // T(const T &) = delete; // ... // }; - BOOST_STATIC_CONSTANT(bool, - value = (sizeof(test(boost::declval())) == sizeof(boost::type_traits::yes_type)) - ); + BOOST_STATIC_CONSTANT(bool, value = ( + sizeof(test( + boost::declval::type>() + )) == sizeof(boost::type_traits::yes_type) + )); }; template @@ -81,7 +84,8 @@ struct is_copy_constructible_impl { BOOST_STATIC_CONSTANT(bool, value = ( boost::detail::is_copy_constructible_impl2< boost::is_base_and_derived::value, - T>::value + T + >::value )); }; diff --git a/test/is_copy_constructible_test.cpp b/test/is_copy_constructible_test.cpp index a54c399..7cca73a 100644 --- a/test/is_copy_constructible_test.cpp +++ b/test/is_copy_constructible_test.cpp @@ -259,7 +259,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, true BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, true); #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, true);