diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-09-16 14:55:37 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-09-16 14:55:37 +0000 |
commit | b5fbd147fe61d53f46dbf60fc1103ec01409c8b4 (patch) | |
tree | 62c67233a98b4b2f7d6e793a4fc989df02ce2345 /libstdc++-v3/include/std/system_error | |
parent | 7d58b9e77aab0f4c8cd8f6eb4dc618b240325099 (diff) | |
download | gcc-b5fbd147fe61d53f46dbf60fc1103ec01409c8b4.zip gcc-b5fbd147fe61d53f46dbf60fc1103ec01409c8b4.tar.gz gcc-b5fbd147fe61d53f46dbf60fc1103ec01409c8b4.tar.bz2 |
system_error (system_error::system_error(error_code), [...]): Fix for what() to return the NBTS recommended in the Note in 19.5.6.2/14.
2010-09-16 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/system_error (system_error::system_error(error_code),
system_error(error_code, const string&), system_error(int, const
error_category&), system_error(int, const error_category&,
const string&)): Fix for what() to return the NBTS recommended in
the Note in 19.5.6.2/14.
* testsuite/19_diagnostics/system_error/cons-1.cc: Adjust.
* testsuite/19_diagnostics/system_error/what-1.cc: Likewise.
* testsuite/19_diagnostics/system_error/what-2.cc: Likewise.
* testsuite/19_diagnostics/system_error/what-big.cc: Likewise.
* testsuite/19_diagnostics/system_error/what-3.cc: Likewise.
* testsuite/19_diagnostics/system_error/what-4.cc: Tidy includes.
From-SVN: r164339
Diffstat (limited to 'libstdc++-v3/include/std/system_error')
-rw-r--r-- | libstdc++-v3/include/std/system_error | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error index e224242..2c968e9 100644 --- a/libstdc++-v3/include/std/system_error +++ b/libstdc++-v3/include/std/system_error @@ -311,26 +311,29 @@ _GLIBCXX_BEGIN_NAMESPACE(std) public: system_error(error_code __ec = error_code()) - : runtime_error(""), _M_code(__ec) { } + : runtime_error(__ec.message()), _M_code(__ec) { } system_error(error_code __ec, const string& __what) - : runtime_error(__what), _M_code(__ec) { } - + : runtime_error(__what + ": " + __ec.message()), _M_code(__ec) { } + /* * TODO: Add const char* ctors to all exceptions. * * system_error(error_code __ec, const char* __what) - * : runtime_error(__what), _M_code(__ec) { } + * : runtime_error(__what + (": " + __ec.message())), _M_code(__ec) { } * * system_error(int __v, const error_category& __ecat, const char* __what) - * : runtime_error(__what), _M_code(error_code(__v, __ecat)) { } + * : runtime_error(__what + (": " + __ec.message())), + * _M_code(error_code(__v, __ecat)) { } */ system_error(int __v, const error_category& __ecat) - : runtime_error(""), _M_code(error_code(__v, __ecat)) { } + : runtime_error(error_code(__v, __ecat).message()), + _M_code(__v, __ecat) { } system_error(int __v, const error_category& __ecat, const string& __what) - : runtime_error(__what), _M_code(error_code(__v, __ecat)) { } + : runtime_error(__what + ": " + error_code(__v, __ecat).message()), + _M_code(__v, __ecat) { } virtual ~system_error() throw(); |