The effects of calling member what after the assignment depend on the particular library implementation.
Every exception within the C++ standard library (including this) has, at least, a copy assignment operator overload that preserves the string representation returned by member what when the dynamic types match.