Boost C++ Libraries: Ticket #4174: Patch to fix auto_ptr usage errors in ptr_container tests https://svn.boost.org/trac10/ticket/4174 <p> At several places in the ptr_container tests, we have the following pattern: </p> <blockquote> <p> void f(const std::auto_ptr&lt;int&gt; &amp;); void g() { </p> <blockquote> <p> f(std::auto_ptr&lt;int&gt;(new int(5))); </p> </blockquote> <p> } </p> </blockquote> <p> This is code is ill-formed in C++98/03, because the compiler is required to check there there exits a copy constructor that would be able to make a copy of the auto_ptr before binding it to a reference, even if that copy won't actually be made. Not all compilers diagnose this error, but Clang and EDG in strict mode do diagnose the problem. </p> <p> The attached patch fixes the issue. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4174 Trac 1.4.3 Douglas Gregor Fri, 30 Apr 2010 22:21:52 GMT attachment set https://svn.boost.org/trac10/ticket/4174 https://svn.boost.org/trac10/ticket/4174 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ptr_container_const_ref_fixes.patch</span> </li> </ul> <p> Patch fixing the problem </p> Ticket Douglas Gregor Fri, 30 Apr 2010 22:22:22 GMT component changed; owner set https://svn.boost.org/trac10/ticket/4174#comment:1 https://svn.boost.org/trac10/ticket/4174#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Thorsten Ottosen</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">ptr_container</span> </li> </ul> Ticket Douglas Gregor Sat, 01 May 2010 00:13:05 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4174#comment:2 https://svn.boost.org/trac10/ticket/4174#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/61718" title="At several places in the ptr_container tests, we have the following ...">[61718]</a>) At several places in the ptr_container tests, we have the following pattern: </p> <p> void f(const std::auto_ptr&lt;int&gt; &amp;); void g() { </p> <p> f(std::auto_ptr&lt;int&gt;(new int(5))); </p> <p> } </p> <p> This is code is ill-formed in C++98/03, because the compiler is required to check there there exits a copy constructor that would be able to make a copy of the auto_ptr before binding it to a reference, even if that copy won't actually be made. Not all compilers diagnose this error, but Clang and EDG in strict mode do diagnose the problem. </p> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4174" title="#4174: Patches: Patch to fix auto_ptr usage errors in ptr_container tests (closed: fixed)">#4174</a>. </p> Ticket