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 Update copyright years. 2019-01-01 13:31:55 +01:00
bad_alloc Update copyright years. 2019-01-01 13:31:55 +01:00
bad_cast Update copyright years. 2019-01-01 13:31:55 +01:00
bad_exception Update copyright years. 2019-01-01 13:31:55 +01:00
bad_typeid Update copyright years. 2019-01-01 13:31:55 +01:00
byte P0482R5 char8_t: Updates to existing standard library tests 2019-02-22 01:16:08 +00:00
exception Update copyright years. 2019-01-01 13:31:55 +01:00
exception_ptr Update copyright years. 2019-01-01 13:31:55 +01:00
headers Define C11 macros such as FLT_DECIMAL_DIG for C++17 2019-06-24 13:09:47 +01:00
initializer_list Update copyright years. 2019-01-01 13:31:55 +01:00
launder Update copyright years. 2019-01-01 13:31:55 +01:00
max_align_t/requirements Update copyright years. 2019-01-01 13:31:55 +01:00
nested_exception Update copyright years. 2019-01-01 13:31:55 +01:00
numeric_limits P0482R5 char8_t: Updates to existing standard library tests 2019-02-22 01:16:08 +00:00
quick_exit Update copyright years. 2019-01-01 13:31:55 +01:00
type_info P0482R5 char8_t: Updates to existing standard library tests 2019-02-22 01:16:08 +00:00
uncaught_exception Update copyright years. 2019-01-01 13:31:55 +01:00
uncaught_exceptions Update copyright years. 2019-01-01 13:31:55 +01:00
50594.cc Update copyright years. 2019-01-01 13:31:55 +01:00
51333.cc PR libstdc++/51333 Define recursive_init_error constructor non-inline 2019-07-29 15:27:19 +01:00
cxa_vec.cc Update copyright years. 2019-01-01 13:31:55 +01:00
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 Update copyright years. 2019-01-01 13:31:55 +01:00
new_aligned.cc Update copyright years. 2019-01-01 13:31:55 +01:00
new_delete_placement.cc Update copyright years. 2019-01-01 13:31:55 +01:00
new_handler.cc Update copyright years. 2019-01-01 13:31:55 +01:00
new_nothrow.cc Update copyright years. 2019-01-01 13:31:55 +01:00
pthread_guard.cc Update copyright years. 2019-01-01 13:31:55 +01:00
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 Update copyright years. 2019-01-01 13:31:55 +01:00
unexpected_handler.cc Update copyright years. 2019-01-01 13:31:55 +01:00