gcc/libstdc++-v3/testsuite/18_support
Jonathan Wakely 03cb6904d1 libstdc++: Remove reliance on unspecified behaviour in std::rethrow_if_nested test
This test case calls std::set_terminate while there is an active
exception. Since LWG 2111 it is unspecified which terminate handler is
used when std::nested_exception::rethrow_nested() calls std::terminate.
With libsupc++ the global handler changed by std::set_terminate is used,
but libc++abi uses the active exception's handler (the one that was
current when the exception was first thrown).

Adjust the test case so that it works with either implementation choice.
So that the process doesn't exit cleanly if std::terminate happens
sooner than expected, use a global variable to control when the "clean
terminate" behaviour happens.

libstdc++-v3/ChangeLog:

	* testsuite/18_support/nested_exception/rethrow_if_nested-term.cc:
	Call std::set_terminate before throwing the nested exception.
2023-08-21 10:43:19 +01:00
..
aligned_alloc
bad_alloc
bad_cast
bad_exception
bad_typeid
byte
comparisons
coroutines
exception
exception_ptr
headers
initializer_list
launder
max_align_t/requirements
nested_exception
numeric_limits
quick_exit
source_location
type_info
uncaught_exception
uncaught_exceptions
50594.cc
51333.cc
96817.cc
105387.cc
105387_memptr.cc
cxa_vec.cc
destroying_delete.cc
free_eh_pool.cc
new_aligned.cc
new_delete_placement.cc
new_handler.cc
new_nothrow.cc Update copyright years. 2023-01-16 11:52:17 +01:00
pthread_guard.cc
set_terminate.cc
set_unexpected.cc
terminate_handler.cc
unexpected_handler.cc