Boost C++ Libraries: Ticket #11622: std::auto_ptr is deprecated https://svn.boost.org/trac10/ticket/11622 <p> Hi, </p> <p> I'm using Boost 1.59 and compiling a signals2 program using a new compiler: gcc 5.2.1. </p> <p> My code is now littered with warnings!! warning: ‘template&lt;class&gt; class std::auto_ptr’ is deprecated </p> <p> and indeed: Checking it here <a class="ext-link" href="http://en.cppreference.com/w/cpp/memory/auto_ptr"><span class="icon">​</span>http://en.cppreference.com/w/cpp/memory/auto_ptr</a> I see: "deprecated since C++11" </p> <p> (Seems that std::unique_ptr is the favoured replacement.) </p> <p> Here's the output of an online compiler: <a class="ext-link" href="http://melpon.org/wandbox/permlink/7QyVTXZ51MVonsgv"><span class="icon">​</span>http://melpon.org/wandbox/permlink/7QyVTXZ51MVonsgv</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11622 Trac 1.4.3 anonymous Mon, 07 Sep 2015 09:30:42 GMT <link>https://svn.boost.org/trac10/ticket/11622#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11622#comment:1</guid> <description> <p> It's really driving me nuts. </p> <p> The only way I'm keeping sane, is to use this compile flag: </p> <blockquote> <p> -Wno-deprecated-declarations </p> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>Frank Mori Hess</dc:creator> <pubDate>Thu, 10 Sep 2015 17:32:17 GMT</pubDate> <title>owner, component changed https://svn.boost.org/trac10/ticket/11622#comment:2 https://svn.boost.org/trac10/ticket/11622#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Frank Mori Hess</span> to <span class="trac-author">Peter Dimov</span> </li> <li><strong>component</strong> <span class="trac-field-old">signals2</span> → <span class="trac-field-new">smart_ptr</span> </li> </ul> <p> These warnings aren't coming (directly) from Boost.Signals2 they are coming from the smart pointers library. </p> Ticket Peter Dimov Thu, 10 Sep 2015 20:52:28 GMT <link>https://svn.boost.org/trac10/ticket/11622#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11622#comment:3</guid> <description> <p> Should be fixed in <a class="ext-link" href="https://github.com/boostorg/smart_ptr/commit/df904965833dcf1bf2eb4d7d1416369dd806e092"><span class="icon">​</span>https://github.com/boostorg/smart_ptr/commit/df904965833dcf1bf2eb4d7d1416369dd806e092</a> </p> </description> <category>Ticket</category> </item> <item> <author>jack@…</author> <pubDate>Thu, 29 Sep 2016 00:44:11 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/11622#comment:4 https://svn.boost.org/trac10/ticket/11622#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">jack@…</span> added </li> </ul> <p> Compiling Zcash with <code>-Werror</code> using Boost 1.62.0 (which includes the above fix), I still get this error: </p> <pre class="wiki">In file included from /home/str4d/dev/zcash/zcash/depends/x86_64-unknown-linux-gnu/include/boost/spirit/home/classic/core/non_terminal/grammar.hpp:21:0, from /home/str4d/dev/zcash/zcash/depends/x86_64-unknown-linux-gnu/include/boost/spirit/home/classic/core.hpp:42, from /home/str4d/dev/zcash/zcash/depends/x86_64-unknown-linux-gnu/include/boost/spirit/include/classic_core.hpp:11, from json/json_spirit_reader_template.h:19, from asyncrpcoperation.h:20, from asyncrpcqueue.h:8, from asyncrpcqueue.cpp:5: /home/str4d/dev/zcash/zcash/depends/x86_64-unknown-linux-gnu/include/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp: In member function ‘boost::spirit::classic::impl::grammar_helper&lt;GrammarT, DerivedT, ScannerT&gt;::definition_t&amp; boost::spirit::classic::impl::grammar_helper&lt;GrammarT, DerivedT, ScannerT&gt;::define(const grammar_t*)’: /home/str4d/dev/zcash/zcash/depends/x86_64-unknown-linux-gnu/include/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp:159:18: error: ‘template&lt;class&gt; class std::auto_ptr’ is deprecated [-Werror=deprecated-declarations] std::auto_ptr&lt;definition_t&gt; ^ In file included from /usr/include/c++/5/memory:81:0, from asyncrpcoperation.h:13, from asyncrpcqueue.h:8, from asyncrpcqueue.cpp:5: /usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here template&lt;typename&gt; class auto_ptr; ^ </pre><p> It seems that the fix applied to the smart pointers library needs to be expanded to all libraries that use <code>auto_ptr</code>. </p> Ticket anonymous Sat, 29 Apr 2017 04:28:14 GMT <link>https://svn.boost.org/trac10/ticket/11622#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11622#comment:5</guid> <description> <p> still an issue in the 1.64.0 Release. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Sat, 29 Apr 2017 17:25:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11622#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11622#comment:6</guid> <description> <p> The Spirit issue, or something in smart_ptr? </p> </description> <category>Ticket</category> </item> <item> <author>nenad.miksa@…</author> <pubDate>Sun, 17 Sep 2017 17:14:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11622#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11622#comment:7</guid> <description> <p> libc++ v5 (available in AUR on <a class="missing wiki">ArchLinux</a>) does not have auto_ptr header anymore, if compiling with flag <code>-std=gnu++1z</code>, so this is now a compile error, not a warning anymore: </p> <pre class="wiki">boost/include/boost/ptr_container/ptr_sequence_adapter.hpp:223:45: error: no type named 'auto_ptr' in namespace 'std' explicit ptr_sequence_adapter( std::auto_ptr&lt;PtrContainer&gt; clone ) ~~~~~^ </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 26 Sep 2017 02:40:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11622#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11622#comment:8</guid> <description> <p> /usr/local/include/boost/statechart/processor_container.hpp:67:16: warning: 'template&lt;class&gt; class std::auto_ptr' is deprecated [-Wdeprecated-declarations] </p> <blockquote> <p> typedef std::auto_ptr&lt; processor_base_type &gt; processor_holder_type; </p> </blockquote> </description> <category>Ticket</category> </item> <item> <author>Tony E Lewis <TonyELewis@…></author> <pubDate>Wed, 17 Jan 2018 12:06:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11622#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11622#comment:9</guid> <description> <p> I just hit this issue whilst trying to use Boost 1.66 with C++17. </p> <p> But from what I can see the C++17 issue has been fixed since 1.66 in <a class="ext-link" href="https://github.com/boostorg/ptr_container/commit/b805b3cc303a30600b2568ea599fbfb27dac1d82"><span class="icon">​</span>b805b3c</a>. </p> <p> I don't know how that affects the original deprecated warnings issue, though it looks as though there are several more commits about this in the last couple of months. </p> <p> To anyone having problems with the warnings: can you work around the problem by specifying the Boost include using <code>-isystem</code>? </p> </description> <category>Ticket</category> </item> <item> <author>vanriper.trey@…</author> <pubDate>Wed, 25 Apr 2018 18:45:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11622#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11622#comment:10</guid> <description> <p> I'm seeing these warnings in boost.locale within 1.66, using gnu g++ version 5.4.0. </p> </description> <category>Ticket</category> </item> <item> <author>blair@…</author> <pubDate>Wed, 30 May 2018 00:38:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11622#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11622#comment:11</guid> <description> <p> I'm getting these errors when trying to install R dependencies for lubridate and forecast.... </p> <p> /usr/local/lib/R/site-library/BH/include/boost/smart_ptr/scoped_ptr.hpp:74:31: warning: 'template&lt;class&gt; class std::auto_ptr' is deprecated </p> </description> <category>Ticket</category> </item> </channel> </rss>