From 386f5507cb8ec99c03ca535bea4f8bd61e0de910 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Tue, 15 Jan 2019 23:55:37 +0300 Subject: [PATCH] extract exception type name from std::exception_ptr on libstdc++ --- include/boost/exception/diagnostic_information.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/exception/diagnostic_information.hpp b/include/boost/exception/diagnostic_information.hpp index 48f06a0..f5033b7 100644 --- a/include/boost/exception/diagnostic_information.hpp +++ b/include/boost/exception/diagnostic_information.hpp @@ -45,6 +45,10 @@ boost std::exception const * se=current_exception_cast(); if( be || se ) return exception_detail::diagnostic_information_impl(be,se,true,verbose); +#if defined(__GLIBCXX__) && __cplusplus >= 201103L && !defined(BOOST_NO_RTTI) + else if (auto* p=std::current_exception().__cxa_exception_type()) + return "Dynamic exception type: "+boost::core::demangle(p->name()); +#endif else return "No diagnostic information available."; }