This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17873] New: order of static destructors wrong
- From: "bkoz at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Oct 2004 22:59:13 -0000
- Subject: [Bug c++/17873] New: order of static destructors wrong
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Known to work: g++-3.3.3
Known to work: icc-8.1
Known to fail: gcc 4.0.0, gcc-3.4.2
This is a regression.
The attached program shows a problem with static destruction. According to:
3.6.3 - Termination [basic.start.term]
...These objects are destroyed in the reverse order of the completion of their
constructor or of the completion of their dynamic initialization.
However, it looks like mainline is not doing this at the moment.
Expected output:
%a.out
boo ctor
foo ctor
foo dtor
boo dtor
Output with 3.4.2/mainline:
%a.out
boo ctor
foo ctor
boo dtor
foo dtor
Anyway. This is a reduced testcase for the way __mt_alloc is settting itself up.
So, fixing this is appreciated.
--
Summary: order of static destructors wrong
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bkoz at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17873