summaryrefslogtreecommitdiff
path: root/libstdc++-v3/libsupc++/guard_error.cc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-07-29 15:27:19 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2019-07-29 15:27:19 +0100
commit50c2df93a6a450228b75901fad7e20cd2e7a8ee7 (patch)
tree81c6660b7e989411cd2d0e87e10131e089614cfd /libstdc++-v3/libsupc++/guard_error.cc
parent390c0dd61dc36a6eca8262b9814aa00e1bba5483 (diff)
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
Diffstat (limited to 'libstdc++-v3/libsupc++/guard_error.cc')
-rw-r--r--libstdc++-v3/libsupc++/guard_error.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/libsupc++/guard_error.cc b/libstdc++-v3/libsupc++/guard_error.cc
index 7595c67872a..d7625af4d54 100644
--- a/libstdc++-v3/libsupc++/guard_error.cc
+++ b/libstdc++-v3/libsupc++/guard_error.cc
@@ -26,6 +26,6 @@
namespace __gnu_cxx
{
- recursive_init_error::~recursive_init_error() throw() { }
+ recursive_init_error::recursive_init_error() noexcept { }
+ recursive_init_error::~recursive_init_error() noexcept { }
}
-