This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/14493] std::bad_alloc::what() does not explain what happened
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jan 2007 02:21:28 -0000
- Subject: [Bug libstdc++/14493] std::bad_alloc::what() does not explain what happened
- References: <bug-14493-5724@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #24 from pcarlini at suse dot de 2007-01-30 02:21 -------
(In reply to comment #23)
> From consistency point of view I would say that the change should also
> be done for std::exception.
Right.
> However, the use of typeid is very convenient in the sense that we
> have to defined what() only once. Now, if we change that definition
> in std::exception, it means that we should revisit all other exception
> classes, such as std::runtime_error, etc.
I see, but I don't think we have to do much, because the other exception
classes, provided in <stdexcept>, per the standard requirements are already
overriding what() to return _M_msg.c_str(). Thus, I'm coming to the conclusion
that we should consistently change std::exception too and be done with it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14493