future (future_error(error_code)): Construct base class with error_code's message.
authorJonathan Wakely <jwakely@redhat.com>
Fri, 6 Mar 2015 12:31:43 +0000 (12:31 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 6 Mar 2015 12:31:43 +0000 (12:31 +0000)
* 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

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/future
libstdc++-v3/src/c++11/future.cc

index ed4edf8b89f6ac4398d3eb21837fc3ceb055e0ce..4880391798f260163a57f2eeec1e6c966417cc5b 100644 (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
index cb0226dec4c0a05d9533b1b1fcd5475935e40b00..fc3f8162ae6da42817b0b7dd3f1943c9eab25f4e 100644 (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;
index c711a5fe8236093166712368979353c36bff0dac..3cf503b6b34f288ebc68ec7b50548e9140640b52 100644 (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)