diff --git a/test/shared_ptr_rv_pointer_cast_test.cpp b/test/shared_ptr_rv_pointer_cast_test.cpp index 0c4ea8b..c471bda 100644 --- a/test/shared_ptr_rv_pointer_cast_test.cpp +++ b/test/shared_ptr_rv_pointer_cast_test.cpp @@ -58,6 +58,19 @@ int main() BOOST_TEST(px3.use_count() == 2); } + { + boost::shared_ptr pv(reinterpret_cast(new Y)); + + boost::shared_ptr py1 = boost::reinterpret_pointer_cast(pv); + boost::shared_ptr py2 = boost::reinterpret_pointer_cast(std::move(pv)); + BOOST_TEST(!pv); + BOOST_TEST(pv.use_count() == 0); + BOOST_TEST(py1.get() == py2.get()); + BOOST_TEST(!(py1 < py2 || py2 < py1)); + BOOST_TEST(py1.use_count() == 2); + BOOST_TEST(py2.use_count() == 2); + } + #if !defined( BOOST_NO_RTTI ) { boost::shared_ptr pu(new V); @@ -90,7 +103,4 @@ int main() return 0; } - #endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - -