diff --git a/test/has_nothrow_constr_test.cpp b/test/has_nothrow_constr_test.cpp index 0cc5cb7..f2d60e3 100644 --- a/test/has_nothrow_constr_test.cpp +++ b/test/has_nothrow_constr_test.cpp @@ -37,15 +37,6 @@ struct deleted_default_construct #endif -struct private_default_construct -{ -private: - private_default_construct(); -public: - private_default_construct(char val) : member(val) {} - char member; -}; - #ifndef BOOST_NO_CXX11_NOEXCEPT struct noexcept_default_construct { @@ -210,7 +201,6 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::v #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); #endif -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); #ifndef BOOST_NO_CXX11_NOEXCEPT BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); #endif diff --git a/test/has_nothrow_copy_test.cpp b/test/has_nothrow_copy_test.cpp index 034cb65..aa2ca02 100644 --- a/test/has_nothrow_copy_test.cpp +++ b/test/has_nothrow_copy_test.cpp @@ -12,13 +12,6 @@ # include #endif -struct non_copy -{ - non_copy(); -private: - non_copy(const non_copy&); -}; - #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS struct delete_copy @@ -237,10 +230,6 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); #endif -#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); -#endif - TT_TEST_END diff --git a/test/has_trivial_assign_test.cpp b/test/has_trivial_assign_test.cpp index c5e40a3..50aced7 100644 --- a/test/has_trivial_assign_test.cpp +++ b/test/has_trivial_assign_test.cpp @@ -12,13 +12,6 @@ # include #endif -struct non_assignable -{ - non_assignable(); -private: - non_assignable& operator=(const non_assignable&); -}; - #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS struct non_assignable2 @@ -224,7 +217,6 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false) #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); #endif -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); TT_TEST_END diff --git a/test/has_trivial_constr_test.cpp b/test/has_trivial_constr_test.cpp index 16a4e8a..4b89df3 100644 --- a/test/has_trivial_constr_test.cpp +++ b/test/has_trivial_constr_test.cpp @@ -27,13 +27,6 @@ public: explicit bug11324_derived(char arg) : data(arg) {} }; -struct private_construct -{ - private_construct(int); -private: - private_construct(); -}; - #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS struct deleted_construct @@ -204,7 +197,6 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); #endif diff --git a/test/has_trivial_copy_test.cpp b/test/has_trivial_copy_test.cpp index 043f76e..6a803b8 100644 --- a/test/has_trivial_copy_test.cpp +++ b/test/has_trivial_copy_test.cpp @@ -25,13 +25,6 @@ public: #endif -struct private_copy -{ - private_copy(); -private: - private_copy(const private_copy&); -}; - TT_TEST_BEGIN(has_trivial_copy) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); @@ -227,7 +220,6 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); #endif -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); TT_TEST_END diff --git a/test/has_trivial_destructor_test.cpp b/test/has_trivial_destructor_test.cpp index 3792004..960a575 100644 --- a/test/has_trivial_destructor_test.cpp +++ b/test/has_trivial_destructor_test.cpp @@ -22,13 +22,6 @@ struct deleted_destruct #endif -struct private_destruct -{ - private_destruct(); -private: - ~private_destruct(); -}; - TT_TEST_BEGIN(has_trivial_destructor) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); @@ -187,7 +180,6 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, true, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); #endif diff --git a/test/is_default_constr_test.cpp b/test/is_default_constr_test.cpp index 89444b3..01a702c 100644 --- a/test/is_default_constr_test.cpp +++ b/test/is_default_constr_test.cpp @@ -37,15 +37,6 @@ struct deleted_default_construct #endif -struct private_default_construct -{ -private: - private_default_construct(); -public: - private_default_construct(char val) : member(val) {} - char member; -}; - TT_TEST_BEGIN(is_default_constructible) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); @@ -198,7 +189,6 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible:: #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, false); #endif -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, false); TT_TEST_END diff --git a/test/is_nothrow_move_constructible_test.cpp b/test/is_nothrow_move_constructible_test.cpp index d756edc..3fdad74 100644 --- a/test/is_nothrow_move_constructible_test.cpp +++ b/test/is_nothrow_move_constructible_test.cpp @@ -14,13 +14,6 @@ # include #endif -struct non_copy -{ - non_copy(); -private: - non_copy(const non_copy&); -}; - #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS struct delete_copy @@ -245,8 +238,6 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); - #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif diff --git a/test/tricky_private_member_test.cpp b/test/tricky_private_member_test.cpp new file mode 100644 index 0000000..b113fdf --- /dev/null +++ b/test/tricky_private_member_test.cpp @@ -0,0 +1,71 @@ + +// (C) Copyright John Maddock 2015. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +struct private_default_construct +{ +private: + private_default_construct(); +public: + private_default_construct(char val) : member(val) {} + char member; +}; + +struct non_copy +{ + non_copy(); +private: + non_copy(const non_copy&); +}; + +struct non_assignable +{ + non_assignable(); +private: + non_assignable& operator=(const non_assignable&); +}; + +struct private_copy +{ + private_copy(); +private: + private_copy(const private_copy&); +}; + +struct private_destruct +{ + private_destruct(); +private: + ~private_destruct(); +}; + + + +TT_TEST_BEGIN(tricky_private_members_test) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); + + + +TT_TEST_END + +