diff options
| author | cfairles <cfairles@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-22 15:27:44 +0000 |
|---|---|---|
| committer | cfairles <cfairles@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-22 15:27:44 +0000 |
| commit | a5196aaeefd472abec700261f6ba194ce9deb889 (patch) | |
| tree | 1982e8d2183d71a4fdf9f068b3bdf561915edb14 /libstdc++-v3/testsuite/19_diagnostics/error_code | |
| parent | 6d4987fbfa4079353f8112b251af1c572cb64b95 (diff) | |
| download | ppe42-gcc-a5196aaeefd472abec700261f6ba194ce9deb889.tar.gz ppe42-gcc-a5196aaeefd472abec700261f6ba194ce9deb889.zip | |
2008-10-22 Chris Fairles <cfairles@gcc.gnu.org>
* include/std/system_error (is_error_code_enum): Specialize for errc.
(error_category::error_category): Defaulted and protected.
(error_category::~error_category): New, virtual.
(error_category::error_category(const error_category&),
error_category::operator=(const error_category&)): Deleted.
(get_system_category, get_posix_category): Remove (DR 890).
(system_category): External linkage (DR 890).
(posix_category): Remove.
(generic_category): Add. External linkage (DR 890).
(error_code::error_code<>(_ErrorCodeEnum)): Use generic_category.
(error_code::clear, error_code::operator=<>(_ErrorCodeEnum)): Forward to
error_code::assign, use generic_category.
(error_condition::error_condition,
error_condition::error_condition<>(_ErrorConditionEnum)): Use
generic_category.
(error_condition::clear,
error_condition::operator=<>(_ErrorConditionEnum)): Forward to
error_code::assign, use generic_category.
(make_error_code, make_error_condition): Define in namespace std.
* include/std/mutex (unique_lock<>::lock, unique_lock<>::try_lock,
unique_lock<>::try_lock_until<>(duration),
unique_lock<>::try_lock_for<>(duration)): Replace posix_error with errc.
* src/system_error.cc (system_error_category, generic_error_category):
New.
(gnu_error_category): Remove.
(get_system_category, get_posix_category): Remove (DR 890).
(system_category, generic_category): Define.
* src/functexcept.cc (__throw_system_error): Use generic_category.
* config/abi/pre/gnu.ver: Export system_category and generic_category,
remove get_system_category and get_generic_category (DR 890).
* config/os/generic/error_constants.h (posix_errno): Rename to errc, use
enum class type. Fix spelling.
* config/os/mingw32/error_constants.h (posix_errno): Likewise.
* testsuite/19_diagnostics/error_code/cons/1.cc: Use errc and
generic_category.
* testsuite/19_diagnostics/error_code/operators/bool.cc: Use errc.
* testsuite/19_diagnostics/error_code/operators/equal.cc: Likewise.
* testsuite/19_diagnostics/error_code/operators/not_equal.cc: Likewise.
* testsuite/19_diagnostics/error_category/cons/copy_neg.cc: Update
dg-error line numbers.
* testsuite/19_diagnostics/error_condition/cons/1.cc: Use
generic_category.
* testsuite/19_diagnostics/error_condition/operators/bool.cc: Use errc.
* testsuite/19_diagnostics/error_condition/operators/equal.cc: Likewise.
* testsuite/19_diagnostics/error_condition/operators/not_equal.cc:
Likewise.
* testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc: New.
* testsuite/19_diagnostics/headers/system_error/types_std_c++0x.cc:
Remove using tests since errc is not a namespace.
* testsuite/19_diagnostics/system_error/cons-1.cc: Use errc.
* testsuite/19_diagnostics/system_error/what-4.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_other/wchar_t/error_code.cc:
Likewise.
* testsuite/27_io/basic_ostream/inserters_other/char/error_code.cc:
Likewise.
* testsuite/30_threads/unique_lock/locking/2.cc: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141297 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/19_diagnostics/error_code')
4 files changed, 6 insertions, 6 deletions
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/1.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/1.cc index 9dc11b70a08..742eb409925 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/1.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/1.cc @@ -38,9 +38,9 @@ int main() VERIFY( e2.category() == cat ); // 3 - std::error_code e3(std::posix_error::operation_not_supported); - VERIFY( e3.value() == int(std::posix_error::operation_not_supported) ); - VERIFY( e3.category() == std::posix_category ); + std::error_code e3(std::errc::operation_not_supported); + VERIFY( e3.value() == int(std::errc::operation_not_supported) ); + VERIFY( e3.category() == std::generic_category ); return 0; } diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/bool.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/bool.cc index 04fd44fb677..385960ce0c1 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/bool.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/bool.cc @@ -35,7 +35,7 @@ int main() } // 2 - std::error_code e2(std::posix_error::operation_not_supported); + std::error_code e2(std::errc::operation_not_supported); if (e2) { VERIFY( true ); diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/equal.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/equal.cc index a8fc65c4c31..8fcf1e59440 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/equal.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/equal.cc @@ -28,7 +28,7 @@ int main() bool test __attribute__((unused)) = true; std::error_code e1; - std::error_code e2(std::posix_error::operation_not_supported); + std::error_code e2(std::errc::operation_not_supported); VERIFY( e1 == e1 ); VERIFY( !(e1 == e2) ); diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/not_equal.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/not_equal.cc index d5d75553bf5..aca79ada6b6 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/not_equal.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/not_equal.cc @@ -28,7 +28,7 @@ int main() bool test __attribute__((unused)) = true; std::error_code e1; - std::error_code e2(std::posix_error::operation_not_supported); + std::error_code e2(std::errc::operation_not_supported); VERIFY( !(e1 != e1) ); VERIFY( e1 != e2 ); |

