Subject: [Boost-bugs] [Boost C++ Libraries] #8055: Including boost/smart_ptr/shared_ptr.hpp produces warnings on clang with libc++
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-13 16:03:14
#8055: Including boost/smart_ptr/shared_ptr.hpp produces warnings on clang with
libc++
-------------------------------------+--------------------------------------
Reporter: michel | Owner: pdimov
Type: Bugs | Status: new
Milestone: To Be Determined | Component: smart_ptr
Version: Boost Development Trunk | Severity: Problem
Keywords: |
-------------------------------------+--------------------------------------
On clang with libc++ in a C++03 mode, including
`boost/smart_ptr/shared_ptr.hpp` produces warnings.
Here is a test case
{{{
#include <boost/smart_ptr/shared_ptr.hpp>
int main(int argc, char* argv[]) { return 0; }
}}}
and warnings
{{{
boost/smart_ptr/shared_ptr.hpp:491:41:
warning: rvalue references are a C++11 extension [-Wc++11-extensions]
shared_ptr( std::unique_ptr< Y, D > && 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 & operator=( std::unique_ptr<Y, D> && r )
^
boost/smart_ptr/shared_ptr.hpp:558:55:
warning: rvalue references are a C++11 extension [-Wc++11-extensions]
this_type( static_cast< std::unique_ptr<Y, D> && >( r )
).swap(*this);
^
}}}
This is because `!defined(BOOST_NO_CXX11_SMART_PTR)` does not imply
`!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)` in this configuration.
It would be nice to remove warnings by adding
`!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)` guard.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8055> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC