* testsuite/util/testsuite_hooks.h (THROW): Define.
* testsuite/util/replacement_memory_operators.h: Include
testsuite_hooks.h and use THROW macro.
* testsuite/util/testsuite_tr1.h: Likewise.
* testsuite/20_util/allocator/1.cc: Use THROW macro.
* testsuite/22_locale/locale/cons/12352.cc: Likewise.
* testsuite/23_containers/vector/zero_sized_allocations.cc: Likewise.
* testsuite/30_threads/lock_guard/cons/1.cc: Replace dynamic exception
specification with noexcept-specifier.
* testsuite/ext/pool_allocator/allocate_chunk.cc: Include
testsuite_hooks.h and use THROW macro.
* testsuite/ext/profile/replace_new.cc: Likewise.
From-SVN: r243353
2016-12-07 Jonathan Wakely <jwakely@redhat.com>
+ * testsuite/util/testsuite_hooks.h (THROW): Define.
+ * testsuite/util/replacement_memory_operators.h: Include
+ testsuite_hooks.h and use THROW macro.
+ * testsuite/util/testsuite_tr1.h: Likewise.
+ * testsuite/20_util/allocator/1.cc: Use THROW macro.
+ * testsuite/22_locale/locale/cons/12352.cc: Likewise.
+ * testsuite/23_containers/vector/zero_sized_allocations.cc: Likewise.
+ * testsuite/30_threads/lock_guard/cons/1.cc: Replace dynamic exception
+ specification with noexcept-specifier.
+ * testsuite/ext/pool_allocator/allocate_chunk.cc: Include
+ testsuite_hooks.h and use THROW macro.
+ * testsuite/ext/profile/replace_new.cc: Likewise.
+
* include/ext/bitmap_allocator.h (bitmap_allocator::_S_refill_pool)
(bitmap_allocator::_M_allocate_single_object)
(bitmap_allocator::_M_get): Use _GLIBCXX_THROW macro.
bool check_delete = false;
void*
-operator new(std::size_t n) throw(std::bad_alloc)
+operator new(std::size_t n) THROW(std::bad_alloc)
{
check_new = true;
return std::malloc(n);
std::free(p);
}
-void* operator new(std::size_t n) throw (std::bad_alloc)
+void* operator new(std::size_t n) THROW (std::bad_alloc)
{
void* ret = allocate(n);
if (!ret)
return ret;
}
-void* operator new[](std::size_t n) throw (std::bad_alloc)
+void* operator new[](std::size_t n) THROW (std::bad_alloc)
{
void* ret = allocate(n);
if (!ret)
unsigned int zero_sized_news = 0;
-void *operator new(std::size_t size) throw (std::bad_alloc)
+void *operator new(std::size_t size) THROW (std::bad_alloc)
{
/* malloc(0) is unpredictable; avoid it. */
if (size == 0)
{
Mutex() : locked(false) { }
- ~Mutex() throw(int)
+ ~Mutex() noexcept(false)
{
if (locked)
throw 0;
// 20.4.1.1 allocator members
#include <ext/pool_allocator.h>
+#include <testsuite_hooks.h>
struct small
{
};
void*
-operator new(size_t n) throw(std::bad_alloc)
+operator new(size_t n) THROW(std::bad_alloc)
{
static bool first = true;
if (!first)
// { dg-require-profile-mode "" }
#include <vector>
+#include <testsuite_hooks.h>
using std::vector;
-void* operator new(std::size_t size) throw(std::bad_alloc)
+void* operator new(std::size_t size) THROW(std::bad_alloc)
{
void* p = std::malloc(size);
if (!p)
#include <stdexcept>
#include <cstdlib>
#include <cstdio>
+#include <testsuite_hooks.h>
namespace __gnu_test
{
counter() : _M_count(0), _M_throw(true) { }
- ~counter() throw (counter_error)
+ ~counter() THROW (counter_error)
{
if (_M_throw && _M_count != 0)
throw counter_error();
}
} // namespace __gnu_test
-void* operator new(std::size_t size) throw(std::bad_alloc)
+void* operator new(std::size_t size) THROW(std::bad_alloc)
{
std::printf("operator new is called \n");
void* p = std::malloc(size);
#langTERR ".ISO8859-" #part "@euro" : #langTERR ".ISO8859-" #part)
#endif
+#if __cplusplus < 201103L
+# define THROW(X) throw(X)
+#else
+# define THROW(X) noexcept(false)
+#endif
+
namespace __gnu_test
{
// All macros are defined in GLIBCXX_CONFIGURE_TESTSUITE and imported
#define _GLIBCXX_TESTSUITE_TR1_H
#include <ext/type_traits.h>
+#include <testsuite_hooks.h>
namespace __gnu_test
{
struct ThrowExplicitClass
{
- ThrowExplicitClass(double&) throw(int);
- explicit ThrowExplicitClass(int&) throw(int);
- ThrowExplicitClass(double&, int&, double&) throw(int);
+ ThrowExplicitClass(double&) THROW(int);
+ explicit ThrowExplicitClass(int&) THROW(int);
+ ThrowExplicitClass(double&, int&, double&) THROW(int);
};
struct ThrowDefaultClass
{
- ThrowDefaultClass() throw(int);
+ ThrowDefaultClass() THROW(int);
};
struct ThrowCopyConsClass
{
- ThrowCopyConsClass(const ThrowCopyConsClass&) throw(int);
+ ThrowCopyConsClass(const ThrowCopyConsClass&) THROW(int);
};
#if __cplusplus >= 201103L
struct ThrowMoveConsClass
{
- ThrowMoveConsClass(ThrowMoveConsClass&&) throw(int);
+ ThrowMoveConsClass(ThrowMoveConsClass&&) THROW(int);
};
struct NoexceptExplicitClass
struct TD2
{
- ~TD2() throw(int);
+ ~TD2() THROW(int);
};
struct Aggr