gcc/libstdc++-v3/libsupc++
Jonathan Wakely a8e02a00a0 libstdc++: Make std::make_exception_ptr work with -fno-exceptions [PR85813]
This allows std::make_exception_ptr to be used in a translation unit
compiled with -fno-exceptions. This works because the new implementation
added for PR 68297 doesn't need to throw or catch anything. The catch is
there to handle exceptions from the constructor of the exception object,
which we can assume won't happen in a -fno-exceptions TU and so use the
__catch macro instead. If the constructor does throw (because it's
defined in a different TU which was compiled with exceptions enabled)
then that exception will propagate to the make_exception_ptr caller.
That seems acceptable for a program that is trying to mix & match TUs
compiled with and without exceptions, and using types that throw when
constructed. That should be rare, and can't reasonably be expected to
have sensible behaviour.

This also enables the new implementation for targets that use a
non-standard calling convention for the exceptionDestructor callback
(specifically, mingw, which uses __thiscall). All we need to do is mark
the __dest_thunk function template with the right calling convention.

Finally, the useless no-op definition of make_exception_ptr (which is
only used if both RTTI and exceptions are disabled) is marked
always_inline, to ensure that the linker won't keep that definition and
discard the functional ones when both definitions of the function are
present in the link. An alternative would be to add the abi_tag
attribute to the useless definition, but making it always_inline should
work, and it's small enough to always be inlined reliably.

libstdc++-v3/ChangeLog:

	PR libstdc++/85813
	* libsupc++/exception_ptr.h (__dest_thunk): Add macro for
	destructor calling convention.
	(make_exception_ptr): Enable non-throwing implementation for
	-fno-exceptions and for non-standard calling conventions. Use
	always_inline attribute on the useless no-rtti no-exceptions
	definition.
	* testsuite/18_support/exception_ptr/64241.cc: Add -fno-rtti so
	the no-op implementation is still used.
