gcc/libstdc++-v3/testsuite/18_support
Jonathan Wakely 50c2df93a6 PR libstdc++/51333 Define recursive_init_error constructor non-inline
The recursive_init_error class is defined in a header, with an inline
constructor, but the definition of the vtable and destructor are not
exported from the shared library. With -fkeep-inline-functions the
constructor gets emitted in user code, and requires the (non-exported)
vtable. This fails to link.

As far as I can tell, the recursive_init_error class definition was
moved into <cxxabi.h> so it could be documented with Doxygen, not for
any technical reason. But now it's there (and documented), somebody
could be relying on it, by catching that type and possibly performing
derived-to-base conversions to the std::exception base class. So the
conservative fix is to leave the class definition in the header but make
the constructor non-inline. This still allows the type to be caught and
still defines its base class. User code can no longer construct objects
of that type, but that's not something we need to support.

	PR libstdc++/51333
	* libsupc++/cxxabi.h (__gnu_cxx::recursive_init_error): Do not define
	constructor inline.
	* libsupc++/guard_error.cc (__gnu_cxx::recursive_init_error): Define
	constructor.
	* testsuite/18_support/51333.cc: New test.

From-SVN: r273878
2019-07-29 15:27:19 +01:00
..
aligned_alloc
bad_alloc
bad_cast
bad_exception
bad_typeid
byte P0482R5 char8_t: Updates to existing standard library tests 2019-02-22 01:16:08 +00:00
exception
exception_ptr
headers Define C11 macros such as FLT_DECIMAL_DIG for C++17 2019-06-24 13:09:47 +01:00
initializer_list
launder
max_align_t/requirements
nested_exception
numeric_limits P0482R5 char8_t: Updates to existing standard library tests 2019-02-22 01:16:08 +00:00
quick_exit
type_info P0482R5 char8_t: Updates to existing standard library tests 2019-02-22 01:16:08 +00:00
uncaught_exception
uncaught_exceptions
50594.cc
51333.cc PR libstdc++/51333 Define recursive_init_error constructor non-inline 2019-07-29 15:27:19 +01:00
cxa_vec.cc
destroying_delete.cc PR libstdc++/89345 Only define std::destroying_delete for C++2a 2019-02-13 22:13:45 +00:00
free_eh_pool.cc
new_aligned.cc
new_delete_placement.cc
new_handler.cc
new_nothrow.cc
pthread_guard.cc
set_terminate.cc Fix tests that fail with -std=gnu++98 or -std=gnu++11 2019-06-06 13:13:42 +01:00
set_unexpected.cc Fix tests that fail with -std=gnu++98 or -std=gnu++11 2019-06-06 13:13:42 +01:00
terminate_handler.cc
unexpected_handler.cc