Protect struct POD definition with the same macro as the test

This commit is contained in:
Ion Gaztañaga
2024-05-28 10:51:33 +02:00
parent 2f0155224b
commit f46ee4391f
2 changed files with 4 additions and 2 deletions

View File

@@ -311,7 +311,7 @@ int map_test_range()
::boost::movelib::unique_ptr<MyBoostMap> const pboostmap = ::boost::movelib::make_unique<MyBoostMap> ::boost::movelib::unique_ptr<MyBoostMap> const pboostmap = ::boost::movelib::make_unique<MyBoostMap>
( boost::make_move_iterator(&aux_vect[0]) ( boost::make_move_iterator(&aux_vect[0])
, boost::make_move_iterator(&aux_vect[0] + MaxElem), typename MyBoostMap::allocator_type()); , boost::make_move_iterator(&aux_vect[0] + MaxElem));
::boost::movelib::unique_ptr<MyStdMap> const pstdmap = ::boost::movelib::make_unique<MyStdMap> ::boost::movelib::unique_ptr<MyStdMap> const pstdmap = ::boost::movelib::make_unique<MyStdMap>
(&aux_vect2[0], &aux_vect2[0] + MaxElem, typename MyStdMap::key_compare()); (&aux_vect2[0], &aux_vect2[0] + MaxElem, typename MyStdMap::key_compare());
if(!CheckEqualContainers(*pboostmap, *pstdmap)) return 1; if(!CheckEqualContainers(*pboostmap, *pstdmap)) return 1;

View File

@@ -226,11 +226,13 @@ bool test_span_conversion()
#endif //BOOST_VECTOR_TEST_HAS_SPAN #endif //BOOST_VECTOR_TEST_HAS_SPAN
#if !defined(_MSC_VER)
struct POD { int POD::*ptr; }; struct POD { int POD::*ptr; };
BOOST_CONTAINER_STATIC_ASSERT_MSG BOOST_CONTAINER_STATIC_ASSERT_MSG
( boost::container::dtl::is_pod<POD>::value ( boost::container::dtl::is_pod<POD>::value
, "POD test failed" , "POD test failed"
); );
#endif
int main() int main()
{ {
@@ -409,7 +411,7 @@ int main()
} }
//////////////////////////////////// ////////////////////////////////////
// POD types should not be 0-filled testing // POD types should not be 0-filled
//////////////////////////////////// ////////////////////////////////////
#if !defined(_MSC_VER) #if !defined(_MSC_VER)
// MSVC miscompiles value initialization of pointers to data members, // MSVC miscompiles value initialization of pointers to data members,