Boost C++ Libraries: Ticket #7907: including tr1/memory.h causes compile errors in c++11 mode https://svn.boost.org/trac10/ticket/7907 <p> From the ML: </p> <p> On Jan 18, 2013, at 5:17 PM, Ioannis Papadopoulos &lt;ipapadop@…&gt; wrote: </p> <p> With the minimal test: </p> <pre class="wiki">#include &lt;boost/tr1/memory.hpp&gt; int main() {} </pre><p> I am getting the following using gcc 4.7.2 in C++11 mode: </p> <pre class="wiki">/usr/local/boost/boost_1_53_beta/include/boost/shared_ptr.hpp:17:0, from /usr/local/boost/boost_1_53_beta/include/boost/tr1/memory.hpp:56, from test.cc:1: /usr/local/boost/boost_1_53_beta/include/boost/smart_ptr/shared_ptr.hpp:782:74: error: declaration of ‘template&lt;class T&gt; void boost::swap(boost::shared_ptr&lt;T&gt;&amp;, boost::shared_ptr&lt;T&gt;&amp;) noexcept (true)’ has a different exception specifier </pre><blockquote> <p> .. and so on... </p> </blockquote> <p> I have duplicated this behavior using clang in C++11 mode. </p> <p> The problem is that <code>template&lt;class T&gt; void swap(shared_ptr&lt;T&gt; &amp; a, shared_ptr&lt;T&gt; &amp; b)</code> (and others) is declared <code>BOOST_NOEXCEPT</code> in /boost/smart_ptr/shared_ptr.hpp, and without the <code>BOOST_NOEXCEPT</code> in boost/tr1/memory.hpp. </p> <p> With the attached patch applied, the OP's trivial program now compiles w/o errors (using clang). </p> <p> I have marked this as a showstopper because I believe this needs to be fixed before the 1.53.0 release. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7907 Trac 1.4.3 Marshall Clow Sat, 19 Jan 2013 16:10:03 GMT attachment set https://svn.boost.org/trac10/ticket/7907 https://svn.boost.org/trac10/ticket/7907 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">tr1-noexcept.patch</span> </li> </ul> Ticket John Maddock Sun, 20 Jan 2013 11:21:03 GMT <link>https://svn.boost.org/trac10/ticket/7907#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7907#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82559" title="Fix failure caused by changes to shared_ptr. Refs #7907.">[82559]</a>) Fix failure caused by changes to shared_ptr. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7907" title="#7907: Bugs: including tr1/memory.h causes compile errors in c++11 mode (closed: fixed)">#7907</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Mon, 21 Jan 2013 10:40:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7907#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7907#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82579" title="Apply patches for issues #7429, #7891 and #7907. Refs #7907. Fixes ...">[82579]</a>) Apply patches for issues <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7429" title="#7429: Patches: Warning fixes in math (closed: fixed)">#7429</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7891" title="#7891: Bugs: hypergeometric_pdf handles N=170 incorrectly (closed: fixed)">#7891</a> and <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7907" title="#7907: Bugs: including tr1/memory.h causes compile errors in c++11 mode (closed: fixed)">#7907</a>. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7907" title="#7907: Bugs: including tr1/memory.h causes compile errors in c++11 mode (closed: fixed)">#7907</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7429" title="#7429: Patches: Warning fixes in math (closed: fixed)">#7429</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7891" title="#7891: Bugs: hypergeometric_pdf handles N=170 incorrectly (closed: fixed)">#7891</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Mon, 21 Jan 2013 12:02:55 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7907#comment:3 https://svn.boost.org/trac10/ticket/7907#comment:3 <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/82582" title="Apply fix for #7907. Fixes #7907.">[82582]</a>) Apply fix for <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7907" title="#7907: Bugs: including tr1/memory.h causes compile errors in c++11 mode (closed: fixed)">#7907</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7907" title="#7907: Bugs: including tr1/memory.h causes compile errors in c++11 mode (closed: fixed)">#7907</a>. </p> Ticket