From 1590c7d45349b3e5bb4449c740c83172f490ee74 Mon Sep 17 00:00:00 2001 From: paolo Date: Wed, 7 Nov 2012 13:20:33 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193295 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 31 +++++ libstdc++-v3/include/bits/c++config | 11 +- libstdc++-v3/include/bits/shared_ptr_base.h | 8 +- libstdc++-v3/include/debug/array | 16 +-- libstdc++-v3/include/ext/concurrence.h | 32 +---- libstdc++-v3/include/ext/pb_ds/exception.hpp | 37 ++--- libstdc++-v3/include/ext/throw_allocator.h | 9 +- libstdc++-v3/include/tr1/functional | 11 +- libstdc++-v3/include/tr1/shared_ptr.h | 11 +- libstdc++-v3/libsupc++/eh_aux_runtime.cc | 19 +-- libstdc++-v3/libsupc++/eh_personality.cc | 2 +- libstdc++-v3/libsupc++/new_op.cc | 9 +- libstdc++-v3/libsupc++/vec.cc | 13 +- libstdc++-v3/src/c++11/functexcept.cc | 149 ++++++--------------- .../testsuite/20_util/shared_ptr/cons/43820_neg.cc | 3 +- .../array/tuple_interface/get_debug_neg.cc | 4 +- .../tuple_interface/tuple_element_debug_neg.cc | 2 +- .../testsuite/ext/profile/mutex_extensions_neg.cc | 4 +- .../shared_ptr/cons/43820_neg.cc | 7 +- .../testsuite/util/io/illegal_input_error.hpp | 11 +- 20 files changed, 119 insertions(+), 270 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 233f2b9..eee5bc9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,34 @@ +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. + 2012-11-07 Jonathan Wakely * include/bits/stl_vector.h (vector(size_type)): Add missing allocator diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 60b6f12..aba931b 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -1,7 +1,6 @@ // Predefined symbols and macros -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +// Copyright (C) 1997-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 @@ -115,6 +114,14 @@ # define _GLIBCXX_NOTHROW _GLIBCXX_USE_NOEXCEPT #endif +#ifndef _GLIBCXX_THROW_OR_ABORT +# if __EXCEPTIONS +# define _GLIBCXX_THROW_OR_ABORT(_EXC) (throw (_EXC)) +# else +# define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort()) +# endif +#endif + // Macro for extern template, ie controling template linkage via use // of extern keyword on template declaration. As documented in the g++ // manual, it inhibits all implicit instantiations and is used diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index e48a8fb..ead3728 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -73,13 +73,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Substitute for bad_weak_ptr object in the case of -fno-exceptions. inline void __throw_bad_weak_ptr() - { -#if __EXCEPTIONS - throw bad_weak_ptr(); -#else - __builtin_abort(); -#endif - } + { _GLIBCXX_THROW_OR_ABORT(bad_weak_ptr()); } using __gnu_cxx::_Lock_policy; using __gnu_cxx::__default_lock_policy; diff --git a/libstdc++-v3/include/debug/array b/libstdc++-v3/include/debug/array index 1cde4e2..21b596b 100644 --- a/libstdc++-v3/include/debug/array +++ b/libstdc++-v3/include/debug/array @@ -33,14 +33,6 @@ #include -#ifndef _GLIBCXX_THROW_OR_ABORT -# if __EXCEPTIONS -# define _GLIBCXX_THROW_OR_ABORT(_Exc) (throw (_Exc)) -# else -# define _GLIBCXX_THROW_OR_ABORT(_Exc) (__builtin_abort()) -# endif -#endif - namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug @@ -165,7 +157,7 @@ namespace __debug operator[](size_type __n) const noexcept { return __n < _Nm ? _AT_Type::_S_ref(_M_elems, __n) - : (_GLIBCXX_THROW_OR_ABORT (_Array_check_subscript<_Nm>(__n)), + : (_GLIBCXX_THROW_OR_ABORT(_Array_check_subscript<_Nm>(__n)), _AT_Type::_S_ref(_M_elems, 0)); } @@ -198,7 +190,7 @@ namespace __debug front() const { return _Nm ? _AT_Type::_S_ref(_M_elems, 0) - : (_GLIBCXX_THROW_OR_ABORT (_Array_check_nonempty<_Nm>()), + : (_GLIBCXX_THROW_OR_ABORT(_Array_check_nonempty<_Nm>()), _AT_Type::_S_ref(_M_elems, 0)); } @@ -213,7 +205,7 @@ namespace __debug back() const { return _Nm ? _AT_Type::_S_ref(_M_elems, _Nm - 1) - : (_GLIBCXX_THROW_OR_ABORT (_Array_check_nonempty<_Nm>()), + : (_GLIBCXX_THROW_OR_ABORT(_Array_check_nonempty<_Nm>()), _AT_Type::_S_ref(_M_elems, 0)); } @@ -316,6 +308,4 @@ namespace __debug }; } // namespace std -#undef _GLIBCXX_THROW_OR_ABORT - #endif // _GLIBCXX_DEBUG_ARRAY diff --git a/libstdc++-v3/include/ext/concurrence.h b/libstdc++-v3/include/ext/concurrence.h index 68c679c..50b7329 100644 --- a/libstdc++-v3/include/ext/concurrence.h +++ b/libstdc++-v3/include/ext/concurrence.h @@ -99,44 +99,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Substitute for concurrence_error object in the case of -fno-exceptions. inline void __throw_concurrence_lock_error() - { -#if __EXCEPTIONS - throw __concurrence_lock_error(); -#else - __builtin_abort(); -#endif - } + { _GLIBCXX_THROW_OR_ABORT(__concurrence_lock_error()); } inline void __throw_concurrence_unlock_error() - { -#if __EXCEPTIONS - throw __concurrence_unlock_error(); -#else - __builtin_abort(); -#endif - } + { _GLIBCXX_THROW_OR_ABORT(__concurrence_unlock_error()); } #ifdef __GTHREAD_HAS_COND inline void __throw_concurrence_broadcast_error() - { -#if __EXCEPTIONS - throw __concurrence_broadcast_error(); -#else - __builtin_abort(); -#endif - } + { _GLIBCXX_THROW_OR_ABORT(__concurrence_broadcast_error()); } inline void __throw_concurrence_wait_error() - { -#if __EXCEPTIONS - throw __concurrence_wait_error(); -#else - __builtin_abort(); -#endif - } + { _GLIBCXX_THROW_OR_ABORT(__concurrence_wait_error()); } #endif class __mutex diff --git a/libstdc++-v3/include/ext/pb_ds/exception.hpp b/libstdc++-v3/include/ext/pb_ds/exception.hpp index 5213fa4..9768ab3 100644 --- a/libstdc++-v3/include/ext/pb_ds/exception.hpp +++ b/libstdc++-v3/include/ext/pb_ds/exception.hpp @@ -1,7 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 -// Free Software Foundation, Inc. +// Copyright (C) 2005-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 terms @@ -73,39 +72,21 @@ namespace __gnu_pbds /// A container cannot be resized. struct resize_error : public container_error { }; -#if __EXCEPTIONS inline void - __throw_container_error(void) - { throw container_error(); } + __throw_container_error() + { _GLIBCXX_THROW_OR_ABORT(container_error()); } inline void - __throw_insert_error(void) - { throw insert_error(); } + __throw_insert_error() + { _GLIBCXX_THROW_OR_ABORT(insert_error()); } inline void - __throw_join_error(void) - { throw join_error(); } + __throw_join_error() + { _GLIBCXX_THROW_OR_ABORT(join_error()); } inline void - __throw_resize_error(void) - { throw resize_error(); } -#else - inline void - __throw_container_error(void) - { std::abort(); } - - inline void - __throw_insert_error(void) - { std::abort(); } - - inline void - __throw_join_error(void) - { std::abort(); } - - inline void - __throw_resize_error(void) - { std::abort(); } -#endif + __throw_resize_error() + { _GLIBCXX_THROW_OR_ABORT(resize_error()); } //@} } // namespace __gnu_pbds diff --git a/libstdc++-v3/include/ext/throw_allocator.h b/libstdc++-v3/include/ext/throw_allocator.h index 8942232..0dbd351 100644 --- a/libstdc++-v3/include/ext/throw_allocator.h +++ b/libstdc++-v3/include/ext/throw_allocator.h @@ -77,14 +77,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Substitute for forced_error object when -fno-exceptions. inline void __throw_forced_error() - { -#if __EXCEPTIONS - throw forced_error(); -#else - __builtin_abort(); -#endif - } - + { _GLIBCXX_THROW_OR_ABORT(forced_error()); } /** * @brief Base class for checking address and label information diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional index ff2bd2a..d9b7a84 100644 --- a/libstdc++-v3/include/tr1/functional +++ b/libstdc++-v3/include/tr1/functional @@ -1,7 +1,6 @@ // TR1 functional header -*- C++ -*- -// Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 -// Free Software Foundation, Inc. +// Copyright (C) 2004-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 @@ -2144,13 +2143,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator()(_ArgTypes... __args) const { if (_M_empty()) - { -#if __EXCEPTIONS - throw bad_function_call(); -#else - __builtin_abort(); -#endif - } + _GLIBCXX_THROW_OR_ABORT(bad_function_call()); return _M_invoker(_M_functor, __args...); } diff --git a/libstdc++-v3/include/tr1/shared_ptr.h b/libstdc++-v3/include/tr1/shared_ptr.h index 5a1eb03..8f9870d 100644 --- a/libstdc++-v3/include/tr1/shared_ptr.h +++ b/libstdc++-v3/include/tr1/shared_ptr.h @@ -1,7 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 -// Free Software Foundation, Inc. +// Copyright (C) 2007-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 @@ -71,13 +70,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Substitute for bad_weak_ptr object in the case of -fno-exceptions. inline void __throw_bad_weak_ptr() - { -#if __EXCEPTIONS - throw bad_weak_ptr(); -#else - __builtin_abort(); -#endif - } + { _GLIBCXX_THROW_OR_ABORT(bad_weak_ptr()); } using __gnu_cxx::_Lock_policy; using __gnu_cxx::__default_lock_policy; diff --git a/libstdc++-v3/libsupc++/eh_aux_runtime.cc b/libstdc++-v3/libsupc++/eh_aux_runtime.cc index c6abe35..0cbce24 100644 --- a/libstdc++-v3/libsupc++/eh_aux_runtime.cc +++ b/libstdc++-v3/libsupc++/eh_aux_runtime.cc @@ -1,6 +1,5 @@ // -*- C++ -*- Common throw conditions. -// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2009, 2011 -// Free Software Foundation +// Copyright (C) 1994-2012 Free Software Foundation // // This file is part of GCC. // @@ -31,21 +30,9 @@ extern "C" void __cxxabiv1::__cxa_bad_cast () -{ -#ifdef __EXCEPTIONS - throw std::bad_cast(); -#else - std::abort(); -#endif -} +{ _GLIBCXX_THROW_OR_ABORT(std::bad_cast()); } extern "C" void __cxxabiv1::__cxa_bad_typeid () -{ -#ifdef __EXCEPTIONS - throw std::bad_typeid(); -#else - std::abort(); -#endif -} +{ _GLIBCXX_THROW_OR_ABORT(std::bad_typeid()); } diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc index 72f596e..2963c0c 100644 --- a/libstdc++-v3/libsupc++/eh_personality.cc +++ b/libstdc++-v3/libsupc++/eh_personality.cc @@ -768,7 +768,7 @@ __cxa_call_unexpected (void *exc_obj_in) if (check_exception_spec (&info, __get_exception_header_from_obj (new_ptr)->exceptionType, new_ptr, xh_switch_value)) - __throw_exception_again; + { __throw_exception_again; } // If the exception spec allows std::bad_exception, throw that. // We don't have a thrown object to compare against, but since diff --git a/libstdc++-v3/libsupc++/new_op.cc b/libstdc++-v3/libsupc++/new_op.cc index bb0199e..7366d55 100644 --- a/libstdc++-v3/libsupc++/new_op.cc +++ b/libstdc++-v3/libsupc++/new_op.cc @@ -1,7 +1,6 @@ // Support routines for the -*- C++ -*- dynamic memory management. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2009, 2011 -// Free Software Foundation +// Copyright (C) 1997-2012 Free Software Foundation // // This file is part of GCC. // @@ -54,11 +53,7 @@ operator new (std::size_t sz) _GLIBCXX_THROW (std::bad_alloc) { new_handler handler = __new_handler; if (! handler) -#ifdef __EXCEPTIONS - throw bad_alloc(); -#else - std::abort(); -#endif + _GLIBCXX_THROW_OR_ABORT(bad_alloc()); handler (); p = (void *) malloc (sz); } diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc index 507514e..04cb3fa 100644 --- a/libstdc++-v3/libsupc++/vec.cc +++ b/libstdc++-v3/libsupc++/vec.cc @@ -28,7 +28,6 @@ #include #include #include -#include #include #include "unwind-cxx.h" @@ -66,18 +65,10 @@ namespace __cxxabiv1 std::size_t padding_size) { if (element_size && element_count > std::size_t(-1) / element_size) -#ifdef __EXCEPTIONS - throw std::bad_alloc(); -#else - std::abort(); -#endif + _GLIBCXX_THROW_OR_ABORT(std::bad_alloc()); std::size_t size = element_count * element_size; if (size + padding_size < size) -#ifdef __EXCEPTIONS - throw std::bad_alloc(); -#else - std::abort(); -#endif + _GLIBCXX_THROW_OR_ABORT(std::bad_alloc()); return size + padding_size; } } 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 diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc index a2ceeb5..179932f 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc @@ -32,9 +32,8 @@ void test01() { X* px = 0; std::shared_ptr p1(px); // { dg-error "here" } - // { dg-error "incomplete" "" { target *-*-* } 775 } + // { dg-error "incomplete" "" { target *-*-* } 769 } std::shared_ptr p9(ap()); // { dg-error "here" } // { dg-error "incomplete" "" { target *-*-* } 307 } - } diff --git a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/get_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/get_debug_neg.cc index a19ca72..d93663d 100644 --- a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/get_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/get_debug_neg.cc @@ -28,6 +28,6 @@ int n1 = std::get<1>(a); int n2 = std::get<1>(std::move(a)); int n3 = std::get<1>(ca); -// { dg-error "static assertion failed" "" { target *-*-* } 274 } +// { dg-error "static assertion failed" "" { target *-*-* } 266 } +// { dg-error "static assertion failed" "" { target *-*-* } 275 } // { dg-error "static assertion failed" "" { target *-*-* } 283 } -// { dg-error "static assertion failed" "" { target *-*-* } 291 } diff --git a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element_debug_neg.cc index c5f6f65..a61b213 100644 --- a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element_debug_neg.cc @@ -23,4 +23,4 @@ typedef std::tuple_element<1, std::array>::type type; -// { dg-error "static assertion failed" "" { target *-*-* } 314 } +// { dg-error "static assertion failed" "" { target *-*-* } 306 } diff --git a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc index 104fc4b..8e90359 100644 --- a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc +++ b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc @@ -6,7 +6,7 @@ // Otherwise we may get *multiple* errors. #undef _GLIBCXX_PARALLEL -// Copyright (C) 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2006-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 @@ -25,4 +25,4 @@ #include -// { dg-error "multiple inlined namespaces" "" { target *-*-* } 262 } +// { dg-error "multiple inlined namespaces" "" { target *-*-* } 269 } diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc index 0309f8f..d064c37 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc @@ -1,6 +1,6 @@ // { dg-do compile } -// Copyright (C) 2010, 2012 Free Software Foundation +// Copyright (C) 2010-2012 Free Software Foundation // // 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 @@ -30,9 +30,8 @@ void test01() { X* px = 0; std::tr1::shared_ptr p1(px); // { dg-error "here" } - // { dg-error "incomplete" "" { target *-*-* } 563 } + // { dg-error "incomplete" "" { target *-*-* } 556 } std::tr1::shared_ptr p9(ap()); // { dg-error "here" } - // { dg-error "incomplete" "" { target *-*-* } 602 } - + // { dg-error "incomplete" "" { target *-*-* } 595 } } diff --git a/libstdc++-v3/testsuite/util/io/illegal_input_error.hpp b/libstdc++-v3/testsuite/util/io/illegal_input_error.hpp index 79f003b..f506c0a 100644 --- a/libstdc++-v3/testsuite/util/io/illegal_input_error.hpp +++ b/libstdc++-v3/testsuite/util/io/illegal_input_error.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005-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 terms @@ -17,7 +17,6 @@ // along with this library; see the file COPYING3. If not see // . - // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL. // Permission to use, copy, modify, sell, and distribute this software @@ -49,13 +48,7 @@ namespace __gnu_pbds // Substitute for concurrence_error object in the case of -fno-exceptions. inline void __throw_illegal_input_error() - { -#if __EXCEPTIONS - throw illegal_input_error(); -#else - __builtin_abort(); -#endif - } + { _GLIBCXX_THROW_OR_ABORT(illegal_input_error()); } } // namespace test } // namespace __gnu_pbds -- 2.7.4