2 // Copyright Antony Polukhin, 2012-2018.
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 #include <boost/core/lightweight_test.hpp>
10 #include <boost/type_index.hpp>
11 #include "test_lib_anonymous.hpp"
15 #define BOOST_CHECK_NE(x, y) BOOST_CHECK(x != y)
21 void comparing_anonymous_types_between_modules()
23 boost::typeindex::type_index t_const_userdef
= boost::typeindex::type_id_with_cvr
<const user_defined
>();
24 boost::typeindex::type_index t_userdef
= boost::typeindex::type_id
<user_defined
>();
26 // Known to fail on Clang and old versions of GCC.
27 //BOOST_TEST_NE(t_userdef, test_lib::get_anonymous_user_defined_class());
28 //BOOST_TEST_NE(t_const_userdef, test_lib::get_const_anonymous_user_defined_class());
31 << "t_userdef == " << t_userdef
32 << ", test_lib::get_anonymous_user_defined_class() == " << test_lib::get_anonymous_user_defined_class()
35 << "t_const_userdef == " << t_const_userdef
36 << ", test_lib::get_const_anonymous_user_defined_class() == " << test_lib::get_const_anonymous_user_defined_class()
39 BOOST_TEST_NE(t_const_userdef
, test_lib::get_anonymous_user_defined_class());
40 BOOST_TEST_NE(t_userdef
, test_lib::get_const_anonymous_user_defined_class());
44 comparing_anonymous_types_between_modules();
46 return boost::report_errors();