This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/72768] Potential bug about the order of destructors of static objects and atexit() callbacks in C++?


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72768

--- Comment #2 from lh_mouse <lh_mouse at 126 dot com> ---
(In reply to Jonathan Wakely from comment #1)
> Arguably the object is not completely initialized until the principal
> constructor returns.

I doubt it. If an exception is thrown inside the principal ctor which delegates
to another one, the dtor is called. It doesn't make sense to call a dtor on an
object that has not been completely initialized.
(A public target ctor and a private one have different semantical purposes, but
it is a different story.)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]