Boost C++ Libraries: Ticket #438: shared_ptr/weak_ptr tests are not C++ spec compliant https://svn.boost.org/trac10/ticket/438 <pre class="wiki">Please refer to the latest C++ spec (Second edition, 2003-04-01), section 12.8.15, "Copying class objects". Look at your source code in test/weak_ptr_test.cpp. 1. You cannot assume the reference count of the shared_ptr going into the copy_assignment function is one. The spec says that compilers are allowed to make an optimization to eliminate a copy, but not mandated to do so. This means that the effective reference count upon entry to the function may be two, not one. To correct your unit tests, forcibly create a local object that you pass by value to guarantee the reference count is two upon entry for all compilers. To respond to the following email address, remove all capital Z's. rZoZbZeZrZt.bZuZcZk@mathworks.com </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/438 Trac 1.4.3 Peter Dimov Thu, 14 Jul 2005 17:15:03 GMT status changed https://svn.boost.org/trac10/ticket/438#comment:1 https://svn.boost.org/trac10/ticket/438#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=305912 This has already been fixed in CVS: http://cvs.sourceforge.net/viewcvs.py/boost/boost/libs/smart_ptr/test/weak_ptr_test.cpp </pre> Ticket