This fixes the error
.../testsuite_allocator.h:402:13: error: exception handling disabled, use '-fexceptions' to enable
402 | catch(...)
| ^~~~~
seen when running some C++23 library tests with -fno-exceptions.
libstdc++-v3/ChangeLog:
* testsuite/util/testsuite_allocator.h
(uneq_allocator::allocate): Use __try/__catch instead.
(uneq_allocator::allocate_at_least): Likewise.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
if (std::__is_constant_evaluated())
return p;
- try
+ __try
{
get_map().insert(map_type::value_type(reinterpret_cast<void*>(p),
personality));
}
- catch(...)
+ __catch(...)
{
AllocTraits::deallocate(*this, p, n);
__throw_exception_again;
{ return r; }
else
{
- try
+ __try
{
get_map().insert(map_type::value_type(
reinterpret_cast<void*>(r.ptr), personality));
}
- catch(...)
+ __catch(...)
{
AllocTraits::deallocate(*this, r.ptr, r.count);
__throw_exception_again;