[Boost-bugs] [Boost C++ Libraries] #11927: optional_test_swap.cpp: In C++11 mode, std::swap should have a noexcept specification

Subject: [Boost-bugs] [Boost C++ Libraries] #11927: optional_test_swap.cpp: In C++11 mode, std::swap should have a noexcept specification
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-01-20 18:59:53


#11927: optional_test_swap.cpp: In C++11 mode, std::swap should have a noexcept
specification
-------------------------------------------+-----------------------
 Reporter: Aparna Kumta <aparna.kumta@…> | Owner: fcacciola
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: optional
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------------+-----------------------
 Compiling libs/optional/test/optional_test_swap.cpp with Oracle Solaris
 Studio 12.5 in C++11 mode, we see the following error:

 "../libs/optional/test/optional_test_swap.cpp", line 239: Error: The prior
 declaration for
 std::swap<optional_swap_test::class_whose_default_ctor_should_not_be_used>(optional_swap_test::class_whose_default_ctor_should_not_be_used&,
 optional_swap_test::class_whose_default_ctor_should_not_be_used&) has an
 exception specification.
 "../libs/optional/test/optional_test_swap.cpp", line 245: Error: The prior
 declaration for
 std::swap<optional_swap_test::class_without_default_ctor>(optional_swap_test::class_without_default_ctor&,
 optional_swap_test::class_without_default_ctor&) has an exception
 specification.
 2 Error(s) detected.

 See:
 http://www.boost.org/development/tests/develop/developer/output/oracle-
 intel-S2-12-5-cpp11-boost-bin-v2-libs-optional-test-optional_test_swap-
 test-sun-12-5_cpp11-release-threading-multi.html


 In C++03, the std::swap template does not have an exception
 specification. In C++11, it has a noexcept specification.


 This seems to be a violation of the standard.
 15.4[except.spec]p5:
 =====
 If any declaration of a function has an exception-specification that is
 not a
 noexcept-specification allowing
 all exceptions, all declarations, including the definition and any
 explicit
 specialization, of that function shall
 have a compatible exception-specification.

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