Re: [Boost-bugs] [Boost C++ Libraries] #9069: boost::to_string(boost::original_exception_type) needs demangling

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9069: boost::to_string(boost::original_exception_type) needs demangling
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-09-10 05:06:11


#9069: boost::to_string(boost::original_exception_type) needs demangling
-------------------------------+----------------------------
  Reporter: sarum9in@… | Owner: emildotchevski
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: exception
   Version: Boost 1.54.0 | Severity: Problem
Resolution: fixed | Keywords:
-------------------------------+----------------------------
Changes (by emildotchevski):

 * status: new => closed
 * resolution: => fixed


Old description:

> Header: boost/exception/detail/exception_ptr.hpp
>
> Current definition of original_exception_type is
> {{{
> typedef error_info<struct tag_original_exception_type,std::type_info
> const *> original_exception_type;
> }}}
>
> It uses std::type_info to store original type.
>

> Current definition of to_string is
> {{{
> inline
> std::string
> to_string( original_exception_type const & x )
> {
> return x.value()->name();
> }
> }}}
>
> to_string() returns std::type_info::name() without demangling, so user
> gets type name like "St13runtime_error". It would be better to get
> "std::runtime_error".
>
> I suggest using
> {{{
> inline
> std::string
> to_string( original_exception_type const & x )
> {
> return units::detail::demangle(x.value()->name());
> }
> }}}
>
> units::detail::demangle() is already used in boost::exception library, so
> no new dependency is introduced.

New description:

 Trunk revision number 85634.

--
-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9069#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC