Opened 10 years ago

Closed 10 years ago

#7907 closed Bugs (fixed)

including tr1/memory.h causes compile errors in c++11 mode

Reported by: Marshall Clow Owned by: John Maddock
Milestone: Boost 1.53.0 Component: TR1
Version: Boost 1.52.0 Severity: Showstopper
Keywords: Cc:

Description

From the ML:

On Jan 18, 2013, at 5:17 PM, Ioannis Papadopoulos <ipapadop@…> 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.

Attachments (1)

tr1-noexcept.patch (1.4 KB ) - added by Marshall Clow 10 years ago.

Download all attachments as: .zip

Change History (4)

by Marshall Clow, 10 years ago

Attachment: tr1-noexcept.patch added

comment:1 by John Maddock, 10 years ago

(In [82559]) Fix failure caused by changes to shared_ptr. Refs #7907.

comment:2 by John Maddock, 10 years ago

(In [82579]) Apply patches for issues #7429, #7891 and #7907. Refs #7907. Fixes #7429. Fixes #7891.

comment:3 by John Maddock, 10 years ago

Resolution: fixed
Status: newclosed

(In [82582]) Apply fix for #7907. Fixes #7907.

Note: See TracTickets for help on using tickets.