[Boost-bugs] [Boost C++ Libraries] #13189: copy throws exception from a function defined as noexcept

Subject: [Boost-bugs] [Boost C++ Libraries] #13189: copy throws exception from a function defined as noexcept
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-09-03 13:08:12


#13189: copy throws exception from a function defined as noexcept
------------------------------+-------------------------
 Reporter: kukkerman@… | Owner: Beman Dawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.63.0 | Severity: Problem
 Keywords: |
------------------------------+-------------------------
 When {{{copy}}} fails because access to the file specified by {{{from}}}
 is denied, the corresponding exception reaches a function defined as
 {{{noexcept}}}. Stack trace:
 {{{
 bool <anon. namespace>::error(err_t error_num, const path& p1,
                               const path& p2, error_code* ec,
                               const char* message)

 void detail::copy_file(const path& from, const path& to,
                        copy_option option, error_code* ec)

 void copy_file(const path& from, const path& to,
                BOOST_SCOPED_ENUM(copy_option) option,
                system::error_code& ec) BOOST_NOEXCEPT

 void detail::copy(const path& from, const path& to,
                   system::error_code* ec)

 void copy(const path& from, const path& to)
 }}}
 The exception is thrown from {{{error}}}, and isn't caught anywhere along
 the calling path. The problem is that {{{copy_file}}} is defined as
 {{{noexcept}}} ({{{BOOST_NOEXCEPT}}} to be precise, but it is resolved as
 {{{noexcept}}} under a C++11 compliant compiler), and doesn't handle the
 exception either, which causes program termination by implicitly calling
 {{{std::terminate}}}.

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13189>
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-09-03 13:13:52 UTC