2021-12-09 23:12:20 +00:00
..
Makefile.am libstdc++: Move atomic functions to libsupc++ [PR 96657] 2021-04-15 16:56:44 +01:00
Makefile.in libstdc++: Move atomic functions to libsupc++ [PR 96657] 2021-04-15 16:56:44 +01:00
array_type_info.cc Update copyright years. 2021-01-04 10:26:59 +01:00
atexit_arm.cc Update copyright years. 2021-01-04 10:26:59 +01:00
atexit_thread.cc Update copyright years. 2021-01-04 10:26:59 +01:00
atomic_lockfree_defines.h libstdc++: Fix doxygen markup for group close commands 2021-04-06 16:43:24 +01:00
bad_alloc.cc Update copyright years. 2021-01-04 10:26:59 +01:00
bad_array_length.cc Update copyright years. 2021-01-04 10:26:59 +01:00
bad_array_new.cc Update copyright years. 2021-01-04 10:26:59 +01:00
bad_cast.cc Update copyright years. 2021-01-04 10:26:59 +01:00
bad_typeid.cc Update copyright years. 2021-01-04 10:26:59 +01:00
class_type_info.cc Update copyright years. 2021-01-04 10:26:59 +01:00
compare libstdc++: Define std::__is_constant_evaluated() for internal use 2021-12-01 15:00:33 +00:00
cxxabi.h Update copyright years. 2021-01-04 10:26:59 +01:00
cxxabi_forced.h Update copyright years. 2021-01-04 10:26:59 +01:00
cxxabi_init_exception.h Update copyright years. 2021-01-04 10:26:59 +01:00
del_op.cc Update copyright years. 2021-01-04 10:26:59 +01:00
del_opa.cc Update copyright years. 2021-01-04 10:26:59 +01:00
del_opant.cc Update copyright years. 2021-01-04 10:26:59 +01:00
del_opnt.cc Update copyright years. 2021-01-04 10:26:59 +01:00
del_ops.cc Update copyright years. 2021-01-04 10:26:59 +01:00
del_opsa.cc Update copyright years. 2021-01-04 10:26:59 +01:00
del_opv.cc Update copyright years. 2021-01-04 10:26:59 +01:00
del_opva.cc Update copyright years. 2021-01-04 10:26:59 +01:00
del_opvant.cc Update copyright years. 2021-01-04 10:26:59 +01:00
del_opvnt.cc Update copyright years. 2021-01-04 10:26:59 +01:00
del_opvs.cc Update copyright years. 2021-01-04 10:26:59 +01:00
del_opvsa.cc Update copyright years. 2021-01-04 10:26:59 +01:00
dyncast.cc libstdc++: Use __builtin_expect in __dynamic_cast 2021-08-23 14:45:00 +01:00
eh_alloc.cc Update copyright years. 2021-01-04 10:26:59 +01:00
eh_arm.cc Update copyright years. 2021-01-04 10:26:59 +01:00
eh_atomics.h Update copyright years. 2021-01-04 10:26:59 +01:00
eh_aux_runtime.cc Update copyright years. 2021-01-04 10:26:59 +01:00
eh_call.cc Update copyright years. 2021-01-04 10:26:59 +01:00
eh_catch.cc Update copyright years. 2021-01-04 10:26:59 +01:00
eh_exception.cc Update copyright years. 2021-01-04 10:26:59 +01:00
eh_globals.cc Update copyright years. 2021-01-04 10:26:59 +01:00
eh_personality.cc libstdc++: Deprecate std::unexpected and handler functions 2021-11-04 20:53:29 +00:00
eh_ptr.cc libstdc++: Deprecate std::unexpected and handler functions 2021-11-04 20:53:29 +00:00
eh_term_handler.cc Update copyright years. 2021-01-04 10:26:59 +01:00
eh_term_handler.h Update copyright years. 2021-01-04 10:26:59 +01:00
eh_terminate.cc libstdc++: Deprecate std::unexpected and handler functions 2021-11-04 20:53:29 +00:00
eh_throw.cc libstdc++: Deprecate std::unexpected and handler functions 2021-11-04 20:53:29 +00:00
eh_tm.cc Update copyright years. 2021-01-04 10:26:59 +01:00
eh_type.cc Update copyright years. 2021-01-04 10:26:59 +01:00
eh_unex_handler.cc Update copyright years. 2021-01-04 10:26:59 +01:00
enum_type_info.cc Update copyright years. 2021-01-04 10:26:59 +01:00
exception libstdc++: Deprecate std::unexpected and handler functions 2021-11-04 20:53:29 +00:00
exception.h libstdc++: Improvements to Doxygen markup 2021-07-01 18:45:48 +01:00
exception_defines.h Update copyright years. 2021-01-04 10:26:59 +01:00
exception_ptr.h libstdc++: Make std::make_exception_ptr work with -fno-exceptions [PR85813] 2021-12-09 23:12:20 +00:00
function_type_info.cc Update copyright years. 2021-01-04 10:26:59 +01:00
fundamental_type_info.cc Update copyright years. 2021-01-04 10:26:59 +01:00
guard.cc Update copyright years. 2021-01-04 10:26:59 +01:00
guard_error.cc Update copyright years. 2021-01-04 10:26:59 +01:00
hash_bytes.cc Update copyright years. 2021-01-04 10:26:59 +01:00
hash_bytes.h Update copyright years. 2021-01-04 10:26:59 +01:00
initializer_list Update copyright years. 2021-01-04 10:26:59 +01:00
nested_exception.cc Update copyright years. 2021-01-04 10:26:59 +01:00
nested_exception.h libstdc++: Fix doxygen markup for group close commands 2021-04-06 16:43:24 +01:00
new c++: implement C++17 hardware interference size 2021-09-13 12:28:06 -04:00
new_handler.cc Update copyright years. 2021-01-04 10:26:59 +01:00
new_op.cc Update copyright years. 2021-01-04 10:26:59 +01:00
new_opa.cc libstdc++: Declare malloc for freestanding 2021-03-25 18:25:40 +00:00
new_opant.cc Update copyright years. 2021-01-04 10:26:59 +01:00
new_opnt.cc Update copyright years. 2021-01-04 10:26:59 +01:00
new_opv.cc Update copyright years. 2021-01-04 10:26:59 +01:00
new_opva.cc Update copyright years. 2021-01-04 10:26:59 +01:00
new_opvant.cc Update copyright years. 2021-01-04 10:26:59 +01:00
new_opvnt.cc Update copyright years. 2021-01-04 10:26:59 +01:00
pbase_type_info.cc Update copyright years. 2021-01-04 10:26:59 +01:00
pmem_type_info.cc Update copyright years. 2021-01-04 10:26:59 +01:00
pointer_type_info.cc Update copyright years. 2021-01-04 10:26:59 +01:00
pure.cc Update copyright years. 2021-01-04 10:26:59 +01:00
si_class_type_info.cc Update copyright years. 2021-01-04 10:26:59 +01:00
tinfo.cc Update copyright years. 2021-01-04 10:26:59 +01:00
tinfo.h Update copyright years. 2021-01-04 10:26:59 +01:00
tinfo2.cc libstdc++: Fix std::type_info::before for ARM [PR103240] 2021-11-17 17:21:24 +00:00
typeinfo Update copyright years. 2021-01-04 10:26:59 +01:00
unwind-cxx.h libstdc++: Deprecate std::unexpected and handler functions 2021-11-04 20:53:29 +00:00
vec.cc Update copyright years. 2021-01-04 10:26:59 +01:00
vmi_class_type_info.cc Update copyright years. 2021-01-04 10:26:59 +01:00
vterminate.cc Update copyright years. 2021-01-04 10:26:59 +01:00
vtv_stubs.cc Update copyright years. 2021-01-04 10:26:59 +01:00