future (future_error(error_code)): Construct base class with error_code's message.

* include/std/future (future_error(error_code)): Construct base
	class with error_code's message.
	* src/c++11/future.cc (future_error::what()): Do not call c_str() on
	temporary string.

From-SVN: r221236
This commit is contained in:
Jonathan Wakely 2015-03-06 12:31:43 +00:00 committed by Jonathan Wakely
parent 7bfa4bc51e
commit 664e99eac4
3 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2015-03-06 Jonathan Wakely <jwakely@redhat.com>
* include/std/future (future_error(error_code)): Construct base
class with error_code's message.
* src/c++11/future.cc (future_error::what()): Do not call c_str() on
temporary string.
2015-03-05 Jonathan Wakely <jwakely@redhat.com>
* include/bits/locale_conv.h (wstring_convert::_M_conv): Handle

View File

@ -98,7 +98,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
public:
explicit future_error(error_code __ec)
: logic_error("std::future_error"), _M_code(__ec)
: logic_error("std::future_error: " + __ec.message()), _M_code(__ec)
{ }
virtual ~future_error() noexcept;

View File

@ -75,7 +75,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
future_error::~future_error() noexcept { }
const char*
future_error::what() const noexcept { return _M_code.message().c_str(); }
future_error::what() const noexcept { return logic_error::what(); }
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \
&& (ATOMIC_INT_LOCK_FREE > 1)