Commit 54ba39f5 by Paolo Carlini Committed by Paolo Carlini

array (_GLIBCXX_THROW_OR_ABORT): Move...

2012-11-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* 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
parent c501a38e
2012-11-07 Paolo Carlini <paolo.carlini@oracle.com>
* 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 <jwakely.gcc@gmail.com> 2012-11-07 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/bits/stl_vector.h (vector(size_type)): Add missing allocator * include/bits/stl_vector.h (vector(size_type)): Add missing allocator
......
// Predefined symbols and macros -*- C++ -*- // Predefined symbols and macros -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, // Copyright (C) 1997-2012 Free Software Foundation, Inc.
// 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -115,6 +114,14 @@ ...@@ -115,6 +114,14 @@
# define _GLIBCXX_NOTHROW _GLIBCXX_USE_NOEXCEPT # define _GLIBCXX_NOTHROW _GLIBCXX_USE_NOEXCEPT
#endif #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 // Macro for extern template, ie controling template linkage via use
// of extern keyword on template declaration. As documented in the g++ // of extern keyword on template declaration. As documented in the g++
// manual, it inhibits all implicit instantiations and is used // manual, it inhibits all implicit instantiations and is used
......
...@@ -73,13 +73,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -73,13 +73,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Substitute for bad_weak_ptr object in the case of -fno-exceptions. // Substitute for bad_weak_ptr object in the case of -fno-exceptions.
inline void inline void
__throw_bad_weak_ptr() __throw_bad_weak_ptr()
{ { _GLIBCXX_THROW_OR_ABORT(bad_weak_ptr()); }
#if __EXCEPTIONS
throw bad_weak_ptr();
#else
__builtin_abort();
#endif
}
using __gnu_cxx::_Lock_policy; using __gnu_cxx::_Lock_policy;
using __gnu_cxx::__default_lock_policy; using __gnu_cxx::__default_lock_policy;
......
...@@ -33,14 +33,6 @@ ...@@ -33,14 +33,6 @@
#include <debug/safe_sequence.h> #include <debug/safe_sequence.h>
#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 std _GLIBCXX_VISIBILITY(default)
{ {
namespace __debug namespace __debug
...@@ -165,7 +157,7 @@ namespace __debug ...@@ -165,7 +157,7 @@ namespace __debug
operator[](size_type __n) const noexcept operator[](size_type __n) const noexcept
{ {
return __n < _Nm ? _AT_Type::_S_ref(_M_elems, __n) 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)); _AT_Type::_S_ref(_M_elems, 0));
} }
...@@ -198,7 +190,7 @@ namespace __debug ...@@ -198,7 +190,7 @@ namespace __debug
front() const front() const
{ {
return _Nm ? _AT_Type::_S_ref(_M_elems, 0) 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)); _AT_Type::_S_ref(_M_elems, 0));
} }
...@@ -213,7 +205,7 @@ namespace __debug ...@@ -213,7 +205,7 @@ namespace __debug
back() const back() const
{ {
return _Nm ? _AT_Type::_S_ref(_M_elems, _Nm - 1) 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)); _AT_Type::_S_ref(_M_elems, 0));
} }
...@@ -316,6 +308,4 @@ namespace __debug ...@@ -316,6 +308,4 @@ namespace __debug
}; };
} // namespace std } // namespace std
#undef _GLIBCXX_THROW_OR_ABORT
#endif // _GLIBCXX_DEBUG_ARRAY #endif // _GLIBCXX_DEBUG_ARRAY
...@@ -99,44 +99,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -99,44 +99,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Substitute for concurrence_error object in the case of -fno-exceptions. // Substitute for concurrence_error object in the case of -fno-exceptions.
inline void inline void
__throw_concurrence_lock_error() __throw_concurrence_lock_error()
{ { _GLIBCXX_THROW_OR_ABORT(__concurrence_lock_error()); }
#if __EXCEPTIONS
throw __concurrence_lock_error();
#else
__builtin_abort();
#endif
}
inline void inline void
__throw_concurrence_unlock_error() __throw_concurrence_unlock_error()
{ { _GLIBCXX_THROW_OR_ABORT(__concurrence_unlock_error()); }
#if __EXCEPTIONS
throw __concurrence_unlock_error();
#else
__builtin_abort();
#endif
}
#ifdef __GTHREAD_HAS_COND #ifdef __GTHREAD_HAS_COND
inline void inline void
__throw_concurrence_broadcast_error() __throw_concurrence_broadcast_error()
{ { _GLIBCXX_THROW_OR_ABORT(__concurrence_broadcast_error()); }
#if __EXCEPTIONS
throw __concurrence_broadcast_error();
#else
__builtin_abort();
#endif
}
inline void inline void
__throw_concurrence_wait_error() __throw_concurrence_wait_error()
{ { _GLIBCXX_THROW_OR_ABORT(__concurrence_wait_error()); }
#if __EXCEPTIONS
throw __concurrence_wait_error();
#else
__builtin_abort();
#endif
}
#endif #endif
class __mutex class __mutex
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 // Copyright (C) 2005-2012 Free Software Foundation, Inc.
// Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the terms
...@@ -73,39 +72,21 @@ namespace __gnu_pbds ...@@ -73,39 +72,21 @@ namespace __gnu_pbds
/// A container cannot be resized. /// A container cannot be resized.
struct resize_error : public container_error { }; struct resize_error : public container_error { };
#if __EXCEPTIONS
inline void inline void
__throw_container_error(void) __throw_container_error()
{ throw container_error(); } { _GLIBCXX_THROW_OR_ABORT(container_error()); }
inline void inline void
__throw_insert_error(void) __throw_insert_error()
{ throw insert_error(); } { _GLIBCXX_THROW_OR_ABORT(insert_error()); }
inline void inline void
__throw_join_error(void) __throw_join_error()
{ throw join_error(); } { _GLIBCXX_THROW_OR_ABORT(join_error()); }
inline void inline void
__throw_resize_error(void) __throw_resize_error()
{ throw resize_error(); } { _GLIBCXX_THROW_OR_ABORT(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
//@} //@}
} // namespace __gnu_pbds } // namespace __gnu_pbds
......
...@@ -77,14 +77,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -77,14 +77,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Substitute for forced_error object when -fno-exceptions. // Substitute for forced_error object when -fno-exceptions.
inline void inline void
__throw_forced_error() __throw_forced_error()
{ { _GLIBCXX_THROW_OR_ABORT(forced_error()); }
#if __EXCEPTIONS
throw forced_error();
#else
__builtin_abort();
#endif
}
/** /**
* @brief Base class for checking address and label information * @brief Base class for checking address and label information
......
// TR1 functional header -*- C++ -*- // TR1 functional header -*- C++ -*-
// Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 // Copyright (C) 2004-2012 Free Software Foundation, Inc.
// Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -2144,13 +2143,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -2144,13 +2143,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
operator()(_ArgTypes... __args) const operator()(_ArgTypes... __args) const
{ {
if (_M_empty()) if (_M_empty())
{ _GLIBCXX_THROW_OR_ABORT(bad_function_call());
#if __EXCEPTIONS
throw bad_function_call();
#else
__builtin_abort();
#endif
}
return _M_invoker(_M_functor, __args...); return _M_invoker(_M_functor, __args...);
} }
......
// <tr1/shared_ptr.h> -*- C++ -*- // <tr1/shared_ptr.h> -*- C++ -*-
// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 // Copyright (C) 2007-2012 Free Software Foundation, Inc.
// Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -71,13 +70,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -71,13 +70,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Substitute for bad_weak_ptr object in the case of -fno-exceptions. // Substitute for bad_weak_ptr object in the case of -fno-exceptions.
inline void inline void
__throw_bad_weak_ptr() __throw_bad_weak_ptr()
{ { _GLIBCXX_THROW_OR_ABORT(bad_weak_ptr()); }
#if __EXCEPTIONS
throw bad_weak_ptr();
#else
__builtin_abort();
#endif
}
using __gnu_cxx::_Lock_policy; using __gnu_cxx::_Lock_policy;
using __gnu_cxx::__default_lock_policy; using __gnu_cxx::__default_lock_policy;
......
// -*- C++ -*- Common throw conditions. // -*- C++ -*- Common throw conditions.
// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2009, 2011 // Copyright (C) 1994-2012 Free Software Foundation
// Free Software Foundation
// //
// This file is part of GCC. // This file is part of GCC.
// //
...@@ -31,21 +30,9 @@ ...@@ -31,21 +30,9 @@
extern "C" void extern "C" void
__cxxabiv1::__cxa_bad_cast () __cxxabiv1::__cxa_bad_cast ()
{ { _GLIBCXX_THROW_OR_ABORT(std::bad_cast()); }
#ifdef __EXCEPTIONS
throw std::bad_cast();
#else
std::abort();
#endif
}
extern "C" void extern "C" void
__cxxabiv1::__cxa_bad_typeid () __cxxabiv1::__cxa_bad_typeid ()
{ { _GLIBCXX_THROW_OR_ABORT(std::bad_typeid()); }
#ifdef __EXCEPTIONS
throw std::bad_typeid();
#else
std::abort();
#endif
}
...@@ -768,7 +768,7 @@ __cxa_call_unexpected (void *exc_obj_in) ...@@ -768,7 +768,7 @@ __cxa_call_unexpected (void *exc_obj_in)
if (check_exception_spec (&info, __get_exception_header_from_obj if (check_exception_spec (&info, __get_exception_header_from_obj
(new_ptr)->exceptionType, (new_ptr)->exceptionType,
new_ptr, xh_switch_value)) new_ptr, xh_switch_value))
__throw_exception_again; { __throw_exception_again; }
// If the exception spec allows std::bad_exception, throw that. // If the exception spec allows std::bad_exception, throw that.
// We don't have a thrown object to compare against, but since // We don't have a thrown object to compare against, but since
......
// Support routines for the -*- C++ -*- dynamic memory management. // Support routines for the -*- C++ -*- dynamic memory management.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2009, 2011 // Copyright (C) 1997-2012 Free Software Foundation
// Free Software Foundation
// //
// This file is part of GCC. // This file is part of GCC.
// //
...@@ -54,11 +53,7 @@ operator new (std::size_t sz) _GLIBCXX_THROW (std::bad_alloc) ...@@ -54,11 +53,7 @@ operator new (std::size_t sz) _GLIBCXX_THROW (std::bad_alloc)
{ {
new_handler handler = __new_handler; new_handler handler = __new_handler;
if (! handler) if (! handler)
#ifdef __EXCEPTIONS _GLIBCXX_THROW_OR_ABORT(bad_alloc());
throw bad_alloc();
#else
std::abort();
#endif
handler (); handler ();
p = (void *) malloc (sz); p = (void *) malloc (sz);
} }
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <cxxabi.h> #include <cxxabi.h>
#include <new> #include <new>
#include <exception> #include <exception>
#include <cstdlib>
#include <bits/exception_defines.h> #include <bits/exception_defines.h>
#include "unwind-cxx.h" #include "unwind-cxx.h"
...@@ -66,18 +65,10 @@ namespace __cxxabiv1 ...@@ -66,18 +65,10 @@ namespace __cxxabiv1
std::size_t padding_size) std::size_t padding_size)
{ {
if (element_size && element_count > std::size_t(-1) / element_size) if (element_size && element_count > std::size_t(-1) / element_size)
#ifdef __EXCEPTIONS _GLIBCXX_THROW_OR_ABORT(std::bad_alloc());
throw std::bad_alloc();
#else
std::abort();
#endif
std::size_t size = element_count * element_size; std::size_t size = element_count * element_size;
if (size + padding_size < size) if (size + padding_size < size)
#ifdef __EXCEPTIONS _GLIBCXX_THROW_OR_ABORT(std::bad_alloc());
throw std::bad_alloc();
#else
std::abort();
#endif
return size + padding_size; return size + padding_size;
} }
} }
......
// Copyright (C) 2001, 2002, 2003, 2005, 2009, 2010 // Copyright (C) 2001-2012 Free Software Foundation, Inc.
// Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -44,151 +43,79 @@ namespace std _GLIBCXX_VISIBILITY(default) ...@@ -44,151 +43,79 @@ namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __EXCEPTIONS
void void
__throw_bad_exception(void) __throw_bad_exception()
{ throw bad_exception(); } { _GLIBCXX_THROW_OR_ABORT(bad_exception()); }
void void
__throw_bad_alloc(void) __throw_bad_alloc()
{ throw bad_alloc(); } { _GLIBCXX_THROW_OR_ABORT(bad_alloc()); }
void void
__throw_bad_cast(void) __throw_bad_cast()
{ throw bad_cast(); } { _GLIBCXX_THROW_OR_ABORT(bad_cast()); }
void void
__throw_bad_typeid(void) __throw_bad_typeid()
{ throw bad_typeid(); } { _GLIBCXX_THROW_OR_ABORT(bad_typeid()); }
void void
__throw_logic_error(const char* __s) __throw_logic_error(const char* __s __attribute__((unused)))
{ throw logic_error(_(__s)); } { _GLIBCXX_THROW_OR_ABORT(logic_error(_(__s))); }
void void
__throw_domain_error(const char* __s) __throw_domain_error(const char* __s __attribute__((unused)))
{ throw domain_error(_(__s)); } { _GLIBCXX_THROW_OR_ABORT(domain_error(_(__s))); }
void void
__throw_invalid_argument(const char* __s) __throw_invalid_argument(const char* __s __attribute__((unused)))
{ throw invalid_argument(_(__s)); } { _GLIBCXX_THROW_OR_ABORT(invalid_argument(_(__s))); }
void void
__throw_length_error(const char* __s) __throw_length_error(const char* __s __attribute__((unused)))
{ throw length_error(_(__s)); } { _GLIBCXX_THROW_OR_ABORT(length_error(_(__s))); }
void void
__throw_out_of_range(const char* __s) __throw_out_of_range(const char* __s __attribute__((unused)))
{ throw out_of_range(_(__s)); } { _GLIBCXX_THROW_OR_ABORT(out_of_range(_(__s))); }
void void
__throw_runtime_error(const char* __s) __throw_runtime_error(const char* __s __attribute__((unused)))
{ throw runtime_error(_(__s)); } { _GLIBCXX_THROW_OR_ABORT(runtime_error(_(__s))); }
void void
__throw_range_error(const char* __s) __throw_range_error(const char* __s __attribute__((unused)))
{ throw range_error(_(__s)); } { _GLIBCXX_THROW_OR_ABORT(range_error(_(__s))); }
void void
__throw_overflow_error(const char* __s) __throw_overflow_error(const char* __s __attribute__((unused)))
{ throw overflow_error(_(__s)); } { _GLIBCXX_THROW_OR_ABORT(overflow_error(_(__s))); }
void void
__throw_underflow_error(const char* __s) __throw_underflow_error(const char* __s __attribute__((unused)))
{ throw underflow_error(_(__s)); } { _GLIBCXX_THROW_OR_ABORT(underflow_error(_(__s))); }
void void
__throw_ios_failure(const char* __s) __throw_ios_failure(const char* __s __attribute__((unused)))
{ throw ios_base::failure(_(__s)); } { _GLIBCXX_THROW_OR_ABORT(ios_base::failure(_(__s))); }
void void
__throw_system_error(int __i) __throw_system_error(int __i __attribute__((unused)))
{ throw system_error(error_code(__i, generic_category())); } { _GLIBCXX_THROW_OR_ABORT(system_error(error_code(__i,
generic_category()))); }
void void
__throw_future_error(int __i) __throw_future_error(int __i __attribute__((unused)))
{ throw future_error(make_error_code(future_errc(__i))); } { _GLIBCXX_THROW_OR_ABORT(future_error(make_error_code(future_errc(__i)))); }
void void
__throw_bad_function_call() __throw_bad_function_call()
{ throw bad_function_call(); } { _GLIBCXX_THROW_OR_ABORT(bad_function_call()); }
void void
__throw_regex_error(regex_constants::error_type __ecode) __throw_regex_error(regex_constants::error_type __ecode
{ throw regex_error(__ecode); } __attribute__((unused)))
#else { _GLIBCXX_THROW_OR_ABORT(regex_error(__ecode)); }
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
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
...@@ -32,9 +32,8 @@ void test01() ...@@ -32,9 +32,8 @@ void test01()
{ {
X* px = 0; X* px = 0;
std::shared_ptr<X> p1(px); // { dg-error "here" } std::shared_ptr<X> p1(px); // { dg-error "here" }
// { dg-error "incomplete" "" { target *-*-* } 775 } // { dg-error "incomplete" "" { target *-*-* } 769 }
std::shared_ptr<X> p9(ap()); // { dg-error "here" } std::shared_ptr<X> p9(ap()); // { dg-error "here" }
// { dg-error "incomplete" "" { target *-*-* } 307 } // { dg-error "incomplete" "" { target *-*-* } 307 }
} }
...@@ -28,6 +28,6 @@ int n1 = std::get<1>(a); ...@@ -28,6 +28,6 @@ int n1 = std::get<1>(a);
int n2 = std::get<1>(std::move(a)); int n2 = std::get<1>(std::move(a));
int n3 = std::get<1>(ca); 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 *-*-* } 283 }
// { dg-error "static assertion failed" "" { target *-*-* } 291 }
...@@ -23,4 +23,4 @@ ...@@ -23,4 +23,4 @@
typedef std::tuple_element<1, std::array<int, 1>>::type type; typedef std::tuple_element<1, std::array<int, 1>>::type type;
// { dg-error "static assertion failed" "" { target *-*-* } 314 } // { dg-error "static assertion failed" "" { target *-*-* } 306 }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// Otherwise we may get *multiple* errors. // Otherwise we may get *multiple* errors.
#undef _GLIBCXX_PARALLEL #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 // 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 // software; you can redistribute it and/or modify it under the
...@@ -25,4 +25,4 @@ ...@@ -25,4 +25,4 @@
#include <vector> #include <vector>
// { dg-error "multiple inlined namespaces" "" { target *-*-* } 262 } // { dg-error "multiple inlined namespaces" "" { target *-*-* } 269 }
// { dg-do compile } // { 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 // 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 // software; you can redistribute it and/or modify it under the
...@@ -30,9 +30,8 @@ void test01() ...@@ -30,9 +30,8 @@ void test01()
{ {
X* px = 0; X* px = 0;
std::tr1::shared_ptr<X> p1(px); // { dg-error "here" } std::tr1::shared_ptr<X> p1(px); // { dg-error "here" }
// { dg-error "incomplete" "" { target *-*-* } 563 } // { dg-error "incomplete" "" { target *-*-* } 556 }
std::tr1::shared_ptr<X> p9(ap()); // { dg-error "here" } std::tr1::shared_ptr<X> p9(ap()); // { dg-error "here" }
// { dg-error "incomplete" "" { target *-*-* } 602 } // { dg-error "incomplete" "" { target *-*-* } 595 }
} }
// -*- C++ -*- // -*- 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 // 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 // software; you can redistribute it and/or modify it under the terms
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
// along with this library; see the file COPYING3. If not see // along with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL. // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
// Permission to use, copy, modify, sell, and distribute this software // Permission to use, copy, modify, sell, and distribute this software
...@@ -49,13 +48,7 @@ namespace __gnu_pbds ...@@ -49,13 +48,7 @@ namespace __gnu_pbds
// Substitute for concurrence_error object in the case of -fno-exceptions. // Substitute for concurrence_error object in the case of -fno-exceptions.
inline void inline void
__throw_illegal_input_error() __throw_illegal_input_error()
{ { _GLIBCXX_THROW_OR_ABORT(illegal_input_error()); }
#if __EXCEPTIONS
throw illegal_input_error();
#else
__builtin_abort();
#endif
}
} // namespace test } // namespace test
} // namespace __gnu_pbds } // namespace __gnu_pbds
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment