This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/72768] Potential bug about the order of destructors of static objects and atexit() callbacks in C++?
- From: "lh_mouse at 126 dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 02 Aug 2016 01:46:38 +0000
- Subject: [Bug c++/72768] Potential bug about the order of destructors of static objects and atexit() callbacks in C++?
- Auto-submitted: auto-generated
- References: <bug-72768-4@http.gcc.gnu.org/bugzilla/>
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.)