From 8417d4fd2d067d2e169f3ec01003d06f37ed2436 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Mon, 12 May 2025 18:06:51 +0300 Subject: [PATCH] Fix test after Boost.TypeIndex modularization --- test/core/run/get_const_field.cpp | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/test/core/run/get_const_field.cpp b/test/core/run/get_const_field.cpp index 28007d6..a7c571e 100644 --- a/test/core/run/get_const_field.cpp +++ b/test/core/run/get_const_field.cpp @@ -6,15 +6,8 @@ #include -#include - #include -#if defined(BOOST_USE_MODULES) // TODO: fix for BOOST_USE_MODULES -int main() {} - -#else - namespace testing { namespace { @@ -32,18 +25,16 @@ void test_get_in_anon_ns_const_field() { anon x{{1}, {2}}; BOOST_TEST_EQ(boost::pfr::get<0>(x).data, 1); - auto x0_type = boost::typeindex::type_id_with_cvr(x) - )>(); - // Use runtime check to make sure that Loophole fails to compile structure_tie - BOOST_TEST_EQ(x0_type, boost::typeindex::type_id_with_cvr()); + static_assert(std::is_same< + decltype(boost::pfr::get<0>(x)), + other_anon& + >::value, ""); BOOST_TEST_EQ(boost::pfr::get<1>(x).data, 2); - auto x1_type = boost::typeindex::type_id_with_cvr(x) - )>(); - // Use runtime check to make sure that Loophole fails to compile structure_tie - BOOST_TEST_EQ(x1_type, boost::typeindex::type_id_with_cvr()); + static_assert(std::is_same< + decltype(boost::pfr::get<1>(x)), + const other_anon& + >::value, ""); } } // anonymous namespace @@ -56,5 +47,3 @@ int main() { return boost::report_errors(); } - -#endif