Fix result of add_reference<const void>.

Also update tests.
See https://svn.boost.org/trac/boost/ticket/11900.
This commit is contained in:
jzmaddock
2016-01-10 18:10:17 +00:00
parent 70afe1dd0d
commit 217c337233
4 changed files with 19 additions and 4 deletions

View File

@@ -49,9 +49,9 @@ template <class T> struct add_reference<T&>
// these full specialisations are always required:
template <> struct add_reference<void> { typedef void type; };
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
template <> struct add_reference<const void> { typedef void type; };
template <> struct add_reference<const volatile void> { typedef void type; };
template <> struct add_reference<volatile void> { typedef void type; };
template <> struct add_reference<const void> { typedef const void type; };
template <> struct add_reference<const volatile void> { typedef const volatile void type; };
template <> struct add_reference<volatile void> { typedef volatile void type; };
#endif
} // namespace boost

View File

@@ -52,7 +52,12 @@ TT_TEST_BEGIN(add_lvalue_reference)
add_lvalue_reference_test_13a();
#endif
TT_TEST_END
BOOST_CHECK_TYPE(tt::add_lvalue_reference<void>::type, void);
BOOST_CHECK_TYPE(tt::add_lvalue_reference<const void>::type, const void);
BOOST_CHECK_TYPE(tt::add_lvalue_reference<const volatile void>::type, const volatile void);
BOOST_CHECK_TYPE(tt::add_lvalue_reference<volatile void>::type, volatile void);
TT_TEST_END

View File

@@ -52,6 +52,11 @@ TT_TEST_BEGIN(add_reference)
add_reference_test_13a();
#endif
BOOST_CHECK_TYPE(tt::add_reference<void>::type, void);
BOOST_CHECK_TYPE(tt::add_reference<const void>::type, const void);
BOOST_CHECK_TYPE(tt::add_reference<const volatile void>::type, const volatile void);
BOOST_CHECK_TYPE(tt::add_reference<volatile void>::type, volatile void);
TT_TEST_END

View File

@@ -69,6 +69,11 @@ TT_TEST_BEGIN(add_rvalue_reference)
add_rvalue_reference_test_13a();
#endif
BOOST_CHECK_TYPE(tt::add_rvalue_reference<void>::type, void);
BOOST_CHECK_TYPE(tt::add_rvalue_reference<const void>::type, const void);
BOOST_CHECK_TYPE(tt::add_rvalue_reference<const volatile void>::type, const volatile void);
BOOST_CHECK_TYPE(tt::add_rvalue_reference<volatile void>::type, volatile void);
TT_TEST_END