Fix has_trivial_copy so that non-copyable types are never trivially copyable! Also fix clang to detect trivially copyable array types.

This commit is contained in:
jzmaddock committed 2014-08-23 12:20:26 +01:00
1 parent c0a2a3c012
commit df74811a4c
2 files changed
+35

No files matched your search

+17
View File
@@ -12,6 +12,19 @@
# include <boost/type_traits/has_trivial_copy.hpp>
#endif
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
class bug_10389
{
int m_data;
public:
bug_10389() { m_data = 0; }
bug_10389(const bug_10389&) = delete;
bug_10389(bug_10389&& r) : m_data(r.m_data) { r.m_data = 0; }
};
#endif
TT_TEST_BEGIN(has_trivial_copy)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<bool>::value, true);
@@ -203,6 +216,10 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy<wrap<trivial_except_as
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
TT_TEST_END