aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/libsupc++
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2012-11-07 13:20:33 +0000
committerPaolo Carlini <paolo.carlini@oracle.com>2012-11-07 13:20:33 +0000
commitca53dddfcf9283383d64906cb0869f858c8e22cc (patch)
tree5e8df8f8120799af6eda74296cbb619955ece69b /libstdc++-v3/libsupc++
parentb4683ce1dfba5ad2b985e4e5ab60daab79517861 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@193295 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r--libstdc++-v3/libsupc++/eh_aux_runtime.cc19
-rw-r--r--libstdc++-v3/libsupc++/eh_personality.cc2
-rw-r--r--libstdc++-v3/libsupc++/new_op.cc9
-rw-r--r--libstdc++-v3/libsupc++/vec.cc13
4 files changed, 8 insertions, 35 deletions
diff --git a/libstdc++-v3/libsupc++/eh_aux_runtime.cc b/libstdc++-v3/libsupc++/eh_aux_runtime.cc
index c6abe354647..0cbce24d316 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 72f596e0692..2963c0c584a 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 bb0199e969e..7366d556fd8 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 507514ec76a..04cb3fa6436 100644
--- a/libstdc++-v3/libsupc++/vec.cc
+++ b/libstdc++-v3/libsupc++/vec.cc
@@ -28,7 +28,6 @@
#include <cxxabi.h>
#include <new>
#include <exception>
-#include <cstdlib>
#include <bits/exception_defines.h>
#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;
}
}