#8055 closed Bugs (fixed)
Including boost/smart_ptr/shared_ptr.hpp produces warnings on clang with libc++
| Reported by: | Michel Morin | Owned by: | Peter Dimov |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | smart_ptr |
| Version: | Boost Development Trunk | Severity: | Problem |
| Keywords: | Cc: |
Description
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.
Change History (3)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

(In [82927]) Check for BOOST_NO_CXX11_RVALUE_REFERENCES in addition to BOOST_NO_CXX11_SMART_PTR. Refs #8055.