https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103711
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2021-12-15
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Usually when a constructor throws you don't call the destructor, because the
object hasn't finished being constructed yet. But for a delegating constructor,
once the target constructor finishes the object's lifetime has begun, and so
the destructor *does* get run. It seems that both B::B() and B::B(int) think
they are in-charge of the virtual base and so both run the destructor for it.
G++ has had this bug since delegating constructor were first implemented in GCC
4.7.0