From 54ba39f599fc2f3d59fd3cd828a301ce9b731a20 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 7 Nov 2012 13:20:33 +0000 Subject: array (_GLIBCXX_THROW_OR_ABORT): Move... 2012-11-07 Paolo Carlini * include/debug/array (_GLIBCXX_THROW_OR_ABORT): Move... * include/bits/c++config: ... here. * include/bits/shared_ptr_base.h (__throw_bad_weak_ptr): Use it. * include/ext/pb_ds/exception.hpp: Likewise. * include/ext/throw_allocator.h (__throw_forced_error): Likewise. * include/ext/concurrence.h (__throw_concurrence_lock_error, __throw_concurrence_unlock_error, __throw_concurrence_broadcast_error, __throw_concurrence_wait_error): Likewise. * include/tr1/shared_ptr.h (__throw_bad_weak_ptr): Likewise. * include/tr1/functional (function<_Res(_ArgTypes...)>::operator() (_ArgTypes...)): Likewise. * libsupc++/eh_aux_runtime.cc (__cxxabiv1::__cxa_bad_cast, __cxxabiv1::__cxa_bad_typeid): Likewise. * libsupc++/vec.cc (compute_size): Likewise. * libsupc++/new_op.cc (operator new (std::size_t)): Likewise. * src/c++11/functexcept.cc: Likewise. * testsuite/util/io/illegal_input_error.hpp (__throw_illegal_input_error): Likewise. * libsupc++/eh_personality.cc: Avoid warning with -fno-exceptions. * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error line numbers. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Likewise. * testsuite/23_containers/array/tuple_interface/ tuple_element_debug_neg.cc: Likewise. * testsuite/23_containers/array/tuple_interface/get_debug_neg.cc: Likewise. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Likewise. From-SVN: r193295 --- libstdc++-v3/src/c++11/functexcept.cc | 149 +++++++++------------------------- 1 file changed, 38 insertions(+), 111 deletions(-) (limited to 'libstdc++-v3/src') diff --git a/libstdc++-v3/src/c++11/functexcept.cc b/libstdc++-v3/src/c++11/functexcept.cc index 2fe14d5..687882b 100644 --- a/libstdc++-v3/src/c++11/functexcept.cc +++ b/libstdc++-v3/src/c++11/functexcept.cc @@ -1,5 +1,4 @@ -// Copyright (C) 2001, 2002, 2003, 2005, 2009, 2010 -// Free Software Foundation, Inc. +// Copyright (C) 2001-2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -44,151 +43,79 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION -#if __EXCEPTIONS void - __throw_bad_exception(void) - { throw bad_exception(); } + __throw_bad_exception() + { _GLIBCXX_THROW_OR_ABORT(bad_exception()); } void - __throw_bad_alloc(void) - { throw bad_alloc(); } + __throw_bad_alloc() + { _GLIBCXX_THROW_OR_ABORT(bad_alloc()); } void - __throw_bad_cast(void) - { throw bad_cast(); } + __throw_bad_cast() + { _GLIBCXX_THROW_OR_ABORT(bad_cast()); } void - __throw_bad_typeid(void) - { throw bad_typeid(); } + __throw_bad_typeid() + { _GLIBCXX_THROW_OR_ABORT(bad_typeid()); } void - __throw_logic_error(const char* __s) - { throw logic_error(_(__s)); } + __throw_logic_error(const char* __s __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(logic_error(_(__s))); } void - __throw_domain_error(const char* __s) - { throw domain_error(_(__s)); } + __throw_domain_error(const char* __s __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(domain_error(_(__s))); } void - __throw_invalid_argument(const char* __s) - { throw invalid_argument(_(__s)); } + __throw_invalid_argument(const char* __s __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(invalid_argument(_(__s))); } void - __throw_length_error(const char* __s) - { throw length_error(_(__s)); } + __throw_length_error(const char* __s __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(length_error(_(__s))); } void - __throw_out_of_range(const char* __s) - { throw out_of_range(_(__s)); } + __throw_out_of_range(const char* __s __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(out_of_range(_(__s))); } void - __throw_runtime_error(const char* __s) - { throw runtime_error(_(__s)); } + __throw_runtime_error(const char* __s __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(runtime_error(_(__s))); } void - __throw_range_error(const char* __s) - { throw range_error(_(__s)); } + __throw_range_error(const char* __s __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(range_error(_(__s))); } void - __throw_overflow_error(const char* __s) - { throw overflow_error(_(__s)); } + __throw_overflow_error(const char* __s __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(overflow_error(_(__s))); } void - __throw_underflow_error(const char* __s) - { throw underflow_error(_(__s)); } + __throw_underflow_error(const char* __s __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(underflow_error(_(__s))); } void - __throw_ios_failure(const char* __s) - { throw ios_base::failure(_(__s)); } + __throw_ios_failure(const char* __s __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(ios_base::failure(_(__s))); } void - __throw_system_error(int __i) - { throw system_error(error_code(__i, generic_category())); } + __throw_system_error(int __i __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(system_error(error_code(__i, + generic_category()))); } void - __throw_future_error(int __i) - { throw future_error(make_error_code(future_errc(__i))); } + __throw_future_error(int __i __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(future_error(make_error_code(future_errc(__i)))); } void __throw_bad_function_call() - { throw bad_function_call(); } + { _GLIBCXX_THROW_OR_ABORT(bad_function_call()); } void - __throw_regex_error(regex_constants::error_type __ecode) - { throw regex_error(__ecode); } -#else - void - __throw_bad_exception(void) - { std::abort(); } - - void - __throw_bad_alloc(void) - { std::abort(); } - - void - __throw_bad_cast(void) - { std::abort(); } - - void - __throw_bad_typeid(void) - { std::abort(); } - - void - __throw_logic_error(const char*) - { std::abort(); } - - void - __throw_domain_error(const char*) - { std::abort(); } - - void - __throw_invalid_argument(const char*) - { std::abort(); } - - void - __throw_length_error(const char*) - { std::abort(); } - - void - __throw_out_of_range(const char*) - { std::abort(); } - - void - __throw_runtime_error(const char*) - { std::abort(); } - - void - __throw_range_error(const char*) - { std::abort(); } - - void - __throw_overflow_error(const char*) - { std::abort(); } - - void - __throw_underflow_error(const char*) - { std::abort(); } - - void - __throw_ios_failure(const char*) - { std::abort(); } - - void - __throw_system_error(int) - { std::abort(); } - - void - __throw_future_error(int) - { std::abort(); } - - void - __throw_bad_function_call() - { std::abort(); } - - void - __throw_regex_error(regex_constants::error_type __ecode) - { std::abort(); } -#endif //__EXCEPTIONS + __throw_regex_error(regex_constants::error_type __ecode + __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(regex_error(__ecode)); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace -- cgit v1.1