[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Bug libstdc++/14493] No std::bad_alloc::what() const



------- Additional Comments From phil at jaj dot com  2004-03-09 19:32 -------
Subject: Re: Bug#236912:  No std::bad_alloc::what() const

On Tue, Mar 09, 2004 at 07:32:32PM +0100, Jeroen T. Vermeulen wrote:
> On Tue, Mar 09, 2004 at 06:14:59AM +0100, Matthias Klose wrote:
> 
> > > More to the point, it doesn't matter how it's implemented, and the user
> > > should not care.  It only matters that
> > > 
> > >     std::bad_alloc foo;
> > >     std::cerr << foo.what() << std::endl;
> > > 
> > > works, which the submitter didn't apparently try.  Looking at the original
> 
> Apparently whoever said this hasn't seen the bug report, and it got
> rephrased somewhere along the line.

No, I read it.

> I was wrong in my assumption that
> std::bad_alloc should override what(), but the problem remains: the
> message coming out of what(), "St9bad_alloc" is incomprehensible to
> a normal user.

If you mean to complain about X, then don't complain about Y.  Don't title
your bug reports "Y is missing" when you find you don't like the behavior
of X.  Don't assume that X and Y have anything to do with one another.

The output of what() is described in the library documentation.  There is
also documentation provided on how to run the demangler on the string, e.g.,

    std::cerr << the_demangler_function(foo.what()) << std::endl;



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14493

------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.



Reply to: