forked from boostorg/type_traits
Revert "Move private-constructor tests into separate file."
This wasn't the right fix, and didn't fix the issue anyway.
This reverts commit fe5f4e2253.
This commit is contained in:
1 parent
fe5f4e2253
commit
863ba0a7c5
83 files changed
+534
-494
No files matched your search
@@ -37,6 +37,15 @@ 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
|
||||
{
|
||||
@@ -201,6 +210,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<bug11324_derived>::v
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<deleted_default_construct>::value, false);
|
||||
#endif
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<private_default_construct>::value, false);
|
||||
#ifndef BOOST_NO_CXX11_NOEXCEPT
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<noexcept_default_construct>::value, true);
|
||||
#endif
|
||||
|
||||
@@ -12,6 +12,13 @@
|
||||
# include <boost/type_traits/has_nothrow_copy.hpp>
|
||||
#endif
|
||||
|
||||
struct non_copy
|
||||
{
|
||||
non_copy();
|
||||
private:
|
||||
non_copy(const non_copy&);
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
|
||||
struct delete_copy
|
||||
@@ -230,6 +237,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<delete_copy>::value, false)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<noexcept_copy>::value, true);
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<non_copy>::value, false);
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,13 @@
|
||||
# include <boost/type_traits/has_trivial_assign.hpp>
|
||||
#endif
|
||||
|
||||
struct non_assignable
|
||||
{
|
||||
non_assignable();
|
||||
private:
|
||||
non_assignable& operator=(const non_assignable&);
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
|
||||
struct non_assignable2
|
||||
@@ -217,6 +224,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<test_abc1>::value, false)
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<non_assignable2>::value, false);
|
||||
#endif
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<non_assignable>::value, false);
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
@@ -27,6 +27,13 @@ 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
|
||||
@@ -197,6 +204,7 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<wrap<trivial_ex
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<test_abc1>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<bug11324_derived>::value, false);
|
||||
|
||||
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);
|
||||
#endif
|
||||
|
||||
@@ -25,6 +25,13 @@ 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<bool>::value, true);
|
||||
@@ -220,6 +227,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<test_abc1>::value, false);
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<bug_10389>::value, false);
|
||||
#endif
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<private_copy>::value, false);
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
@@ -22,6 +22,13 @@ 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<bool>::value, true);
|
||||
@@ -180,6 +187,7 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<wrap<trivial_exc
|
||||
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<wrap<trivial_except_construct> >::value, true, false);
|
||||
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<wrap<trivial_except_assign> >::value, true, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<private_destruct>::value, false);
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<deleted_destruct>::value, false);
|
||||
#endif
|
||||
|
||||
@@ -37,6 +37,15 @@ 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<bool>::value, true);
|
||||
@@ -189,6 +198,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<bug11324_derived>::
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<deleted_default_construct>::value, false);
|
||||
#endif
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<private_default_construct>::value, false);
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
@@ -14,6 +14,13 @@
|
||||
# include <boost/type_traits/is_nothrow_move_constructible.hpp>
|
||||
#endif
|
||||
|
||||
struct non_copy
|
||||
{
|
||||
non_copy();
|
||||
private:
|
||||
non_copy(const non_copy&);
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
|
||||
struct delete_copy
|
||||
@@ -238,6 +245,8 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<nothrow_assign
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<nothrow_construct_UDT>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<test_abc1>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<non_copy>::value, false);
|
||||
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<delete_copy>::value, false);
|
||||
#endif
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
|
||||
// (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 <type_traits>
|
||||
#else
|
||||
# include <boost/type_traits.hpp>
|
||||
#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<private_default_construct>::value, false);
|
||||
#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<non_copy>::value, false);
|
||||
#endif
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<non_assignable>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<private_default_construct>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<private_copy>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<private_destruct>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<private_default_construct>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<non_copy>::value, false);
|
||||
|
||||
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
Reference in new issue
Block a user