This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] libstdc++/14493
Hi Howard,
ABI concerns? Say a client that derived from bad_alloc and
overloaded what()? Wouldn't his what() get corrupted (call the wrong
what())? Other than that (and hope I'm wrong) I like this change.
thanks for asking, better be safe, this PR remained open so much time...
Anyway, are you considering a situation like compiling the following
with a previous compiler:
#include <new>
#include <cstring>
#include <cassert>
struct my_bad_alloc
: std::bad_alloc
{
virtual const char*
what() const throw()
{ return "my_bad_alloc"; }
};
int main()
{
my_bad_alloc mba;
assert( !strcmp(mba.what(), "my_bad_alloc") );
}
and running it (linking it) vs the new .so? It runs fine.
Paolo.