[Boost-bugs] [Boost C++ Libraries] #7907: including tr1/memory.h causes compile errors in c++11 mode

Subject: [Boost-bugs] [Boost C++ Libraries] #7907: including tr1/memory.h causes compile errors in c++11 mode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-01-19 16:08:49


#7907: including tr1/memory.h causes compile errors in c++11 mode
--------------------------+-------------------------------------------------
 Reporter: marshall | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: Boost 1.53.0 | Component: TR1
  Version: Boost 1.52.0 | Severity: Showstopper
 Keywords: |
--------------------------+-------------------------------------------------
 From the ML:


 On Jan 18, 2013, at 5:17 PM, Ioannis Papadopoulos <ipapadop_at_[hidden]>
 wrote:

 With the minimal test:

 {{{
 #include <boost/tr1/memory.hpp>
 int main() {}
 }}}

 I am getting the following using gcc 4.7.2 in C++11 mode:

 {{{
 /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<class T> void
 boost::swap(boost::shared_ptr<T>&, boost::shared_ptr<T>&) noexcept
 (true)’ has a different exception specifier
 }}}

  .. and so on...

 I have duplicated this behavior using clang in C++11 mode.

 The problem is that `template<class T> void swap(shared_ptr<T> & a,
 shared_ptr<T> & b)` (and others) is declared `BOOST_NOEXCEPT` in
 /boost/smart_ptr/shared_ptr.hpp, and without the `BOOST_NOEXCEPT` in
 boost/tr1/memory.hpp.

 With the attached patch applied, the OP's trivial program now compiles w/o
 errors (using clang).

 I have marked this as a showstopper because I believe this needs to be
 fixed before the 1.53.0 release.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7907>
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:11 UTC