Boost C++ Libraries: Ticket #8055: Including boost/smart_ptr/shared_ptr.hpp produces warnings on clang with libc++ https://svn.boost.org/trac10/ticket/8055 <p> On clang with libc++ in a C++03 mode, including <code>boost/smart_ptr/shared_ptr.hpp</code> produces warnings. Here is a test case </p> <pre class="wiki">#include &lt;boost/smart_ptr/shared_ptr.hpp&gt; int main(int argc, char* argv[]) { return 0; } </pre><p> and warnings </p> <pre class="wiki">boost/smart_ptr/shared_ptr.hpp:491:41: warning: rvalue references are a C++11 extension [-Wc++11-extensions] shared_ptr( std::unique_ptr&lt; Y, D &gt; &amp;&amp; r ): px( r.get() ), pn() ^ boost/smart_ptr/shared_ptr.hpp:556:51: warning: rvalue references are a C++11 extension [-Wc++11-extensions] shared_ptr &amp; operator=( std::unique_ptr&lt;Y, D&gt; &amp;&amp; r ) ^ boost/smart_ptr/shared_ptr.hpp:558:55: warning: rvalue references are a C++11 extension [-Wc++11-extensions] this_type( static_cast&lt; std::unique_ptr&lt;Y, D&gt; &amp;&amp; &gt;( r ) ).swap(*this); ^ </pre><p> This is because <code>!defined(BOOST_NO_CXX11_SMART_PTR)</code> does not imply <code>!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)</code> in this configuration. </p> <p> It would be nice to remove warnings by adding <code>!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)</code> guard. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8055 Trac 1.4.3 Peter Dimov Sat, 16 Feb 2013 17:18:20 GMT <link>https://svn.boost.org/trac10/ticket/8055#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8055#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82927" title="Check for BOOST_NO_CXX11_RVALUE_REFERENCES in addition to ...">[82927]</a>) Check for BOOST_NO_CXX11_RVALUE_REFERENCES in addition to BOOST_NO_CXX11_SMART_PTR. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8055" title="#8055: Bugs: Including boost/smart_ptr/shared_ptr.hpp produces warnings on clang ... (closed: fixed)">#8055</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Sat, 16 Feb 2013 17:21:24 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8055#comment:2 https://svn.boost.org/trac10/ticket/8055#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/82928" title="Merged revision(s) 82927 from trunk: Check for ...">[82928]</a>) Merged revision(s) 82927 from trunk: Check for BOOST_NO_CXX11_RVALUE_REFERENCES in addition to BOOST_NO_CXX11_SMART_PTR. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8055" title="#8055: Bugs: Including boost/smart_ptr/shared_ptr.hpp produces warnings on clang ... (closed: fixed)">#8055</a>. </p> Ticket Michel Morin Sun, 17 Feb 2013 05:22:55 GMT <link>https://svn.boost.org/trac10/ticket/8055#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8055#comment:3</guid> <description> <p> Thanks Peter. Now the warning gets disappeared. </p> </description> <category>Ticket</category> </item> </channel> </rss>